I need to hide the add to cart button from the product page. I’m using the “woo add to cart” widget.
the classic hook is not working:
add_action( 'any-hook-same-result', 'remove_add_to_cart_buttons', 1 );
function remove_add_to_cart_buttons() {
if( is_shop()) {
remove_action( 'any-hook-same-result', 'woocommerce_template_loop_add_to_cart' );
}
}
what can i do?
I need a hook, or a function, to manage the rendering of this button.
Thanks.
Hi,
You can hide it using custom code css -> https://i.imgur.com/I6FKrn3.png form.cart button.single_add_to_cart_button
{
display: none;
}
Set the code in theme panel -> custom code -> custom css.
Thank you!
Ok, thanks for the anwser.
Seriously, i really need to know if there’s is a way to manage the render of the button via hooks. Like this:
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart', 30 );
Why the standard hooks are not working?
Thanks
Hi monema, the hooks that you are try to use are not working because on your product page you are using cloud templates that can be edited using the tagDiv Composer and those a different from standard woo shortcodes. What you can do is to remove the add to cart button by editing the template with tagDiv Composer – https://i.imgur.com/q333Xxt.png – https://i.imgur.com/YHlLR2F.png
Thank you for your understanding!
Hi,
Unfortunately that element can’t be override, sorry!
Only the elements from tagDiv Standard Pack can be overwritten in child theme – https://forum.tagdiv.com/the-child-theme-support-tutorial/
Thank you for your understating!