Add to Cart text on Floating bar
-
Hi,
I’m using Oceanwp demo site, STORE.
I would like to change the text “Add to cart” or “Select options” button which are on floating bar.I tryed the code below and it changed the text on th ebuttons, but I need to change only the text on floating bar.
Thank you!!
/// Change add to cart text on single product page
add_filter( ‘woocommerce_product_single_add_to_cart_text’, ‘woocommerce_add_to_cart_button_text_single’ );
function woocommerce_add_to_cart_button_text_single() {
return __( ‘Add to Cart’, ‘woocommerce’ );
}// Change add to cart text on product archives page
add_filter( ‘woocommerce_product_add_to_cart_text’, ‘woocommerce_add_to_cart_button_text_archives’ );
function woocommerce_add_to_cart_button_text_archives() {
return __( ‘See Detail’, ‘woocommerce’ );
}// Change add to cart text on single product page
add_filter(‘woocommerce_product_single_add_to_cart_text’, ‘woocommerce_add_to_cart_button_text’, 10, 2);function woocommerce_add_to_cart_button_text($button_text, $product) {
if (‘external’ == $product->get_type()) {
$button_text = __(‘Reproduction Available’, ‘woocommerce’);
}
return $button_text;
}
- You must be logged in to reply to this topic.