Skip to content

Commit

Permalink
feat: keep a reference to the just-remove Product
Browse files Browse the repository at this point in the history
  • Loading branch information
dkarlovi committed Nov 22, 2022
1 parent 8aab656 commit bc8dcf3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,8 @@ public function removeItemAction(Request $request): Response
$this->getCartModifier()->removeFromList($this->getCart(), $cartItem);
$this->getCartManager()->persistCart($this->getCart());

$request->attributes->set('product', $cartItem->getProduct());

$this->get(TrackerInterface::class)->trackCartRemove($this->getCart(), $cartItem->getProduct(), $cartItem->getQuantity());

return $this->redirectToRoute('coreshop_cart_summary');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,8 @@ public function removeItemAction(Request $request): Response
$this->modifier->removeFromList($storageList, $storageListItem);
$this->manager->persist($storageList);

$request->attributes->set('product', $storageListItem->getProduct());

return $this->redirectToRoute($this->summaryRoute);
}

Expand Down

0 comments on commit bc8dcf3

Please sign in to comment.