Answer the question
In order to leave comments, you need to log in
How does Yith Woocommerce Catalog Mode work?
Good afternoon.
You need to organize a directory with filters.
I looked, Woocommerce, mine fits like nothing better.
I found here on the toaster, in the topic about catalogs, the Yith Woocommerce Catalog Mode plugin, which makes it a catalog, removing the cart, payment, etc.
My question is how does it work? Does it remove unnecessary things, simplifying the work of Woocommerce (removing unnecessary scripts, styles, etc.) or just hide them externally?
I do so and so to make a theme for all this. And I would like to simplify, not complicate the process.
And then, in theory, he can still hang his styles and scripts :)
And hide the basket, prices, etc. - it is possible in the topic itself.
Answer the question
In order to leave comments, you need to log in
Yith Woocommerce Catalog Mode disables certain parts of WooCommerce via hooks. Specifically, the function of displaying the "Add to Cart" button and the Cart and Checkout pages.
All this can be done without a plugin, it's quite simple to do. All hooks are written in the code of WooCommerce itself.
This is how it looks, this code is added to the functions.php file of your theme and disables the add to cart button on all types of products, on catalog pages and in the product card:
remove_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_simple_add_to_cart', 'woocommerce_simple_add_to_cart', 30 );
remove_action( 'woocommerce_grouped_add_to_cart', 'woocommerce_grouped_add_to_cart', 30 )
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question