Change the button text on the Gift Cards products
-
Hello,
I need assistance in changing the gift card button text on the shop page and product category page. The current button text displayed on the aforementioned pages is “Read more”. Screenshot – https://snipboard.io/n7CbO6.jpg
I currently use the code below which I found on this forum:
function yith_ywgc_add_to_cart_button_text( $text, $product) {
if ($product->get_type() == ‘gift-card’) {
$text = __( ‘Scegli’, ‘yith-woocommerce-gift-cards’ );
}
return $text;
}
add_filter( ‘woocommerce_product_single_add_to_cart_text’, ‘yith_ywgc_add_to_cart_button_text’, 10, 2 );It works as should, though it only changes the gift card button text on the single product pages. But I need the gift card button text on the main shop page and category pages changed as well.
- The topic ‘Change the button text on the Gift Cards products’ is closed to new replies.