當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CCatalogProduct::getList方法代碼示例

本文整理匯總了PHP中CCatalogProduct::getList方法的典型用法代碼示例。如果您正苦於以下問題:PHP CCatalogProduct::getList方法的具體用法?PHP CCatalogProduct::getList怎麽用?PHP CCatalogProduct::getList使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在CCatalogProduct的用法示例。


在下文中一共展示了CCatalogProduct::getList方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: isset

    return $cache[$ID];
}
if ($_SERVER["REQUEST_METHOD"] == "POST" && isset($_REQUEST["BARCODE_AJAX"]) && $_REQUEST["BARCODE_AJAX"] === 'Y' && check_bitrix_sessid()) {
    $barcode = isset($_REQUEST["BARCODE"]) ? htmlspecialcharsbx($_REQUEST["BARCODE"]) : "";
    $arBarCode = array();
    $arElement = array();
    $elementId = 0;
    if (strlen($barcode) > 0) {
        $rsBarCode = CCatalogStoreBarCode::getList(array(), array("BARCODE" => $barcode), false, false, array('PRODUCT_ID'));
        $arBarCode = $rsBarCode->Fetch();
    }
    if (isset($arBarCode["PRODUCT_ID"])) {
        $elementId = intval($arBarCode["PRODUCT_ID"]);
    }
    if ($elementId > 0) {
        $dbResultList = CCatalogProduct::getList(array(), array('ID' => $elementId), false, false, array('TYPE'));
        $arItems = $dbResultList->Fetch();
        $arParams = array("id" => $elementId, "barcode" => $barcode);
        if (isset($arItems["TYPE"])) {
            $arParams['type'] = $arItems["TYPE"];
        }
        $result = CUtil::PhpToJSObject($arParams);
        echo $result;
    }
    exit;
}
CModule::IncludeModule('fileman');
$minImageSize = array("W" => 1, "H" => 1);
$maxImageSize = array("W" => COption::GetOptionString("iblock", "list_image_size"), "H" => COption::GetOptionString("iblock", "list_image_size"));
$adminMenu = new CCatalogMenu();
$adminMenu->Init('iblock');
開發者ID:akniyev,項目名稱:itprom_dobrohost,代碼行數:31,代碼來源:cat_store_product_search.php

示例2: getProductDataToFillBasket


//.........這裏部分代碼省略.........
                 $arElementInfo["~XML_ID"] = $arParent['~XML_ID'] . '#' . $arElementInfo["~XML_ID"];
             }
         }
         $arElementInfo["MODULE"] = "catalog";
         $arElementInfo["PRODUCT_PROVIDER_CLASS"] = "CCatalogProductProvider";
         $arElementInfo["PRODUCT_ID"] = $arElementInfo["ID"];
         if ($arElementInfo["IBLOCK_ID"] > 0) {
             $arElementInfo["EDIT_PAGE_URL"] = \CIBlock::GetAdminElementEditLink($arElementInfo["IBLOCK_ID"], $arElementInfo["PRODUCT_ID"], array("find_section_section" => $arElementInfo["IBLOCK_SECTION_ID"], 'WF' => 'Y'));
         }
         static $buyersGroups = array();
         if (empty($buyersGroups[$userId])) {
             $buyersGroups[$userId] = \CUser::getUserGroup($userId);
         }
         $arBuyerGroups = $buyersGroups[$userId];
         // price
         $currentVatMode = \CCatalogProduct::getPriceVatIncludeMode();
         $currentUseDiscount = \CCatalogProduct::getUseDiscount();
         \CCatalogProduct::setUseDiscount(!$isSetItem);
         \CCatalogProduct::setPriceVatIncludeMode(true);
         \CCatalogProduct::setUsedCurrency(Sale\Internals\SiteCurrencyTable::getSiteCurrency($LID));
         $arPrice = \CCatalogProduct::getOptimalPrice($arElementInfo["ID"], 1, $arBuyerGroups, "N", array(), $LID);
         \CCatalogProduct::clearUsedCurrency();
         \CCatalogProduct::setPriceVatIncludeMode($currentVatMode);
         \CCatalogProduct::setUseDiscount($currentUseDiscount);
         unset($currentUseDiscount, $currentVatMode);
         $currentPrice = $arPrice['RESULT_PRICE']['DISCOUNT_PRICE'];
         $arElementInfo['PRICE'] = $currentPrice;
         $arElementInfo['CURRENCY'] = $arPrice['RESULT_PRICE']['CURRENCY'];
         $currentTotalPrice = $arPrice['RESULT_PRICE']['BASE_PRICE'];
         $arProduct = array();
         if (!empty($proxyCatalogProduct[$productId]) && is_array($proxyCatalogProduct[$productId])) {
             $arProduct = $proxyCatalogProduct[$productId];
         } else {
             $rsProducts = \CCatalogProduct::getList(array(), array('ID' => $productId), false, false, array('ID', 'QUANTITY', 'WEIGHT', 'MEASURE', 'TYPE', 'BARCODE_MULTI'));
             if ($arProduct = $rsProducts->Fetch()) {
                 $proxyCatalogProduct[$productId] = $arProduct;
             }
         }
         if (empty($arProduct) || !is_array($arProduct)) {
             return array();
         }
         $balance = floatval($arProduct["QUANTITY"]);
         // sku props
         $arSkuData = array();
         $arProps[] = array("NAME" => "Catalog XML_ID", "CODE" => "CATALOG.XML_ID", "VALUE" => $arElementInfo['~IBLOCK_XML_ID']);
         static $proxySkuProperty = array();
         if (!empty($proxySkuProperty[$productId]) && is_array($proxySkuProperty[$productId])) {
             $arSkuProperty = $proxySkuProperty[$productId];
         } else {
             $arSkuProperty = \CSaleProduct::GetProductSkuProps($productId, '', true);
             $proxySkuProperty[$productId] = $arSkuProperty;
         }
         if (!empty($arSkuProperty)) {
             foreach ($arSkuProperty as &$val) {
                 $arSkuData[] = array('NAME' => $val['NAME'], 'VALUE' => $val['VALUE'], 'CODE' => $val['CODE']);
             }
             unset($val);
         }
         $arSkuData[] = array("NAME" => "Product XML_ID", "CODE" => "PRODUCT.XML_ID", "VALUE" => $arElementInfo["~XML_ID"]);
         $arElementInfo["WEIGHT"] = $arProduct["WEIGHT"];
         // measure
         $arElementInfo["MEASURE_TEXT"] = "";
         $arElementInfo["MEASURE_CODE"] = 0;
         if ((int) $arProduct["MEASURE"] > 0) {
             if (!empty($proxyCatalogMeasure[$arProduct["MEASURE"]]) && is_array($proxyCatalogMeasure[$arProduct["MEASURE"]])) {
                 $arMeasure = $proxyCatalogMeasure[$arProduct["MEASURE"]];
開發者ID:DarneoStudio,項目名稱:bitrix,代碼行數:67,代碼來源:orderbasket.php


注:本文中的CCatalogProduct::getList方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。