Woocommerce : How to remove the cart button from the product page

If you want to hide the “add to cart button” in the product details page then kindly follow the below steps.

Step 1

Open the file in this path /wp-content/themes/theme-folder/functions.php using some editor like DreamWeaver and scroll to the end of the file then append the below code,

Note : If you have used the child theme then get into the file path /wp-content/themes/childtheme-folder/functions.php.

Code

remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart' );
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart', 30 );

Rate This Article

(52 out of 107 people found this article helpful)

Leave A Comment?

This site uses Akismet to reduce spam. Learn how your comment data is processed.