Auto apply. #1641.
This commit is contained in:
parent
cd42e90926
commit
d54bdb6609
|
@ -1679,6 +1679,11 @@ class WC_Cart {
|
|||
}
|
||||
|
||||
$this->applied_coupons[] = $coupon_code;
|
||||
|
||||
// Choose free shipping
|
||||
if ( $the_coupon->enable_free_shipping() ) {
|
||||
$woocommerce->session->chosen_shipping_method = 'free_shipping';
|
||||
}
|
||||
|
||||
$this->set_session();
|
||||
|
||||
|
|
|
@ -202,7 +202,7 @@ class WC_Shipping {
|
|||
$_available_methods = $this->get_available_shipping_methods();
|
||||
|
||||
// Get chosen method
|
||||
if ( ! empty( $woocommerce->session->chosen_shipping_method ) && isset( $woocommerce->session->available_methods_count ) && $woocommerce->session->available_methods_count == sizeof( $_available_methods ) )
|
||||
if ( ! empty( $woocommerce->session->chosen_shipping_method ) )
|
||||
$chosen_method = $woocommerce->session->chosen_shipping_method;
|
||||
|
||||
$woocommerce->session->available_methods_count = sizeof( $_available_methods );
|
||||
|
|
Loading…
Reference in New Issue