mirror of
https://github.com/kevin-DL/LaravelShoppingcart.git
synced 2026-01-18 05:25:04 +00:00
Merge pull request #154 from SumonMSelim/develop
#153 (Cannot add zero price) fixed
This commit is contained in:
@@ -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));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user