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:
Coen Jacobs 2013-01-10 03:26:18 -08:00
commit 00accc82e7
1 changed files with 1 additions and 1 deletions

View File

@ -135,7 +135,7 @@ class WC_Cart {
$_product = get_product( $values['variation_id'] ? $values['variation_id'] : $values['product_id'] ); $_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 // 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( $this->cart_contents[ $key ] = apply_filters( 'woocommerce_get_cart_item_from_session', array(