我试图通过向我的主题 functions.php 添加波纹管代码来删除它,但它不起作用。
function remove_shipping_calc_on_cart( $show_shipping ) {
if( is_cart() ) {
return false;
}
return $show_shipping;
}
add_filter( 'woocommerce_cart_ready_to_calc_shipping', 'remove_shipping_calc_on_cart', 99 );
Run Code Online (Sandbox Code Playgroud)
然后我尝试编辑cart-totals.php 文件,但我做不到。你能帮我做吗?
car-totals.php 文件争用以下代码:
/**
* Cart totals
*
* This template can be overridden by copying it to yourtheme/woocommerce/cart/cart-totals.php.
*
* HOWEVER, on occasion WooCommerce will need to update template files and you
* (the theme developer) will need to copy the new files to your theme to
* maintain compatibility. We try to do this …Run Code Online (Sandbox Code Playgroud)