WooCommerce add to cart button CSS code example
Example 1: how to change add to cart text button woocommerce
// To change add to cart text on single product page
add_filter( 'woocommerce_product_single_add_to_cart_text', 'woocommerce_custom_single_add_to_cart_text' );
function woocommerce_custom_single_add_to_cart_text() {
return __( 'Buy Now', 'woocommerce' );
}
// To change add to cart text on product archives(Collection) page
add_filter( 'woocommerce_product_add_to_cart_text', 'woocommerce_custom_product_add_to_cart_text' );
function woocommerce_custom_product_add_to_cart_text() {
return __( 'Buy Now', 'woocommerce' );
}
Example 2: woocommerce cart css description
.button[name="apply_coupon"] {
background-color: transparent;
color: #13aff0;
}
.button[name="apply_coupon"]:hover {
background-color: transparent;
text-decoration: underline;
}
.button[name="update_cart"] {
background-color: #e2e2e2;
color: #13aff0;
}
.button[name="update_cart"]:hover {
filter: brightness(115%);
}