private function changeProductQty(Ess_M2ePro_Model_Magento_Product $magentoProduct, Ess_M2ePro_Model_Magento_Product_StockItem $magentoStockItem, $action, $qty) { $result = true; switch ($action) { case self::ACTION_ADD: $magentoStockItem->addQty($qty, false); break; case self::ACTION_SUB: try { $magentoStockItem->subtractQty($qty, false); } catch (Exception $e) { $result = false; $this->order->addErrorLog('Qty for product "%name%" cannot be reserved. Reason: %msg%', array('!name' => $magentoProduct->getName(), 'msg' => $e->getMessage())); } break; } return $result; }