mirror of
https://github.com/Sylius/Sylius.git
synced 2026-07-14 09:02:12 +00:00
Fix item repository and manager getters in cart controller
This commit is contained in:
parent
563ee96841
commit
c4e32f998a
1 changed files with 11 additions and 1 deletions
|
|
@ -88,7 +88,7 @@ class CartController extends ResourceController
|
|||
public function removeItemAction(Request $request, $id)
|
||||
{
|
||||
$cart = $this->getCurrentCart();
|
||||
$item = $this->getCartItemManager()->find($id);
|
||||
$item = $this->getCartItemRepository()->get(array('id' => $id));
|
||||
|
||||
if (!$item || false === $cart->hasItem($item)) {
|
||||
$this->setFlash('error', 'sylius_cart.flashes.remove.error');
|
||||
|
|
@ -200,6 +200,16 @@ class CartController extends ResourceController
|
|||
return $this->get('sylius_cart.manager.item');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get cart item repository.
|
||||
*
|
||||
* @return ResourceRepositoryInterface
|
||||
*/
|
||||
protected function getCartItemRepository()
|
||||
{
|
||||
return $this->get('sylius_cart.repository.item');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get cart provider.
|
||||
*
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue