- http://docs.woothemes.com/document/hooks/
I use the Mystile WooCommerce theme, where the "add to cart" buttons is removed by this code:
remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10);
That is placed in this file
wp-content/themes/mystile/includes/theme-woocommerce.php
I know I can just remove the piece of code, but is there a option, so the buttons still will appear, after the
theme-woocommerce.php
file is changed after next update?
I already tried to add this code to the my
functions.php
in my child theme.add_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10);
I took the mystile WooCommerce theme plus WooCommerce itself for a test drive recently. It is clean and neatly laid out and importantly it is responsive. It allows customers to have the convenience of shopping on their mobile devices without fuss.
I wanted to have the add to cart to show on my featured products page and also on my shop page (where all products are listed). Note that these hooks are already in their respective files.
I got the answer from a contributor on Stackoverflow by the name of Azmi Kamis.
The mystile theme by default does the following:
By default WooCommerce hooks it to
wp-content\plugins\woocommerce\woocommerce-hooks.php
woocommerce_after_shop_loop_item
inwp-content\plugins\woocommerce\woocommerce-hooks.php
My installed theme, Mystile, removed this hook in wp-content\themes\mystile\includes\theme-woocommerce.php
Once I commented it out, the “Add to cart” button appeared.
He commented out by simply doing this:
Thank you for sharing excellent information. Your website is very cool. Fully useful your blog post... Online shopping site for women's clothing in india
ReplyDelete