How to fix outdated Woocommerce template files

So you let your inner entrepreneur out and going to start a brand new online store for your amazing products with Woocommerce and WordPress. Bought a server, installed a vanilla Wordpress copy with a nice WordPress theme and Woocommerce. And got something like bellow.

 

Or maybe you updated to the newest Woocommerce version and CRAP, there is a big warning message on the top.Don’t panic, it’s pretty easy to fix.

So how this happens

Theme developers love to customize everything. It’s no wonder they want to customize the way Woocomeerce pages look. The ideal and recommended way to doing the customization is to override the Woocomerce template files from the theme directory. So once the new update kicks in, the developer does not lose the changes he made. But this approach has a problem and it’s inevitable. If the Woocommerce developers break the backward compatibility with the new update, overridden template files become obsolete. And things start to break.Usually, they or any developer don’t want to break the backward compatibility. But sometimes it needs to be done for the greater good.

How to fix the outdated Woocommerce template files

It happened to me last week. I develop themes by my self for the projects but mostly I use theme framework as the base. The first thing I do once installed Woocommerce is going to Woocommerce -> Settings -. Status page and get the System Report. It helps to identify any issues. In System Report we can get the names of outdated template files.

First thing is to navigate to wp-content->themes->your-theme->Woocommerce. It’s the location for overridden Woocommerce templates Make a backup. Then navigate to wp-content->Plugins->woocommerce->templates. You will find a bunch of subdirectories inside the template directory. Locate the files indicated in System Report, copy and paste them to your-theme->woocommerce directory. Make sure you paste files into the related subdirectory. For an example

if System report indicated

Your-theme-directory->woocommerce->cart->mini-cart.php

make sure you locate the

plugins->woocommerce->templates->cart->mini-cart.php file and copy it to the above location. Then you can copy styles from your backup directory and do modifications to the newly copied files to get your old customization back. That’s all. Cheers.

Photo by Luca Bravo on Unsplash

Leave a Reply

Your email address will not be published. Required fields are marked *