#153 (Cannot add zero price) fixed

This commit is contained in:
Muhammad Sumon Molla Selim
2016-06-05 22:20:00 +06:00
parent bd7a2ce807
commit 41a3c0311d

View File

@@ -74,7 +74,7 @@ class CartItem
{
if(empty($id)) throw new \InvalidArgumentException('Please supply a valid identifier.');
if(empty($name)) throw new \InvalidArgumentException('Please supply a valid name.');
if(empty($price) || ! is_numeric($price))
if(strlen($price) < 0 || ! is_numeric($price))
throw new \InvalidArgumentException('Please supply a valid price.');
$this->id = $id;
@@ -268,4 +268,4 @@ class CartItem
return md5($id . serialize($options));
}
}
}