Merge pull request #2174 from gw0/master
WC 2.0 beta: Corrected bug if a product variation does not exist anymore
This commit is contained in:
commit
00accc82e7
|
@ -135,7 +135,7 @@ class WC_Cart {
|
|||
|
||||
$_product = get_product( $values['variation_id'] ? $values['variation_id'] : $values['product_id'] );
|
||||
|
||||
if ( $_product->exists() && $values['quantity'] > 0 ) {
|
||||
if ( !empty( $_product ) && $_product->exists() && $values['quantity'] > 0 ) {
|
||||
|
||||
// Put session data into array. Run through filter so other plugins can load their own session data
|
||||
$this->cart_contents[ $key ] = apply_filters( 'woocommerce_get_cart_item_from_session', array(
|
||||
|
|
Loading…
Reference in New Issue