If you have a WooCommerce store on your WordPress website, chances are you or your developer used a child theme to modify any of the extensive WooCommerce templates to change how the checkout pages or order page, or my account page looks. With certain WooCommerce versions, they update these templates too but since you overrode these templates in your child theme, you will see a warning on WooCommerce status page that says, WooCommerce template is out of date. In some instances, your checkout page may start displaying errors. This tutorial will show you how to update these templates by comparing two versions of these template files.
I am going to use a file comparison app called “Kaleidoscope” on my mac but you can use any text comparison programs. What this program does is highlights the differences between two files and allows you to copy lines from one file to the other. As you can see in the image above our form-pay.php file in woocommerce/checkout directory is out of date so we’re going to fix that. The image below shows the two files in question side by side in Kaleidoscope. As you can see, it highlights all the differences between the two files. First one being the version number line. It also shows many changes are there between the two files (bottom right circled part).
The GIF below shows how to resolve these changes. At the bottom middle, you will see two icons, one to copy to right and the other to copy to left. Since in our case, the left one is the most recent version of the template file, we want to copy them over to right. This will overwrite the copy in the left so please make sure you take a backup before doing this. You do need to understand coding a bit to see if you can just copy over from the left though. If there are quite a few changes in the files, please consult your developer before doing this yourself.
Now let’s check the WooCommerce status page to see if our form-pay.php file shows the out-of-date status or not (It shouldn’t). Once you master the file comparison software, you can use it to do quite a few complex operations. I have used a similar technique to make database changes involving WP EasyCart where I had to merge production website orders with staging website orders and without a comparison tool, it’s almost impossible to do.
Happy coding and please leave a comment if you like this tutorial.