Beispiel #1
0
 /**
  * 支払方法を取得
  *
  * @param $deliveries
  * @param Order $Order
  * @return array
  */
 public function getFormPayments($deliveries, Order $Order)
 {
     $productTypes = $this->orderService->getProductTypes($Order);
     if ($this->BaseInfo->getOptionMultipleShipping() == Constant::ENABLED && count($productTypes) > 1) {
         // 複数配送時の支払方法
         $payments = $this->app['eccube.repository.payment']->findAllowedPayments($deliveries);
     } else {
         // 配送業者をセット
         $shippings = $Order->getShippings();
         $Shipping = $shippings[0];
         $payments = $this->app['eccube.repository.payment']->findPayments($Shipping->getDelivery(), true);
     }
     $payments = $this->getPayments($payments, $Order->getSubTotal());
     return $payments;
 }
Beispiel #2
0
 /**
  * @param  string $productClassId
  * @return \Eccube\Service\CartService
  */
 public function removeProduct($productClassId)
 {
     $this->cart->removeCartItemByIdentifier('Eccube\\Entity\\ProductClass', (string) $productClassId);
     // 支払方法の再設定
     if ($this->BaseInfo->getOptionMultipleShipping() == Constant::ENABLED) {
         // 複数配送対応
         $productTypes = array();
         foreach ($this->getCart()->getCartItems() as $item) {
             /* @var $ProductClass \Eccube\Entity\ProductClass */
             $ProductClass = $item->getObject();
             $productTypes[] = $ProductClass->getProductType();
         }
         // 配送業者を取得
         $deliveries = $this->entityManager->getRepository('Eccube\\Entity\\Delivery')->getDeliveries($productTypes);
         // 支払方法を取得
         $payments = $this->entityManager->getRepository('Eccube\\Entity\\Payment')->findAllowedPayments($deliveries);
         $this->getCart()->setPayments($payments);
     }
     return $this;
 }