问题描述
我直接修改了woocommerce插件中includes
文件夹中的class-wc-checkout.php
文件来添加自定义line item meta
数据.当我们在 woocommerce 中覆盖模板文件时,有什么方法可以覆盖
my-theme 文件夹中的 class-wc-checkout.php 文件?
I have directly modified the class-wc-checkout.php
file from includes
folder in woocommerce plugin to add custom line item meta
data. Is there any way to override
the class-wc-checkout.php file from my-theme folder as we override template files in woocommerce?
推荐答案
我遇到了同样的问题.我不需要在我的网站上进行评论,所以我复制了我想从 includes
文件夹内的文件中删除的内容并将其复制到我的 functions.php
文件如下:
I was having this same issue. I don't have a need for reviews on my site, so I copied what I wanted to remove from a file inside of the includes
folder and copied it into my functions.php
file like so:
// Remove reviews from WooCommerce
if (! function_exists( 'woocommerce_default_product_tabs')) {
function woocommerce_default_product_tabs($tabs = array()) {
}
}
对我有用!
这篇关于覆盖包含文件夹中的 woocommerce 文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!