Posted on 12 Comments

Outdated Template files in WooCommerce

Today someone sent me a question about the error in WooCommerce alerting them that their WooCommerce template files were out of date and needed to be update.  Here’s what to do when you find you’ve got outdated template files in WooCommerce.

Outdated Template files in WooCommerce
Here’s what the error will look like. You’ll see red text next to every line of each individual file.
Again, there's going to be red text next to EACH of WooCommerc's outdated template files.

Now, lets’ get those Outdated Template Files Fixed!

Patrick made a great write up back in February.  Why this error still exists (especially in paid themes) is a complete mystery to me! Regardless, I’m going to go over this process using the one example file above.  Lather, rinse, repeat for any and all of the other files.

First, let’s run over to git and find the current WooCommerce template files. <–click the sentence!

Next, look at the file we need to replace.  It’s the /myaccount/form-login.php file, right?  So, let’s find that specific file.  Run back over to the git page and scroll down until you find the files

WooCommerce Template Files
Here’s where you’ll find all the WooCommerce Template files. Open the folder containing the one you need.

Now that you’ve Clicked and opened the Folder labelled ‘myaccount’, see the files?

Here's the Woocommerce Template file that we need to replace
Here’s the Woocommerce Template file that we need to replace

You should be looking at this screen right here:  This is the current WooCommerce Template file in raw code.

See the current WooCommerce template file that we need to replace? Grab the "RAW" code
See the current WooCommerce template file that we need to replace? Grab the “RAW” code

Now, you need to get to the old outdated WooCommerce Template file. Copy / paste the old file into something and keep it somewhere just in case.(Thanks for the note Brian) It doesn’t matter if you use your favorite code editor or use WordPress’s built in plugin editor located at Administration > Plugins > Editor.  Open the file. Select All. Copy the correct “raw” file, and replace the outdated WooCommerce Template File with your new one. Click save, or be sure to ftp the correct WooCommerce Template File back to the server.

Boom.  Done.

If you run back over to the admin area of your theme, you’ll notice that the alert is now gone.

Many themes and primarily many other WooCommerce plugins rely on WooCommerce Template Files to be current (not outdated).  Not having current files can hurt you in more ways than one.  But more importantly, you’re site’s visitors could be faced with functions that don’t work, fields that aren’t current, and layouts that are messed up.

***Usually, (and best practice) the theme will make any customizations outside of the core WooCommerce files. If you’re unsure about any customizations that the theme is working with, you can simply paste the old and new file in diffchecker.com and update the old file by copy / pasting the different code in ‘chunks’ or ‘pieces’ so that any tweaks the theme might be using are not lost.  In the diffchecker, simply find the highlighted portions of the two files and create one new file with the updated code. Be sure to change the version number of the file to reflect the current file’s version number as well.

Regardless if it’s a theme you’ve bought, or one you’ve hand written yourself, now you know how to replace outdated WooCommerce Template files.

[product_hero layout=”center” background_img=”https://bradgriffin.me/wp-content/uploads/2015/10/pillow-fight-cropped.png” width=”full” full_height=”0″ background_size=”cover” overlay_opacity=”0.25″ product_id=”3452″ parallax=”1″ description_text_color=”#eeeeee”]

12 thoughts on “Outdated Template files in WooCommerce

  1. Often times there is a reason the theme has a local copy of the woocommerce templates. The theme copy allows the template to be customized to fit in with the theme. One simple example is adding additional classes to divs for styling purposes.

    Bottom line, blindly overwriting the woocommerce templates in your theme might negatively affect your site. Contact your theme developer if you are unsure.

    1. Ha! Great point. 🙂 Guess I should have clarified that as well… lemme do that now.
      If the theme developer simply has not gotten off their rumpus to update their files, there might or might not be a reason. As Brian pointed out, it might very well, break something in your theme. Usually, though, if the theme is one of those that advertised “Works with WooCommerce”, their main theme might be where they spend most of their time. Consequently the “Woo Part” of their theme might not get enough (or any) attention. If you notice anything ‘negative’ simply revert back to the old file.

  2. The problem a lot of times is that some developer has come in to do a customisation, and instead of just bringing across the file or couple of files they have actually changed, they bring in the whole lot. Then when Woocommerce does a major update and significantly changes a template, it breaks the entire site because of a template override that isn’t really needed. This is especially true when people bring in the entire templates folder when all they have modified is the email templates – crazy.

    Brian is right, some times template overrides are there for a reason, but if your site has been broken by an update then often the quickest fix is to rename the woocommerce folder in the theme to woocommerce__ and see if the problem is solved. You can then identify any changes that you may have lost – styling differences etc and identify the template files concerned. You then take the new versions of those files from the latest woo, and your old versions from your theme and do the diff technique to change the code that is neccessary to keep Woo working (and your site) and keep your style/functionality changes that were the reason for the template override.

    This could be a long process initially but you come out of it with your theme having only the template overrides you really need, which will ultimately cause less breakages in future updates, and make it easier to find the causes when any problems do occur.

  3. The problem a lot of times is that some developer has come in to do a customisation, and instead of just bringing across the file or couple of files they have actually changed, they bring in the whole lot. Then when Woocommerce does a major update and significantly changes a template, it breaks the entire site because of a template override that isn’t really needed. This is especially true when people bring in the entire templates folder when all they have modified is the email templates – crazy.

    Brian is right, some times template overrides are there for a reason, but if your site has been broken by an update then often the quickest fix is to rename the woocommerce folder in the theme to woocommerce__ and see if the problem is solved. You can then identify any changes that you may have lost – styling differences etc and identify the template files concerned. You then take the new versions of those files from the latest woo, and your old versions from your theme and do the diff technique to change the code that is neccessary to keep Woo working (and your site) and keep your style/functionality changes that were the reason for the template override.

    This could be a long process initially but you come out of it with your theme having only the template overrides you really need, which will ultimately cause less breakages in future updates, and make it easier to find the causes when any problems do occur.

    1. Thank you Liam. I will now rewrite this whole entire post with exactly the wording that you used. It sounds a lot better than mine! ~ha!~ (no really, it does!)

      I was just making up a tutorial for the “initial / overall / in-general” process for a theme developer that was …um…. how do I put this Dragging Their FEET.
      I thought I’d share it a bit. And…. turns out, I should have made the post much more detailed to account for all the variables.

      Alas, that would have been a reeeeeally looooooooong post.

  4. We all know that overriding the woo template in a child theme can quickly become a huge mess with all the updates released. Who didn’t see “your template files are outdated” at least once. So as you mentioned the plugin approach is the best one by far.

    I’m wondering if hooks are already available to make it happen in a clean and reliable way. That seems to be a significant amount of work and I would worry about the woo updates breaking the plugin the same way that they break custom themes which are modifying significantly woocommerce.

  5. Hey Thank you for taking the time to write this post and you even added graphical reps for mental midgets like myself. Bless you!

  6. Awesome. You write with such clarity i think i understand what your saying so if fertilizer hits the ventilator then ill have some clues n confidence to nut it out myself. That is til i can pay someone else to worry about it. I look forward to that day! A Master of Stillness but forced to be a jack of all trades at the mo. … i love reading your clarity.

  7. Hello Brad, My name is Sarge. I’m having a huge problem trying to figure out how to update the woocommerce templates. I’m getting this error and have looked everywhere trying to find a simple way to update the templates. Can you PLEASE help me? Here is when it reads. Thank you SOOO much in advance!

    Avada/woocommerce/checkout/form-checkout.php version 2.0.0 is out of date. The core version is 2.3.0,
    Avada/woocommerce/checkout/form-pay.php,
    Avada/woocommerce/checkout/review-order.php version 2.1.8 is out of date. The core version is 2.3.0,

    1. Same Problem

      Avada/woocommerce/cart/cart.php version 2.1.0 is out of date. The core version is 2.3.8,
      Avada/woocommerce/checkout/form-checkout.php version 2.0.0 is out of date. The core version is 2.3.0,
      Avada/woocommerce/checkout/review-order.php version 2.1.0 is out of date. The core version is 2.3.0,
      Avada/woocommerce/checkout/thankyou.php version 2.0.0 is out of date. The core version is 2.2.0,
      Avada/woocommerce/content-product.php version 1.6.4 is out of date. The core version is 2.5.0,
      Avada/woocommerce/loop/pagination.php version 2.0.0 is out of date. The core version is 2.2.2,
      Avada/woocommerce/single-product/add-to-cart/variable.php version 2.1.0 is out of date. The core version is 2.5.0,
      Avada/woocommerce/single-product/product-thumbnails.php version 2.0.3 is out of date. The core version is 2.3.0,

      Please please help!!!

    2. Hi Sarge,

      Have figure it out on how solve this issue. If you you do can you please help me. I’m totally lost. 🙂

  8. Want something new and $$$ related ? Go to this website . Only here choice of games for every taste and completely free! They immediately send you your winnings instantly , try now!
    http://gov.shortcm.li/government#X50

Leave a Reply

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