如何从 Woocommerce 购物车中删除运费? [英] How to remove Shipping from Woocommerce cart?
本文介绍了如何从 Woocommerce 购物车中删除运费?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个问题.我需要从购物车中删除运费和运费计算.可以用钩子删除吗?我是这方面的新手.
I have one question. I need remove shipping and shipping calculate from cart. Its possible delete with hooks? I am newbie in this.
模板是:http://flatsome.uxthemes.com/cart/
我很乐意为您提供任何建议.谢谢.
I'll be glad for any advice. Thanks.
推荐答案
在您的 functions.php
function disable_shipping_calc_on_cart( $show_shipping ) {
if( is_cart() ) {
return false;
}
return $show_shipping;
}
add_filter( 'woocommerce_cart_ready_to_calc_shipping', 'disable_shipping_calc_on_cart', 99 );
这篇关于如何从 Woocommerce 购物车中删除运费?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文