コード例 #1
0
 /**
  * Record order shipping information after order is placed
  *
  * @param EventObserver $observer
  * @return void
  */
 public function execute(EventObserver $observer)
 {
     if ($this->shipperDataHelper->getConfigValue('carriers/shipper/active')) {
         $requestData = $observer->getRequestModel()->getPost();
         if (isset($requestData['order'])) {
             $orderData = $requestData['order'];
         }
         $quote = $observer->getSession()->getQuote();
         //if(!empty($orderData['shipping_method_flag']))
         if (!empty($orderData['shipping_method'])) {
             $shippingMethod = $orderData['shipping_method'];
             $this->carrierGroupHelper->saveCarrierGroupInformation($quote->getShippingAddress(), $shippingMethod);
         }
         //}
     }
 }