WooCommerce 3 Major update template errors

时间:2017-04-10 01:13:49

标签: php wordpress templates woocommerce updates

Last week I updated to PHP 7 and I have also updated WooCommerce to 3.0.x.

But after the update I have noticed that the extra fields I had in my user registration were not working anymore. I added those extra fields using WP-Member plugins.

When I further searched on the WooCommerce system status at the bottom of the page I found this errors

customtheme/woocommerce/cart/cart.php version 2.1.0 is out of date. The core version is 3.0.0, customtheme/woocommerce/checkout/form-checkout.php version 2.0.0 is out of date. The core version is 2.3.0, customtheme/woocommerce/checkout/review-order.php version 2.1.8 is out of date. The core version is 2.3.0, customtheme/woocommerce/checkout/thankyou.php version 2.2.0 is out of date. The core version is 3.0.0, customtheme/woocommerce/content-product.php version 1.6.4 is out of date. The core version is 3.0.0, customtheme/woocommerce/loop/loop-start.php, customtheme/woocommerce/loop/pagination.php, customtheme/woocommerce/myaccount/form-edit-address.php version 2.1.0 is out of date. The core version is 2.6.0, customtheme/woocommerce/single-product/add-to-cart/variable.php version 2.1.0 is out of date. The core version is 2.5.0, customtheme/woocommerce/single-product/product-image.php version 2.0.14 is out of date. The core version is 3.0.0, customtheme/woocommerce/single-product/product-thumbnails.php version 2.0.3 is out of date. The core version is 3.0.0, customtheme/woocommerce/single-product/short-description.php, customtheme/woocommerce/single-product/tabs/description.php, customtheme/woocommerce/single-product/title.php

Could anyone help me fixing these and make my user registration page to appear with all my custom fields

Thanks

1 个答案:

答案 0 :(得分:1)

  

WooCommerce 3.0+是一个非常重要的更新,比以前更加严格。许多事情都发生了变化,大多数用于WooCommerce版本2.6+的自定义代码都需要更新。

请参阅WooCommerce Development blog

的相关文章

在您的情况下,您需要更新位于 customtheme (文件夹)>中的主题中的所有woocommerce模板。 woocommerce (子文件夹)

为此,您必须将所有列出的文件从woocommerce插件“templates”文件夹替换为您的主题 woocommerce (子文件夹)

woocommerce/templates/cart/cart.php                             => customtheme/woocommerce/cart/cart.php
woocommerce/templates/checkout/form-checkout.php                => customtheme/woocommerce/checkout/form-checkout.php
woocommerce/templates/checkout/review-order.php                 => customtheme/woocommerce/checkout/review-order.php
woocommerce/templates/checkout/thankyou.php                     => customtheme/woocommerce/checkout/thankyou.php
woocommerce/templates/content-product.php                       => customtheme/woocommerce/content-product.php  
woocommerce/templates/loop/loop-start.php                       => customtheme/woocommerce/loop/loop-start.php
woocommerce/templates/loop/pagination.php                       => customtheme/woocommerce/loop/pagination.php  
woocommerce/templates/myaccount/form-edit-address.php           => customtheme/woocommerce/myaccount/form-edit-address.php  
woocommerce/templates/single-product/add-to-cart/variable.php   => customtheme/woocommerce/single-product/add-to-cart/variable.php
woocommerce/templates/single-product/product-image.php          => customtheme/woocommerce/single-product/product-image.php
woocommerce/templates/single-product/product-thumbnails.php     => customtheme/woocommerce/single-product/product-thumbnails.php
woocommerce/templates/single-product/short-description.php      => customtheme/woocommerce/single-product/short-description.php
woocommerce/templates/single-product/tabs/description.php       => customtheme/woocommerce/single-product/tabs/description.php
woocommerce/templates/single-product/title.php                  => customtheme/woocommerce/single-product/title.php
  

但之前请保留旧模板的副本,因为您需要在新模板中替换您有女佣的所有更改。

请参阅此相关文档:Template Structure + Overriding Templates via a Theme