Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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,090 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.