getProductTypes() public méthode

public getProductTypes ( ) : array
Résultat array
 /**
  * お届け先情報を作成
  *
  * @param Order $Order
  * @param Customer $Customer
  * @param $deliveries
  * @return Order
  */
 public function getNewShipping(Order $Order, Customer $Customer, $deliveries)
 {
     // カートに保持されている商品種別を取得
     $productTypes = $this->cartService->getProductTypes();
     if ($this->BaseInfo->getOptionMultipleShipping() == Constant::ENABLED && count($productTypes) > 1) {
         // 複数配送対応
         $productType = array();
         foreach ($deliveries as $Delivery) {
             if (!in_array($Delivery->getProductType()->getId(), $productType)) {
                 $Shipping = new Shipping();
                 $this->copyToShippingFromCustomer($Shipping, $Customer)->setOrder($Order)->setDelFlg(Constant::DISABLED);
                 // 配送料金の設定
                 $this->setShippingDeliveryFee($Shipping, $Delivery);
                 $this->em->persist($Shipping);
                 $Order->addShipping($Shipping);
             }
             $productType[] = $Delivery->getProductType()->getId();
         }
     } else {
         $Shipping = new Shipping();
         $this->copyToShippingFromCustomer($Shipping, $Customer)->setOrder($Order)->setDelFlg(Constant::DISABLED);
         $Delivery = $deliveries[0];
         // 配送料金の設定
         $this->setShippingDeliveryFee($Shipping, $Delivery);
         $this->em->persist($Shipping);
         $Order->addShipping($Shipping);
     }
     return $Order;
 }
Exemple #2
0
 /**
  * 配送業者情報を取得
  *
  * @return array
  */
 public function getDeliveriesCart()
 {
     // カートに保持されている商品種別を取得
     $productTypes = $this->cartService->getProductTypes();
     return $this->getDeliveries($productTypes);
 }