Remove Add to Cart Button from storeront
-
Hi,
I have a fresh woo commerce installation with the storefront theme. Created a child theme for it and i want to remove the add to cart button from the site for non-logged in users. I have used this snippetremove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10 ); remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart', 30 ); remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_price', 10 ); remove_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_price', 10 );which have actually removed the button from the shop page and product-details page. But it is still visible on the home page under New arrival, Best Sellers, On sale and Favourites sections. Is there any way to remove the same from these sections also ? I don’t prefer hiding it using css as it seems kind of a hack. Is there any filters available for it, or through template overriding. I followed this documentation but had no scope at all. (https://docs.woocommerce.com/document/storefront-hooks-actions-filters/)
Could anyone please help me with this ?
The topic ‘Remove Add to Cart Button from storeront’ is closed to new replies.
