Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

WordPress WooCommerce Theme Development Getting Started with WooCommerce Theme Development How to Override a Default Template File

Shaun Glassman
Shaun Glassman
6,496 Points

WooCommerce templates & child themes -- modifying woocommerce in main theme and child theme

I'm assuming this is OK, but I want to get everyone's thoughts.

Let's say you are using a premium theme that customizes woocommerce templates.

Let's say I create a child theme for that premium theme. If I change some woocommerce templates in my child theme & leave others for customization in the original premium theme, would I run into problems? If WordPress logic set-up to look at woocommerce updates in my child theme, then look at templates in the parent theme, and then use the rest of the templates from WooCommerce?

1 Answer

Erik Schultz
Erik Schultz
16,232 Points

I haven't done this with child themes personally but if you want to alter woocommerce templates then you want to create a new directory in your theme's (or child theme I would expect) named woocommerce and copy the files you want to edit from the woocomerce plugin. Go to the woocommerce plugin and look under the templates directory and grab what folders/files you need and copy them into the newly created woocommerce directory in your theme (child-theme) directory.

This shouldn't cause problems when both the parent theme or woocommerce plugin updates.