One of the codes I tried:
add_filter( 'woocommerce_cart_needs_shipping', 'filter_cart_needs_shipping' );
function filter_cart_needs_shipping( $needs_shipping ) {
if ( is_cart() ) {
$needs_shipping = false;
}
return $needs_shipping;
}
I tried this code also:
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 );
I put the code in my theme function.php file. The problem is the same for both codes.
I use WordPress 6.5.2, WooCommerce 8.8.3 and Twenty Twenty-Four theme.
How can this problem be solved?
0 comments:
Post a Comment
Thanks