本文整理汇总了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');
示例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"]];