We’re Officially a Unicorn Pantheon Announces Series E Read the News

WooCommerce Couch Coding Recap: Upgrading Customized Templates

Earlier this week I did a WooCommerce Couch Coding session with Daniel Espinoza of Grow Development. Daniel has been working on WooCommerce since the very beginning and has a lot of real-world experience with WooCommerce. 

He was kind enough to walk me through working with template overrides. Specifically, we went over how to make sure your template overrides survive a WooCommerce upgrade that includes template changes.

The site we examined had a storefront child theme with customized templates to add cart icons to the add to cart buttons.

Storefront child theme shop page

It is important to know what is being overridden in each template. This way we don't miss any changes when upgrading the templates. The first step is to identify which templates have been modified at all. Luckily, the WooCommerce status page lists all template overrides.

WooCommerce statue template list

You can compare the template override file in your theme against the original theme file in WooCommerce. You can do this manually but I used git as the color coded change highlights make the analysis easy.

WooCommerce template Git differences

After identifying what changed in each template, we ran the WooCommerce update. Always do this in a non-production (e.g. Multidev) environment and create a backup first. Once the update is done run any database upgrades as normal.

At this point, we are ready to see what templates changed along with the WooCommerce update. Again, the status page lets us know:

WooCommerce Status Tab: Outdated Override Templates

Daniel and I compared the new templates to our override versions line by line to see what was changed. After understanding all the changes, we were able to update our overridden templates to the new version while keeping the customizations. This was the most valuable part of the webinar, in my opinion, and is something that is better watched than written in a blog post. If you would like to see the entire webinar you can check out the recording here

Also, if you happen to be reading this before September 25, 2018, come by our WooCommerce Office Hours with any questions!


You may also like: 

 

 

Topics Training and Education, WordPress, WordPress Hosting

Let’s get in touch

855-927-9387