find_product_in_cart tweak Closes #3863
This commit is contained in:
parent
1b91c75039
commit
b7a752ecc1
|
@ -805,9 +805,10 @@ class WC_Cart {
|
|||
*/
|
||||
public function find_product_in_cart( $cart_id = false ) {
|
||||
if ( $cart_id !== false )
|
||||
foreach ( $this->cart_contents as $cart_item_key => $cart_item )
|
||||
if ( $cart_item_key == $cart_id )
|
||||
return $cart_item_key;
|
||||
if( is_array( $this->cart_contents ) )
|
||||
foreach ( $this->cart_contents as $cart_item_key => $cart_item )
|
||||
if ( $cart_item_key == $cart_id )
|
||||
return $cart_item_key;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue