WooCommerce 3 主要更新模板错误 [英] WooCommerce 3 Major update template errors

查看:44
本文介绍了WooCommerce 3 主要更新模板错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

上周我更新到 PHP 7,我也更新了 WooCommerce 到 3.0.x.

但是在更新之后,我注意到我在用户注册中的额外字段不再起作用.我使用 WP-Member 插件添加了这些额外的字段.

当我进一步搜索页面底部的 WooCommerce 系统状态时,我发现了这个错误

<块引用>

customtheme/woocommerce/cart/cart.php 2.1.0 版本已过时.核心版本是3.0.0,customtheme/woocommerce/checkout/form-checkout.php 版本 2.0.0 是过时了.核心版本是2.3.0,customtheme/woocommerce/checkout/review-order.php 2.1.8 版已发布日期.核心版本是2.3.0,customtheme/woocommerce/checkout/thankyou.php 2.2.0 版本已过期日期.核心版本是3.0.0,customtheme/woocommerce/content-product.php 版本 1.6.4 已出日期.核心版本是3.0.0,customtheme/woocommerce/loop/loop-start.php,customtheme/woocommerce/loop/pagination.php,customtheme/woocommerce/myaccount/form-edit-address.php 版本 2.1.0过时了.核心版本是2.6.0,customtheme/woocommerce/single-product/add-to-cart/variable.php版本 2.1.0 已过时.核心版本是2.5.0,customtheme/woocommerce/single-product/product-image.php 版本2.0.14 已过时.核心版本为3.0.0,customtheme/woocommerce/single-product/product-thumbnails.php版本2.0.3 已过时.核心版本为3.0.0,customtheme/woocommerce/single-product/short-description.php,customtheme/woocommerce/single-product/tabs/description.php,customtheme/woocommerce/single-product/title.php

谁能帮我解决这些问题并使我的用户注册页面显示我的所有自定义字段

谢谢

解决方案

WooCommerce 3.0+ 是一个真正的重大更新,比以前更加严格.很多东西都发生了变化,用于 WooCommerce 2.6+ 版的大部分自定义代码都需要更新.

查看相关文章WooCommerce 开发博客

在这里,您需要更新位于 customtheme (文件夹) 中的主题中的所有 woocommerce 模板.woocommerce (子文件夹).

为此,您必须将 woocommerce 插件模板" 文件夹中的所有列出文件替换为您的主题woocommerce (子文件夹):

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

<块引用>

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


请参阅此相关文档:模板结构 + 通过主题覆盖模板

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

解决方案

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

这篇关于WooCommerce 3 主要更新模板错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆