際際滷

際際滷Share a Scribd company logo
Getting Ready:
Anatomy of a Template File
CustomizeWoo.com
If You Want to Customize Woo...
You need to understand how the
frontend is assembled (hint: its made
of several template files)
CustomizeWoo.com
Anatomy of a WC template file
 ../templates/single-product.php
CustomizeWoo.com
single-product.php lines 1-20
CustomizeWoo.com
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
single-product.php lines 21-39
CustomizeWoo.com
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
single-product.php lines 40-61
CustomizeWoo.com
single-product.php lines 40-61
CustomizeWoo.com
 do_action(
'woocommerce_after_main_content' )
 do_action( 'woocommerce_sidebar' )
 get_footer()
(content-single-product line 1-19)
CustomizeWoo.com
(content-single-product line 20-43)
CustomizeWoo.com
(content-single-product line 44-62)
CustomizeWoo.com
(content-single-product line 63-76)
CustomizeWoo.com
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

More Related Content

WooCommerce: Anatomy of a Template File