WooCommerce remove add to cart

Today we talk about WooCommerce remove to add to cart to different places. Like listing page, product page. So let’s start with an example.

Lisitng Page

You have to remove the following action to do the trick.

remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart');

Product Page

You have to remove the following action to do the trick.

remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart');

For the simple product use the following code.

remove_action( 'woocommerce_simple_add_to_cart', 'woocommerce_simple_add_to_cart', 30 );

Remove add to cart for variable products without removing the variation selectors
Note: It will remove only the add to cart button and the Quantity box.

remove_action( 'woocommerce_single_variation', 'woocommerce_single_variation_add_to_cart_button', 20 );

Qaisar Satti

Hi, I'm Qaisar Satti! I've been a developer for over 20 years, and now I love sharing what I've learned through tutorials and guides. Whether you're working with Magento, PrestaShop, or WooCommerce, my goal is to make your development journey a bit easier and more fun. When I'm not coding or writing, you can find me exploring new tech trends and hanging out with the amazing developer community. Thanks for stopping by, and happy coding!

Leave a Reply