Answers for "woocommerce add to cart button name change with file location"

PHP
0

woocommerce add to cart button name change with file location

// 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 September-27-2021
0

woocommerce add to cart button name change with file location

// 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 September-27-2021

Code answers related to "woocommerce add to cart button name change with file location"

Browse Popular Code Answers by Language