How do I execute snippet after plugins are loaded?
-
Hi there,
I am basically trying to change the ‘Read more’ button text on the Shop page (Category page) when an item is out of stock to ‘Join the waitlist’ instead.
However, as I have a Custom Fields plugin installed as well, it seems to change the button text to ‘View Product’.
I already have a snippet below, which I’ve tested and does work. However, the moment I activate the Custom Fields plugin, it seems to get a higher priority and will display the button text as ‘View Product’.
// For all products add_filter( 'woocommerce_product_add_to_cart_text', 'product_single_add_to_cart_text_filter_callback', 100, 2 ); function product_single_add_to_cart_text_filter_callback( $button_text, $product ) { if( ! $product->is_in_stock() ) { $button_text = __("Join the waitlist", "woocommerce"); } return $button_text; }
Is there any way or workaround where I can force the snippet to have a higher priority than the plugin so that the ‘Join the waitlist’ text can be displayed instead?
I am a complete rookie and don’t really have any idea what I’m doing. Any help or advice would be greatly appreciated. Thanks so much in advance!
Kind regards,
E
- The topic ‘How do I execute snippet after plugins are loaded?’ is closed to new replies.