예제 #1
0
 /**
  * @param \Bitrix\Sale\Basket $basketCollection
  * @param array $productList
  */
 public static function viewProduct(Basket $basketCollection, array $productList = array())
 {
     $orderId = null;
     $siteId = null;
     if (!($orderId = $basketCollection->getOrderId())) {
         if (($order = $basketCollection->getOrder()) !== null) {
             $userId = $order->getUserId();
             $siteId = $order->getSiteId();
         }
     }
     if ($userId === null) {
         $userId = \CSaleUser::GetUserID($basketCollection->getFUserId());
         $siteId = $basketCollection->getSiteId();
     }
     $basketList = static::makeArrayFromBasketCollection($basketCollection);
     $basketProviderMap = static::createProviderBasketMap($basketCollection);
     $basketProviderList = static::redistributeToProviders($basketProviderMap);
     if (!empty($basketProviderList)) {
         foreach ($basketProviderList as $provider => $providerBasketItemList) {
             $result = $provider::viewProduct($siteId, $userId, $providerBasketItemList, $productList);
         }
     }
 }