Exemplo n.º 1
0
 /**
  * {@inheritdoc}
  */
 public function saveAttribute(\Magento\Framework\Model\AbstractModel $object, $attribute)
 {
     $pluginInfo = $this->pluginList->getNext($this->subjectType, 'saveAttribute');
     if (!$pluginInfo) {
         return parent::saveAttribute($object, $attribute);
     } else {
         return $this->___callPlugins('saveAttribute', func_get_args(), $pluginInfo);
     }
 }
 /**
  * Sends order email to the customer.
  *
  * Email will be sent immediately in two cases:
  *
  * - if asynchronous email sending is disabled in global settings
  * - if $forceSyncMode parameter is set to TRUE
  *
  * Otherwise, email will be sent later during running of
  * corresponding cron job.
  *
  * @param Order $order
  * @param bool $forceSyncMode
  * @return bool
  */
 public function send(Order $order, $forceSyncMode = false)
 {
     $order->setSendEmail(true);
     if (!$this->globalConfig->getValue('sales_email/general/async_sending') || $forceSyncMode) {
         if ($this->checkAndSend($order)) {
             $order->setEmailSent(true);
             $this->orderResource->saveAttribute($order, ['send_email', 'email_sent']);
             return true;
         }
     }
     $this->orderResource->saveAttribute($order, 'send_email');
     return false;
 }