Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

WooCommerce: Anatomy of a Template File

4 views

Published on

These slides belong to https://CustomizeWoo.com, a technical video course that shows you how to override WooCommerce pages and elements without using plugins. You can watch me code and learn by example.

A series of videos, screencasts, examples and exercises will help you feel more confident about WooCommerce customization, child themes, hooks and CSS/PHP snippets.

Watch and re-watch each video how many times you like, get lifetime access to me via the comment section, exercise as much as possible and keep learning.

Access your free videos or buy the course via https://businessbloomer.com/customizewoo-master-woocommerce-online-course/

Published in: Internet
  • Be the first to comment

  • Be the first to like this

WooCommerce: Anatomy of a Template File

  1. 1. Getting Ready: Anatomy of a Template File CustomizeWoo.com
  2. 2. If You Want to Customize Woo... You need to understand how the frontend is “assembled” (hint: it’s made of several template files) CustomizeWoo.com
  3. 3. Anatomy of a WC template file ● ../templates/single-product.php CustomizeWoo.com
  4. 4. single-product.php lines 1-20 CustomizeWoo.com
  5. 5. single-product.php lines 1-20 CustomizeWoo.com ● What the template does ● How to override (copy template to /woocommerce folder > “HOWEVER” section as this is not ideal) ● @version 1.6.4 (last time it was updated) ● Security: prevent direct access
  6. 6. single-product.php lines 21-39 CustomizeWoo.com
  7. 7. single-product.php lines 21-39 CustomizeWoo.com ● get_header ● do_action( 'woocommerce_before_main_content' ) ● wc_get_template_part( 'content', 'single-product' ) which means “GET THE CONTENT-SINGLE-PRODUCT.PHP FILE”
  8. 8. single-product.php lines 40-61 CustomizeWoo.com
  9. 9. single-product.php lines 40-61 CustomizeWoo.com ● do_action( 'woocommerce_after_main_content' ) ● do_action( 'woocommerce_sidebar' ) ● get_footer()
  10. 10. (content-single-product line 1-19) CustomizeWoo.com
  11. 11. (content-single-product line 20-43) CustomizeWoo.com
  12. 12. (content-single-product line 44-62) CustomizeWoo.com
  13. 13. (content-single-product line 63-76) CustomizeWoo.com
  14. 14. WooCommerce Plugin: ../templates ● Next: hook theory... ● But for now: remember that if you see “do_action” you can run your custom functions there WITHOUT overriding @ /woocommerce CustomizeWoo.com

×