Answer the question
In order to leave comments, you need to log in
How to make a theme for woocommerce?
In the documentation
docs.woothemes.com/document/template-structure
I found that you can copy the
/plugins/woocommerce/templates/ templates
folder to your theme folder, rename it to woocommerce
/themes/mytheme/woocommerce/
And then change these templates.
But I downloaded themes from woothemes (native themes, so to speak), for example, storefront and mystile, and everything is different in them, there are no templates already, how is the layout integrated? Unclear. That is, they themselves make templates for themselves not as advised in the documentation?
I started to make a theme as they advise in the documentation. I had a simple task, I need to add a class to the "Proceed to Checkout" button in the cart, I open the cart template file woocommerce/cart/cart-totals.php and see there
<?php do_action( 'woocommerce_proceed_to_checkout' ); ?>
<?php
/**
* woocommerce_single_product_summary hook
*
* @hooked woocommerce_template_single_title - 5
* @hooked woocommerce_template_single_excerpt - 20
* @hooked woocommerce_template_single_rating - 25
* @hooked woocommerce_template_single_price - 25
* @hooked woocommerce_template_single_add_to_cart - 30
* @hooked woocommerce_template_single_sharing - 50
*/
do_action( 'woocommerce_single_product_summary' );
?>
remove_action("...");
add_action("...");
remove_action("...");
add_action("...");
Answer the question
In order to leave comments, you need to log in
The guys from WooThemes are really fire, but they do not do it so smoothly for another reason. They Produce both the plugin and the theme, so why would they want to include the plugin in the theme if they're happy with it anyway?
If you want to change everything, then this is exactly the path you copy the templates folder, and change everything in it, but you don’t need to copy the entire folder, but exactly the templates that you change, why load the theme with unnecessary files,
I have it set up like
this I take out in a separate file.
As for the rest, WooCommerce is cool in that it can be twisted as you like, and that is why filters and actions are used there to the fullest.
And in general, the use of these features, there is a good tone when developing, for example, I develop everything on my own framework, all actions are taken out in a separate file, which allows me to bend the project in any direction without any extra gestures.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question