Example #1
0
 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);
         if ($this->isPlaced()) {
             $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;
 }