Beispiel #1
0
 /**
  * Postprocess inserted entity
  *
  * @param \XLite\Model\OrderItem $entity OrderItem entity
  * @param array                  $line   Array of entity data from request
  *
  * @return boolean
  */
 protected function postprocessInsertedEntity(\XLite\Model\AEntity $entity, array $line)
 {
     $result = parent::postprocessInsertedEntity($entity, $line);
     if ($result && \XLite\Controller\Admin\Order::isNeedProcessStock()) {
         // Process PIN codes on order save
         $order = $this->getOrder();
         if ($order->isProcessed()) {
             $order->processPINCodes();
         }
     }
     return $result;
 }
Beispiel #2
0
 /**
  * Postprocess inserted entity
  *
  * @param \XLite\Model\OrderItem $entity OrderItem entity
  * @param array                  $line   Array of entity data from request
  *
  * @return boolean
  */
 protected function postprocessInsertedEntity(\XLite\Model\AEntity $entity, array $line)
 {
     $result = parent::postprocessInsertedEntity($entity, $line);
     if ($result && \XLite\Controller\Admin\Order::isNeedProcessStock()) {
         // Create private attachments
         $entity->createPrivateAttachments();
         // Renew private attachments
         foreach ($entity->getPrivateAttachments() as $attachment) {
             $attachment->renew();
         }
     }
     return $result;
 }