Merge pull request #154 from SumonMSelim/develop

#153 (Cannot add zero price) fixed
This commit is contained in:
Rob Gloudemans
2016-06-15 10:01:34 +02:00
committed by GitHub

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));
}
}
}