Archived topic
WooCommerce Magnification
3 replies · Started by Richard on January 30, 2021
Hi,
I tried commenting/replying to this thread:
https://generatepress.com/forums/topic/remove-zoom-effect-on-woocommerce-product-image/
So I am adding my issue here.
I am having the same request by a client. Couldn't I use a hook element for this? And if so, why isn't it mentioned on this page? https://docs.generatepress.com/article/adding-php/ I thought that was the purpose of Elements in GP? Just curious. :)
I am using the code from Felipe, but it doesn't seem to work. Plus, I don't know the place to select for the hook as well. There are about 50 to choose from, alone under WooCommerce.
For all the greatness of Woo, why after all these years, doesn't it have some decent simple options? Like turn off magnification. Or add product directly to cart? :)
The mysteries!
Thanks!
Richard
Hi there,
the PHP Snippet provided in that topic has to be added using one of the methods provided here:
https://docs.generatepress.com/article/adding-php/
Explanation: when you see add_action ( or add_filter ) in a PHP snippet - well those are methods for adding something to a hook.
The Hook Element - is doing the same thing its just writing the add_action code along with any display conditions for you behind the scenes.
As hooks are executed in particular order ( firing sequence ) you can't simply get one hook action to create another hook action.
Yes, the wonders of Woo ... the bottom line here is Woo is complicated but very extensible. And they have to make money so they sell a lot of extensions that provide some features that could be built in. Or as is the WP way could be added to Themes and Plugins.
Hi David,
thank you for your reply and the clarification.
Code Snippets Plugin with Felipe's code did the trick!
Thanks again a have a great weekend,
Richard
You're welcome and glad to hear that