覆盖包含文件夹中的 woocommerce 文件 [英] Override woocommerce files from includes folder

查看:32
本文介绍了覆盖包含文件夹中的 woocommerce 文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我直接修改了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 文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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