当前位置: 首页>>代码示例>>PHP>>正文


PHP CCatalogSKU::getOffersList方法代码示例

本文整理汇总了PHP中CCatalogSKU::getOffersList方法的典型用法代码示例。如果您正苦于以下问题:PHP CCatalogSKU::getOffersList方法的具体用法?PHP CCatalogSKU::getOffersList怎么用?PHP CCatalogSKU::getOffersList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CCatalogSKU的用法示例。


在下文中一共展示了CCatalogSKU::getOffersList方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: loadAllSku

 protected function loadAllSku(array $productIds)
 {
     $arOffersIblock = $this->getOffersIblockId();
     if ($arOffersIblock > 0 && $productIds) {
         $propFilter = array();
         $props = $this->getSkuProps(true);
         if ($props) {
             foreach ($props as $prop) {
                 $propFilter['ID'][] = $prop['ID'];
             }
         }
         $select = array('NAME', "ACTIVE", 'CATALOG_QUANTITY');
         $visible = $this->getVisibleColumns();
         if (in_array('PREVIEW_PICTURE', $visible)) {
             $select[] = 'PREVIEW_PICTURE';
         }
         if (in_array('DETAIL_PICTURE', $visible)) {
             $select[] = 'DETAIL_PICTURE';
         }
         $this->offers = \CCatalogSKU::getOffersList($productIds, $this->getIblockId(), array(), $select, $propFilter);
         if (!empty($this->offers)) {
             $offersIds = array();
             $offersLink = array();
             foreach ($this->offers as $productId => $productOffers) {
                 if (empty($productOffers)) {
                     continue;
                 }
                 $productOffersIds = array_keys($productOffers);
                 foreach ($productOffersIds as &$oneId) {
                     $offersIds[] = $oneId;
                     $offersLink[$oneId] =& $this->offers[$productId][$oneId];
                 }
             }
             unset($productId, $productOffers);
             if (!empty($offersIds)) {
                 $ratioResult = Catalog\ProductTable::getCurrentRatioWithMeasure($offersIds);
                 if (!empty($ratioResult)) {
                     foreach ($ratioResult as $oneOfferId => $ratioData) {
                         if (!isset($offersLink[$oneOfferId])) {
                             continue;
                         }
                         $offersLink[$oneOfferId]['MEASURE_RATIO'] = $ratioData['RATIO'];
                         $offersLink[$oneOfferId]['MEASURE'] = $ratioData['MEASURE'];
                     }
                     unset($oneOfferId, $ratioData);
                 }
                 unset($ratioResult);
             }
             unset($offersLink, $offersIds);
         }
     }
 }
开发者ID:Satariall,项目名称:izurit,代码行数:52,代码来源:class.php

示例2: loadAllSku

 protected function loadAllSku(array $productIds)
 {
     $arOffersIblock = $this->getOffersIblockId();
     if ($arOffersIblock > 0 && $productIds) {
         $propFilter = array();
         $props = $this->getSkuProps(true);
         if ($props) {
             foreach ($props as $prop) {
                 $propFilter['ID'][] = $prop['ID'];
             }
         }
         $select = array('NAME', "ACTIVE", 'CATALOG_QUANTITY');
         $visible = $this->getVisibleColumns();
         if (in_array('PREVIEW_PICTURE', $visible)) {
             $select[] = 'PREVIEW_PICTURE';
         }
         if (in_array('DETAIL_PICTURE', $visible)) {
             $select[] = 'DETAIL_PICTURE';
         }
         $this->offers = \CCatalogSKU::getOffersList($productIds, $this->getIblockId(), array(), $select, $propFilter);
     }
 }
开发者ID:ASDAFF,项目名称:1C_Bitrix_info_site,代码行数:22,代码来源:class.php

示例3: getOffersSkuParams

 public static function getOffersSkuParams(array $productsParams)
 {
     if (self::$catalogIncluded === null) {
         self::$catalogIncluded = Main\Loader::includeModule('catalog');
     }
     if (!self::$catalogIncluded) {
         return $productsParams;
     }
     foreach ($productsParams["ITEMS"] as &$params) {
         if (!isset(self::$productsOffersSkuParams[$params["PRODUCT_ID"]])) {
             $propFilter = array();
             $props = static::getSkuProps(true, $params["IBLOCK_ID"]);
             if ($props) {
                 foreach ($props as $prop) {
                     $propFilter['ID'][] = $prop['ID'];
                 }
             }
             $select = array('NAME', "ACTIVE", 'CATALOG_QUANTITY');
             $offers = \CCatalogSKU::getOffersList(array($params["PRODUCT_ID"]), 0, array(), $select, $propFilter);
             if ($offers) {
                 $tmpProps = static::getPropsFromOffers2($offers);
                 self::$productsOffersSkuParams[$params["PRODUCT_ID"]] = $tmpProps[$params["PRODUCT_ID"]];
             }
         }
         if (intval($params["OFFERS_IBLOCK_ID"]) > 0 && !isset(self::$iblockPropsParams[$params["OFFERS_IBLOCK_ID"]])) {
             self::$iblockPropsParams[$params["OFFERS_IBLOCK_ID"]] = static::getPropsParams($params["OFFERS_IBLOCK_ID"]);
         }
         //			if(intval($params["IBLOCK_ID"]) > 0 && !isset($iblockPropsParams[$params["IBLOCK_ID"]]))
         //				$iblockPropsParams[$params["IBLOCK_ID"]] = static::getPropsParams($params["IBLOCK_ID"]);
         $params["SKU_PROPS"] = self::$productsOffersSkuParams[$params["PRODUCT_ID"]][$params["OFFER_ID"]];
         if (is_array($params["SKU_PROPS"])) {
             foreach ($params["SKU_PROPS"] as $id => $skuProps) {
                 $params["SKU_PROPS"][$id] = array('ID' => $skuProps, 'NAME' => self::$iblockPropsParams[$params["OFFERS_IBLOCK_ID"]][$id]['NAME'], 'VALUE' => self::$iblockPropsParams[$params["OFFERS_IBLOCK_ID"]][$id]['VALUES'][$skuProps], 'CODE' => self::$iblockPropsParams[$params["OFFERS_IBLOCK_ID"]][$id]['CODE'], 'SORT' => self::$iblockPropsParams[$params["OFFERS_IBLOCK_ID"]][$id]['SORT']);
             }
         }
     }
     $productsParams["IBLOCKS_SKU_PARAMS"] = self::$iblockPropsParams;
     $productsParams["PRODUCTS_OFFERS_SKU"] = self::$productsOffersSkuParams;
     return $productsParams;
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:40,代码来源:orderbasket.php


注:本文中的CCatalogSKU::getOffersList方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。