I have difficulty doing this even after following instructions of how to do it. I don’t know if the structure of woocommerce
have changed since the below snippet was given.
Below is the code I tried using to remove the Add to cart
button in the Homeapage
and Shop page
.
Mind you, this was pasted in the Theme Functions (functions.php)
and I use MyStile Theme
.
I was able to remove the Add to Cart
button from the single page but not the homepage and shop page
.
Code
function remove_loop_button(){
remove_action('woocommerce_before_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10);
}
add_action('init', 'remove_loop_button');
Thanks for your help in advance.
You can use following code. Put it in your
functions.php
:To Remove âAdd to Cartâ button all you need to do is paste the following lines of code in your
functions.php
file located inside your themeâs directory.