public function place() { if ($this->isPlaced()) { throw new Ess_M2ePro_Model_Exception_Logic('QTY is already reserved.'); } $this->order->associateWithStore(false); $this->order->associateItemsWithProducts(false); try { $this->performAction(self::ACTION_SUB, self::STATE_PLACED); $this->order->addSuccessLog('QTY has been reserved.'); } catch (Exception $e) { $this->order->addErrorLog('QTY was not reserved. Reason: %msg%', array('msg' => $e->getMessage())); return false; } return true; }
public function place() { if ($this->isPlaced()) { throw new LogicException('QTY is already reserved.'); } if ($this->order->getAccount()->getChildObject()->getQtyReservationDays() <= 0) { throw new LogicException('QTY reservation is disabled in Account settings.'); } $this->order->associateWithStore(false); $this->order->associateItemsWithProducts(false); try { $this->performAction(self::ACTION_SUB, self::STATE_PLACED); $this->order->addSuccessLog('QTY has been reserved.'); } catch (Exception $e) { $this->order->addErrorLog('QTY was not reserved. Reason: %msg%', array('msg' => $e->getMessage())); return false; } return true; }