Woocommerce | templates / updating *

WooCommerce

Welcome to the WooCommerce repository on GitHub. Here you can browse the source, look at open issues and keep track of development. We recommend all developers to follow the WooCommerce development blog to stay up to date about everything happening in the project. You can also follow @DevelopWC on Twitter for the latest development updates.

If you are not a developer, please use the WooCommerce plugin page on WordPress.org.

Documentation

Reporting Security Issues

To disclose a security issue to our team, please submit a report via HackerOne here.

Support

This repository is not suitable for support. Please don't use our issue tracker for support requests, but for core WooCommerce issues only. Support can take place through the appropriate channels:

Support requests in issues on this repository will be closed on sight.

Contributing to WooCommerce

If you have a patch or have stumbled upon an issue with WooCommerce core, you can contribute this back to the code. Please read our contributor guidelines for more information how you can do this.

 


 

 

https://woocommerce.com/document/fix-outdated-templates-woocommerce/

 

Fixing Outdated WooCommerce Templates

Template Updates and changes

We sometimes update the default templates when a new version of WooCommerce is released. This applies to major releases (WooCommerce 2.6, 3.0, and 4.0) but also to minor releases (WooCommerce 3.8.0).

Starting in WooCommerce version 3.3, most themes will look great with WooCommerce.

Our developer focused blog will list any template file changes with each release.

If, however, you are using a theme with older templates or an older version of WooCommerce, you may need to update templates yourself or contact the theme author for an update.

  • Most theme authors fix themes in a timely manner, so you only need to update your theme to get the updated templates.
  • You need to update templates yourself if you modified templates or are using a child theme.

Otherwise, you need to select and use a different theme that already uses current WooCommerce templates.

How to update outdated templates

 

Aside Pages

Overrides aside/woocommerce/archive-product.php, aside/woocommerce/cart/cart.php version 3.5.0 is out of date. The core version is 3.8.0, aside/woocommerce/content-product.php version 3.4.0 is out of date. The core version is 3.6.0, aside/woocommerce/content-single-product.php version 3.4.0 is out of date. The core version is 3.6.0, aside/woocommerce/global/sidebar.php, aside/woocommerce/global/wrapper-end.php, aside/woocommerce/global/wrapper-start.php, aside/woocommerce/loop/loop-end.php, aside/woocommerce/loop/loop-start.php, aside/woocommerce/single-product/product-image.php, aside/woocommerce/single-product/product-thumbnails.php, aside/woocommerce/single-product/tabs/tabs.php version 2.4.0 is out of date. The core version is 3.8.0, aside/woocommerce/single-product-reviews.php version 3.5.0 is out of date. The core version is 4.3.0, aside/woocommerce/single-product.php, aside/woocommerce/content-product_cat.php version 2.6.1 is out of date. The core version is 4.7.0 Outdated templates: Learn how to update

 

Backups/Updates

aside/woocommerce/cart/cart.php version 3.5.0 is out of date. The core version is 3.8.0, aside/woocommerce/content-product.php version 3.4.0 is out of date. The core version is 3.6.0, aside/woocommerce/content-single-product.php version 3.4.0 is out of date. The core version is 3.6.0,

side/woocommerce/single-product/tabs/tabs.php version 2.4.0 is out of date. The core version is 3.8.0, aside/woocommerce/single-product-reviews.php version 3.5.0 is out of date. The core version is 4.3.0, aside/woocommerce/content-product_cat.php version 2.6.1 is out of date. The core version is 4.7.0


We need to determine what templates to update, make a backup of old templates and then restore any customizations.

  1. Go to: WooCommerce > Status > System Status. Scroll to the end of the page where there is a list of templates overridden by your theme/child theme and a warning message that they need to be updated. For example, the templates form-pay.php and form-login.phph are outdated:

img

  1. *Save a backup of the outdated template.*
  2. Copy the default template from wp-content/plugins/woocommerce/templates/[path-to-the-template] and paste it in your theme folder found at: wp-content/themes/[path-to-theme]
  3. Open the template you pasted into the theme folder with a text editor of choice, such as Atom, Visual Code, BBEdit, Notepad++, and replicate any changes that you had to the previous template in your new, updated template file.

We recognize that it can be time-consuming. This is why we try to avoid changing WooCommerce templates, but sometimes it is wise to break backward compatibility.

FAQ

Where can I find the latest version of WooCommerce?

If you’re looking for the default templates to use for updating, you want to use the latest version of WooCommerce. There are a few easy ways to get the templates:

Why don’t you make a button to click and update everything?

It’s impossible to make a video or a one-click update. Why? Because there are thousands of themes, and every theme is coded differently. One size does not fit all.

 


https://woocommerce.com/document/template-structure/

Template structure & Overriding templates via a theme

Note: This is a Developer level doc. If you are unfamiliar with code/templates and resolving potential conflicts, select a WooExpert or Developer for assistance. We are unable to provide support for customizations under our Support Policy.

Overview

WooCommerce template files contain the markup and template structure for frontend and HTML emails of your store.

When you open these files, you will notice they all contain hooks that allow you to add/move content without needing to edit template files themselves. This method protects against upgrade issues, as the template files can be left completely untouched.

Template list

Template files can be found within the **/woocommerce/templates/** directory:

 

image-20220130084649030

VERSIONFILES
v.6.1.0View template files
v.6.0.0View template files
v.5.9.0View template files
v.5.8.0View template files
v.5.7.0View template files
v.5.6.0View template files
v.5.5.0View template files
v.5.4.0View template files
v.5.3.0View template files
v.5.2.0View template files
v.5.1.0View template files
v.5.0.0View template files
v.4.9.0View template files
v.4.8.0View template files
v.4.7.0View template files
v.4.6.0View template files
v.4.5.0View template files
v.4.4.0View template files
v4.3.0View template files
v4.2.0View template files
v4.1.0View template files
v4.0.0View template files
v3.9.0View template files
v3.8.0View template files
v3.7.0View template files
v3.6.0View template files
v3.5.0View template files
v3.4.0View template files
v3.3.0View template files
v3.2.0View template files
v3.1.0View template files
v3.0.0View template files
v2.6.0View template files

How to Edit Files

Edit files in an upgrade-safe way using overrides. Copy the template into a directory within your theme named /woocommerce keeping the same file structure but removing the /templates/ subdirectory.

Example: To override the admin order notification, copy: wp-content/plugins/woocommerce/templates/emails/admin-new-order.php to wp-content/themes/yourtheme/woocommerce/emails/admin-new-order.php

The copied file will now override the WooCommerce default template file.

Warning: Do not edit these files within the core plugin itself as they are overwritten during the upgrade process and any customizations will be lost. For more detailed information, see Fixing Outdated WooCommerce Templates.

For Custom Templates

If you are a theme developer or using a theme with custom templates, you must declare WooCommerce theme support using the add_theme_support function. See Declaring WooCommerce Support in Themes at GitHub.

If your theme has a woocommerce.php file, you will be unable to override the woocommerce/archive-product.php custom template in your theme, as woocommerce.php has priority over other template files. This is intended to prevent display issues.

Scroll to Top