mirror of
https://gh.wpcy.net/https://github.com/mainwp/Code-Snippets-Functions.git
synced 2026-04-30 11:42:22 +08:00
https://stackoverflow.com/questions/77912035/disable-default-shipping-option-on-cart-refresh-woocommerce/77912722
6 lines
272 B
Text
6 lines
272 B
Text
add_filter( 'woocommerce_shipping_chosen_method', '__return_false', 99);
|
|
|
|
add_filter( 'woocommerce_shipping_method_chosen', 'cart_no_shipping_method_chosen', 99);
|
|
function cart_no_shipping_method_chosen( $chosen_method ) {
|
|
return is_cart() ? false : $chosen_method;
|
|
}
|