I wanted to change the "Order now" button to the "View product" one in the WooCommerce product grid so, I added these lines to the funcions.php file in my theme:
add_filter( 'woocommerce_loop_add_to_cart_link', 'replacing_add_to_cart_button', 10, 2 );
function replacing_add_to_cart_button( $button, $product ) {
$button_text = __("View product", "woocommerce");
$button = '<a href="' . $product->get_permalink() . '">' . $button_text . '</a>';
return $button;
}
The changes work when I open the website in my Google Chrome browser but they don't work in any other browser or device.
It's my first time facing this problem even if I already have done changes to the same functions.php file (to remove the "Add to cart" button and the notifications).
What should I do?
Thank you
CodePudding user response:
It seems to be cache on your live site. Please check in private window or after hard refresh ctrl shift r.
CodePudding user response:
It is a cache-related issue for sure, either a cache of your own WordPress, browser cache, or any server-side caching. You might want to check this article and flush both your local browsers cache and any plugins' cache: https://hostadvice.com/how-to/how-to-flush-wordpress-caching-plugins/
If the issue still persists, I recommend reaching out to your web hosting provider and seeing what they'll say.