Archived topic
How to disable the Bid now and Add to Cart Buttons on the Wocommerce Shop Page?
19 replies · Started by bluebit on November 2, 2019
On my homepage which also is the woocommerce shop page, how can I remove or disable the bid now and add to cart buttons?
Hi there,
you can add this PHP snippet:
add_action( 'after_setup_theme', function() {
remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart');
} );
i added the snippet and its not working
Where did you add the snippet ?
to a plugin called custom snippets
Odd - i edited the code above - try that instead.
hmm doesn't work either
Are you using any extra woo plugins ? They may be messing with the add to cart function.
I'm using an auction plugin, maybe that is doing something, this one: https://ignitewoo.com/woocommerce-extensions-plugins-themes/woocommerce-auctions/
Well its doing something alright - if you disable that plugin temporarily does the code then work ? Least then we can pin down where the issue is
yes deactivating the plugin temporarily makes it work, so what do I do now, because i need it to work with the plugin activated
You would need to ask the plugin author as they provide no documentation and without the plugin i can't see what function they are calling.
If they're unhelpful then you can install the Simply Show Hooks plugin. Visit the archive page and activate it from the Admin Bar you should be able to see the Hook name ( same as above ) and when hovered over the list of functions it calls. With that info we may be able to help
the plugin author is super slow in responding, i installed the Simple Show Hooks plugin and can see https://imgur.com/a/o6WQKhB
Not sure but try:
add_action( 'after_setup_theme', function() {
remove_action( 'woocommerce_after_shop_loop_item', array( 'IgniteWoo_Auctions', 'loop_add_to_cart'),10);
} );
that didnt work, i think maybe its the ignitewoo add to cart loop that you can see in the screenshot, maybe its possible to disable that or to give it less priority?