Skip to content

Commit

Permalink
Merge pull request #66 from lukepolo/dev
Browse files Browse the repository at this point in the history
need to return the item by it hash because it may have been updated t…
  • Loading branch information
lukepolo committed Feb 2, 2016
2 parents 29e6c55 + 39fbaee commit c1eaef9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/LaraCart.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ public function add(
$taxable = true,
$lineItem = false
) {
return $this->addItem(
$item = $this->addItem(
new CartItem(
$itemID,
$name,
Expand All @@ -170,6 +170,8 @@ public function add(
$lineItem
)
);

return $this->getItem($item->getHash());
}

/**
Expand Down

0 comments on commit c1eaef9

Please sign in to comment.