public function modifyAction()
 {
     $cartItem = $this->getParam("cartItem", null);
     $amount = $this->getParam("amount");
     $item = CoreShopCartItem::getById($cartItem);
     $isAllowed = true;
     $result = Plugin::getEventManager()->trigger('cart.preModify', $this, array("cartItem" => $item, "cart" => $this->cart, "request" => $this->getRequest()), function ($v) {
         return is_bool($v);
     });
     if ($result->stopped()) {
         $isAllowed = $result->last();
     }
     unset($this->session->order);
     if ($isAllowed) {
         if ($item instanceof CoreShopCartItem) {
             $this->cart->modifyItem($item, $amount);
             Plugin::getEventManager()->trigger('cart.postModify', $this, array("item" => $item, "cart" => $this->cart));
             $this->_helper->json(array("success" => true, "cart" => $this->cart->toArray()));
         }
     } else {
         $this->_helper->json(array("success" => false, "message" => 'not allowed'));
     }
     $this->_helper->json(array("success" => false, "cart" => $this->cart->toArray()));
 }