Skip to content
Permalink
Browse files

An empty cart is not a virtual cart

  • Loading branch information...
Franck Allimant
Franck Allimant committed Oct 2, 2019
1 parent 06a5cb1 commit 522a9a5daf19e4f73747c295997fd5f926a9090c
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 522a9a5

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