Merge pull request #16570 from woocommerce/fix/16568
Add product to cart on each iteration for BW compat.
This commit is contained in:
commit
6c2a944b74
|
@ -89,12 +89,13 @@ final class WC_Cart_Session {
|
|||
// Put session data into array. Run through filter so other plugins can load their own session data.
|
||||
$session_data = array_merge( $values, array( 'data' => $product ) );
|
||||
$cart_contents[ $key ] = apply_filters( 'woocommerce_get_cart_item_from_session', $session_data, $values, $key );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Add to cart right away so the product is visible in woocommerce_get_cart_item_from_session hook.
|
||||
$this->cart->set_cart_contents( $cart_contents );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
do_action( 'woocommerce_cart_loaded_from_session', $this->cart );
|
||||
|
||||
|
|
Loading…
Reference in New Issue