Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.1k views
in Technique[技术] by (71.8m points)

php - WooCommerce 3 Major update template errors

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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

WooCommerce 3.0+ is a really major update and is much more strict than before. A lot of things have changed and most of custom code used for WooCommerce version 2.6+ will need to be updated.

See the related articles to WooCommerce Development blog

Here in your case you need to update all woocommerce templates in your theme located in your customtheme (folder) > woocommerce (sub folder).

To do that, you will have to replace all listed files from the woocommerce plugin "templates" folder to your theme woocommerce (sub folder):

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

But keep a copy of that old template before, as you will need to replace in the new templates all changes that you have made.


See this related documentation: Template Structure + Overriding Templates via a Theme


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...