Skip to content
Permalink
Browse files

Merge pull request #2695 from roadster31/fix-virtual-cart

An empty cart is not a virtual cart
  • Loading branch information...
roadster31 committed Oct 2, 2019
2 parents 06a5cb1 + 522a9a5 commit 27079ab4eca87bc93cc24caaf8f485bd6ad94a4c
Showing with 5 additions and 2 deletions.
  1. +5 −2 core/lib/Thelia/Model/Cart.php
@@ -202,6 +202,7 @@ public function getWeight()
* Tell if the cart contains only virtual products
*
* @return bool
* @throws \Propel\Runtime\Exception\PropelException
*/
public function isVirtual()
{
@@ -211,11 +212,13 @@ public function isVirtual()
}
$product = $cartItem->getProductSaleElements()->getProduct();
if (!$product->getVirtual()) {
if (! $product->getVirtual()) {
return false;
}
}
return true;
// An empty cart is not virtual.
return $this->getCartItems()->count() > 0;
}
}

0 comments on commit 27079ab

Please sign in to comment.
You can’t perform that action at this time.