Answers for "how to change add to cart button text in woocommerce"

PHP
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' );
}
Posted by: Guest on November-04-2020
0

add content after add to cart button woo commerce

add_action( 'woocommerce_after_add_to_cart_button', 'add_content_after_addtocart_button_func' );

function add_content_after_addtocart_button_func() {

// Echo content.

echo '<div class="second_content">Place your content here!</div>';

}
Posted by: Guest on April-21-2021

Code answers related to "how to change add to cart button text in woocommerce"

Browse Popular Code Answers by Language