Skip to content

Commit

Permalink
fixed some cart manager method not found bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
indpurvesh committed May 7, 2018
1 parent aa78ab5 commit 57ee56b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
Binary file modified .DS_Store
Binary file not shown.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ src/.DS_Store
.DS_Store
.DS_Store
.DS_Store
.DS_Store
5 changes: 3 additions & 2 deletions src/Cart/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use Illuminate\Support\Collection;
use Illuminate\Session\SessionManager;
use AvoRed\Framework\Models\Database\Product;
use AvoRed\Framework\Cart\Product as CartFacadeProduct;

class Manager
{
Expand Down Expand Up @@ -38,7 +39,7 @@ public function add($slug, $qty): Manager

$product = Product::whereSlug($slug)->first();

$cartProduct = new Product();
$cartProduct = new CartFacadeProduct();

$cartProduct->name($product->name)
->qty($qty)
Expand All @@ -50,7 +51,7 @@ public function add($slug, $qty): Manager
$cartProducts->put($slug, $cartProduct);

$this->session->put($this->getSessionKey(), $cartProducts);

return $this;
}

Expand Down

0 comments on commit 57ee56b

Please sign in to comment.