【问题标题】:WooCommerce 3 Major update template errorsWooCommerce 3 主要更新模板错误
【发布时间】:2017-04-10 01:13:49
【问题描述】:

上周我更新到 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

谁能帮我解决这些问题,让我的用户注册页面与我的所有自定义字段一起出现

谢谢

【问题讨论】:

    标签: php wordpress templates woocommerce updates


    【解决方案1】:

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

    相关文章见WooCommerce Development blog

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

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

    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

    【讨论】:

      猜你喜欢
      • 2018-06-05
      • 1970-01-01
      • 2011-08-16
      • 1970-01-01
      • 2016-01-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多