Skip to content

Commit

Permalink
Fix: productList::__set()
Browse files Browse the repository at this point in the history
Make sure $key is same as $cartItem['key']
  • Loading branch information
tobiasfabian committed Apr 9, 2020
1 parent 851a6a9 commit 7041a1b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/productList.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,11 @@ public function __set(string $key, $value): self
if ($value['quantity'] < 0) {
throw new \Exception('The quantity of the cart must not be negative.');
}

if ($key !== $value['id']) {
$key = $value['id'];
}

$this->data[strtolower($key)] = $value;

if ($this->getTax() < 0) {
Expand Down

0 comments on commit 7041a1b

Please sign in to comment.