本文整理汇总了PHP中CCatalogMeasure::getList方法的典型用法代码示例。如果您正苦于以下问题:PHP CCatalogMeasure::getList方法的具体用法?PHP CCatalogMeasure::getList怎么用?PHP CCatalogMeasure::getList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCatalogMeasure
的用法示例。
在下文中一共展示了CCatalogMeasure::getList方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getDefaultMeasure
public static function getDefaultMeasure($getStub = false, $getExt = false)
{
if (self::$defaultMeasure === null) {
$measureRes = CCatalogMeasure::getList(array(), array('IS_DEFAULT' => 'Y'), false, false, array());
if ($measure = $measureRes->GetNext()) {
$measure['ID'] = (int) $measure['ID'];
$measure['CODE'] = (int) $measure['CODE'];
self::$defaultMeasure = $measure;
}
}
if (self::$defaultMeasure === null) {
$measureRes = CCatalogMeasure::getList(array(), array('CODE' => self::DEFAULT_MEASURE_CODE), false, false, array());
if ($measure = $measureRes->GetNext()) {
$measure['ID'] = (int) $measure['ID'];
$measure['CODE'] = (int) $measure['CODE'];
self::$defaultMeasure = $measure;
}
}
if (self::$defaultMeasure === null) {
if ($getStub) {
$defaultMeasureDescription = CCatalogMeasureClassifier::getMeasureInfoByCode(self::DEFAULT_MEASURE_CODE);
if ($defaultMeasureDescription !== null) {
self::$defaultMeasure = array('ID' => 0, 'CODE' => self::DEFAULT_MEASURE_CODE, 'MEASURE_TITLE' => $defaultMeasureDescription['MEASURE_TITLE'], 'SYMBOL_RUS' => $defaultMeasureDescription['SYMBOL_RUS'], 'SYMBOL_INTL' => $defaultMeasureDescription['SYMBOL_INTL'], 'SYMBOL_LETTER_INTL' => $defaultMeasureDescription['SYMBOL_LETTER_INTL']);
if ($getExt) {
self::$defaultMeasure['~MEASURE_TITLE'] = self::$defaultMeasure['MEASURE_TITLE'];
self::$defaultMeasure['~SYMBOL_RUS'] = self::$defaultMeasure['SYMBOL_RUS'];
self::$defaultMeasure['~SYMBOL_INTL'] = self::$defaultMeasure['SYMBOL_INTL'];
self::$defaultMeasure['~SYMBOL_LETTER_INTL'] = self::$defaultMeasure['SYMBOL_LETTER_INTL'];
}
}
}
}
return self::$defaultMeasure;
}
示例2: load
protected function load()
{
$measureList = \CCatalogMeasure::getList(array(), array("ID" => $this->key), false, false, array("MEASURE_TITLE"));
$measure = $measureList->fetch();
if ($measure) {
return $measure['MEASURE_TITLE'];
} else {
return "";
}
}
示例3: getMeasureByCode
public static function getMeasureByCode($code)
{
if (!Main\Loader::includeModule('catalog')) {
throw new Main\SystemException("Could not load 'catalog' module.");
}
$dbMeasureResult = \CCatalogMeasure::getList(array(), array('=CODE' => $code), false, false, array('ID', 'CODE', 'SYMBOL_RUS', 'SYMBOL_INTL', 'IS_DEFAULT'));
$measureFields = is_object($dbMeasureResult) ? $dbMeasureResult->Fetch() : null;
if (!is_array($measureFields)) {
return null;
}
return array('ID' => intval($measureFields['ID']), 'CODE' => intval($measureFields['CODE']), 'IS_DEFAULT' => isset($measureFields['IS_DEFAULT']) && $measureFields['IS_DEFAULT'] === 'Y', 'SYMBOL' => isset($measureFields['SYMBOL_RUS']) ? $measureFields['SYMBOL_RUS'] : $measureFields['SYMBOL_INTL']);
}
示例4: array_keys
}
if ($boolPriceInc) {
$boolSubCurrency = Loader::includeModule('currency');
if ($boolSubCurrency) {
$arCurrencyList = array_keys(Currency\CurrencyManager::getCurrencyList());
}
}
unset($boolPriceInc);
}
$arSelectedFieldsMap = array();
foreach ($arSelectedFields as $field) {
$arSelectedFieldsMap[$field] = true;
}
$measureList = array(0 => ' ');
if (isset($arSelectedFieldsMap['CATALOG_MEASURE'])) {
$measureIterator = CCatalogMeasure::getList(array(), array(), false, false, array('ID', 'MEASURE_TITLE', 'SYMBOL_RUS'));
while ($measure = $measureIterator->Fetch()) {
$measureList[$measure['ID']] = $measure['SYMBOL_RUS'] != '' ? $measure['SYMBOL_RUS'] : $measure['MEASURE_TITLE'];
}
unset($measure, $measureIterator);
}
if (!(false == B_ADMIN_SUBELEMENTS_LIST && $bCopy)) {
$wf_status_id = "";
if (isset($_REQUEST["mode"]) && $_REQUEST["mode"] == "excel") {
$arNavParams = false;
} else {
$arNavParams = array("nPageSize" => CAdminSubResult::GetNavSize($sTableID, 20, $lAdmin->GetListUrl(true)));
}
$rsData = CIBlockElement::GetList($arOrder, $arFilter, false, $arNavParams, $arSelectedFields);
$rsData = new CAdminSubResult($rsData, $sTableID, $lAdmin->GetListUrl(true));
$wf_status_id = false;
示例5: unset
unset($arMeasureClassifier[$mainSectionId][$subSectionId][$code]["MEASURE_TITLE"]);
unset($arMeasureClassifier[$mainSectionId][$subSectionId][$code]["SYMBOL_RUS"]);
if (!CCatalogMeasure::add($arMeasureClassifier[$mainSectionId][$subSectionId][$code])) {
if ($ex = $APPLICATION->GetException()) {
$lAdmin->AddUpdateError($ex->GetString(), $code);
} else {
$lAdmin->AddUpdateError(GetMessage("ERROR_UPDATING_REC") . " (" . $code . ")", $code);
}
$DB->Rollback();
}
$DB->Commit();
$okMessage = GetMessage("CAT_MEASURE_SUCCESS_ADD") . "\n";
}
}
}
$dbMeasure = CCatalogMeasure::getList(array(), array(), false, false, array("CODE"));
while ($arMeasure = $dbMeasure->Fetch()) {
$arMeasureCode[] = $arMeasure["CODE"];
}
$lAdmin->AddHeaders(array(array("id" => "CODE", "content" => GetMessage("CAT_MEASURE_CODE"), "default" => true), array("id" => "MEASURE_TITLE", "content" => GetMessage("CAT_MEASURE_MEASURE_TITLE"), "default" => true), array("id" => "SYMBOL_RUS", "content" => GetMessage("CAT_MEASURE_SYMBOL_RUS"), "default" => true), array("id" => "SYMBOL_INTL", "content" => GetMessage("CAT_MEASURE_SYMBOL_INTL"), "default" => true), array("id" => "SYMBOL_LETTER_INTL", "content" => GetMessage("CAT_MEASURE_SYMBOL_LETTER_INTL"), "default" => false)));
foreach ($arMeasureClassifier[$mainSectionId][$subSectionId] as $code => $value) {
if ($code !== 'TITLE' && !in_array($code, $arMeasureCode) && $value['MEASURE_TITLE'] != '') {
$arRes['CODE'] = intval($code);
$arRows[$arRes['CODE']] = $row =& $lAdmin->AddRow($arRes['CODE']);
$row->AddField("CODE", $value['CODE']);
$row->AddField("MEASURE_TITLE", $value['MEASURE_TITLE']);
$row->AddField("SYMBOL_RUS", $value['SYMBOL_RUS']);
$row->AddField("SYMBOL_INTL", $value['SYMBOL_INTL']);
$row->AddField("SYMBOL_LETTER_INTL", $value['SYMBOL_LETTER_INTL']);
}
}
示例6: foreach
$arIDs[] = $arItem["PRODUCT_ID"];
}
foreach ($arResult["ITEMS"]["DelDelCanBuy"] as $key => $arItem) {
$arIDs[] = $arItem["PRODUCT_ID"];
}
foreach ($arResult["ITEMS"]["nAnCanBuy"] as $key => $arItem) {
$arIDs[] = $arItem["PRODUCT_ID"];
}
foreach ($arResult["ITEMS"]["ProdSubscribe"] as $key => $arItem) {
$arIDs[] = $arItem["PRODUCT_ID"];
}
$db_res = CCatalogProduct::GetList(array(), array("ID" => $arIDs), false, false, array("ID", "MEASURE"));
while ($res = $db_res->GetNext()) {
$arMeasures[$res["ID"]] = $res["MEASURE"];
}
$db_res = CCatalogMeasure::getList(array(), array("ID" => $arMeasures), false, false, array());
while ($res = $db_res->GetNext()) {
foreach ($arMeasures as $key => $value) {
if ($res["ID"] == $value) {
$arMeasures[$key] = $res;
}
}
}
foreach ($arResult["ITEMS"]["AnDelCanBuy"] as $key => $arItem) {
foreach ($arMeasures as $i => $value) {
if ($arItem["PRODUCT_ID"] == $i) {
$arResult["ITEMS"]["AnDelCanBuy"][$key]["MEASURE"] = $value;
}
}
}
foreach ($arResult["ITEMS"]["DelDelCanBuy"] as $key => $arItem) {
示例7: htmlspecialcharsex
{
$strProductType = '';
if (isset($arProductTypeList[$arRows['E'.$intOneElemID]->arRes['CATALOG_TYPE']]))
$strProductType = $arProductTypeList[$arRows['E'.$intOneElemID]->arRes['CATALOG_TYPE']];
if (isset($arProductGroupIDs[$intOneElemID]) && $arProductGroupIDs[$intOneElemID])
$strProductType .= ('' != $strProductType ? ', ' : '').GetMessage('IBLIST_A_CATALOG_TYPE_MESS_GROUP');
$arRows['E'.$intOneElemID]->AddViewField('CATALOG_TYPE', $strProductType);
}
if (isset($intOneElemID))
unset($intOneElemID);
if (isset($arVisibleColumnsMap['CATALOG_MEASURE']) && !empty($arMeasureIDs))
{
$rsMeasures = CCatalogMeasure::getList(
array(),
array('@ID' => array_keys($arMeasureIDs)),
false,
false,
array()
);
while ($arMeasure = $rsMeasures->Fetch())
{
$arMeasure['ID'] = (int)$arMeasure['ID'];
$strMeasure = htmlspecialcharsex('' != $arMeasure['SYMBOL_RUS'] ? $arMeasure['SYMBOL_RUS'] : $arMeasure['MEASURE_TITLE']);
if (isset($arMeasureIDs[$arMeasure['ID']]) && !empty($arMeasureIDs[$arMeasure['ID']]))
{
foreach ($arMeasureIDs[$arMeasure['ID']] as $intID)
{
if ($showCatalogWithOffers || $arRows['E'.$intID]->arRes['CATALOG_TYPE'] != CCatalogProduct::TYPE_SKU)
$arRows['E'.$intID]->AddViewField('CATALOG_MEASURE', $strMeasure);
else
$arRows['E'.$intID]->AddViewField('CATALOG_MEASURE', ' ');
示例8: doubleval
{
$intRatio = (int)$arRatio['RATIO'];
$dblRatio = doubleval($arRatio['RATIO']);
$mxRatio = ($dblRatio > $intRatio ? $dblRatio : $intRatio);
if (CATALOG_VALUE_EPSILON > abs($mxRatio))
$mxRatio = 1;
elseif (0 > $mxRatio)
$mxRatio = 1;
$arResult["CATALOG_MEASURE_RATIO"] = $mxRatio;
}
if (0 < $arResult['CATALOG_MEASURE'])
{
$rsMeasures = CCatalogMeasure::getList(
array(),
array('ID' => $arResult['CATALOG_MEASURE']),
false,
false,
array('ID', 'SYMBOL_RUS')
);
if ($arMeasure = $rsMeasures->GetNext())
{
$arResult['CATALOG_MEASURE_NAME'] = $arMeasure['SYMBOL_RUS'];
$arResult['~CATALOG_MEASURE_NAME'] = $arMeasure['~SYMBOL_RUS'];
}
}
if ('' == $arResult['CATALOG_MEASURE_NAME'])
{
$arDefaultMeasure = CCatalogMeasure::getDefaultMeasure(true, true);
$arResult['CATALOG_MEASURE_NAME'] = $arDefaultMeasure['SYMBOL_RUS'];
$arResult['~CATALOG_MEASURE_NAME'] = $arDefaultMeasure['~SYMBOL_RUS'];
}
示例9: ExportOrders2Xml
function ExportOrders2Xml($arFilter = Array(), $nTopCount = 0, $currency = "", $crmMode = false, $time_limit = 0, $version = false, $arOptions = Array())
{
global $DB;
$count = false;
if(IntVal($nTopCount) > 0)
$count = Array("nTopCount" => $nTopCount);
$bNewVersion = (strlen($version) > 0);
$bExportFromCrm = (isset($arOptions["EXPORT_FROM_CRM"]) && $arOptions["EXPORT_FROM_CRM"] === "Y");
if(IntVal($time_limit) > 0)
{
//This is an optimization. We assume than no step can take more than one year.
if($time_limit > 0)
$end_time = time() + $time_limit;
else
$end_time = time() + 365*24*3600; // One year
//$version
$lastOrderPrefix = "LAST_ORDER_ID";
if($crmMode)
{
$lastOrderPrefix = md5(serialize($arFilter));
if(!empty($_SESSION["BX_CML2_EXPORT"][$lastOrderPrefix]) && IntVal($nTopCount) > 0)
$count["nTopCount"] = $count["nTopCount"]+count($_SESSION["BX_CML2_EXPORT"][$lastOrderPrefix]);
}
else
{
if(IntVal($_SESSION["BX_CML2_EXPORT"][$lastOrderPrefix]) > 0)
{
$arFilter["<ID"] = $_SESSION["BX_CML2_EXPORT"][$lastOrderPrefix];
}
}
}
$arResultStat = array(
"ORDERS" => 0,
"CONTACTS" => 0,
"COMPANIES" => 0,
);
$accountNumberPrefix = COption::GetOptionString("sale", "1C_SALE_ACCOUNT_NUMBER_SHOP_PREFIX", "");
$dbPaySystem = CSalePaySystem::GetList(Array("ID" => "ASC"), Array("ACTIVE" => "Y"), false, false, Array("ID", "NAME", "ACTIVE"));
while($arPaySystem = $dbPaySystem -> Fetch())
$paySystems[$arPaySystem["ID"]] = $arPaySystem["NAME"];
$dbDelivery = CSaleDelivery::GetList(Array("ID" => "ASC"), Array("ACTIVE" => "Y"), false, false, Array("ID", "NAME", "ACTIVE"));
while($arDelivery = $dbDelivery -> Fetch())
$delivery[$arDelivery["ID"]] = $arDelivery["NAME"];
$rsDeliveryHandlers = CSaleDeliveryHandler::GetAdminList(array("SID" => "ASC"));
while ($arHandler = $rsDeliveryHandlers->Fetch())
{
if(is_array($arHandler["PROFILES"]))
{
foreach($arHandler["PROFILES"] as $k => $v)
{
$delivery[$arHandler["SID"].":".$k] = $v["TITLE"]." (".$arHandler["NAME"].")";
}
}
}
$arStore = array();
$arMeasures = array();
if(CModule::IncludeModule("catalog"))
{
$dbList = CCatalogStore::GetList(
array("SORT" => "DESC", "ID" => "ASC"),
array("ACTIVE" => "Y", "ISSUING_CENTER" => "Y"),
false,
false,
array("ID", "SORT", "TITLE", "ADDRESS", "DESCRIPTION", "PHONE", "EMAIL", "XML_ID")
);
while ($arStoreTmp = $dbList->Fetch())
{
if(strlen($arStoreTmp["XML_ID"]) <= 0)
$arStoreTmp["XML_ID"] = $arStoreTmp["ID"];
$arStore[$arStoreTmp["ID"]] = $arStoreTmp;
}
$dbList = CCatalogMeasure::getList(array(), array(), false, false, array("CODE", "MEASURE_TITLE"));
while($arList = $dbList->Fetch())
{
$arMeasures[$arList["CODE"]] = $arList["MEASURE_TITLE"];
}
}
if(empty($arMeasures))
$arMeasures[796] = GetMessage("SALE_EXPORT_SHTUKA");
$dbExport = CSaleExport::GetList();
while($arExport = $dbExport->Fetch())
{
$arAgent[$arExport["PERSON_TYPE_ID"]] = unserialize($arExport["VARS"]);
}
$dateFormat = CSite::GetDateFormat("FULL");
if ($crmMode)
{
echo "<"."?xml version=\"1.0\" encoding=\"UTF-8\"?".">\n";
//.........这里部分代码省略.........
示例10: GetOffersArray
//.........这里部分代码省略.........
$arOffer["DISPLAY_PROPERTIES"] = array();
$arOffer['CHECK_QUANTITY'] = 'Y' == $arOffer['CATALOG_QUANTITY_TRACE'] && 'N' == $arOffer['CATALOG_CAN_BUY_ZERO'];
$arOffer['CATALOG_TYPE'] = CCatalogProduct::TYPE_OFFER;
$arOffer['CATALOG_MEASURE_NAME'] = $arDefaultMeasure['SYMBOL_RUS'];
$arOffer['~CATALOG_MEASURE_NAME'] = $arDefaultMeasure['SYMBOL_RUS'];
$arOffer["CATALOG_MEASURE_RATIO"] = 1;
if (!isset($arOffer['CATALOG_MEASURE'])) {
$arOffer['CATALOG_MEASURE'] = 0;
}
$arOffer['CATALOG_MEASURE'] = (int) $arOffer['CATALOG_MEASURE'];
if (0 > $arOffer['CATALOG_MEASURE']) {
$arOffer['CATALOG_MEASURE'] = 0;
}
if (0 < $arOffer['CATALOG_MEASURE']) {
if (!isset($arMeasureMap[$arOffer['CATALOG_MEASURE']])) {
$arMeasureMap[$arOffer['CATALOG_MEASURE']] = array();
}
$arMeasureMap[$arOffer['CATALOG_MEASURE']][] = $intKey;
}
$arOfferIDs[] = $arOffer['ID'];
$arResult[$intKey] = $arOffer;
if (!isset($arOffersLink[$arOffer['ID']])) {
$arOffersLink[$arOffer['ID']] =& $arResult[$intKey];
} else {
if (!isset($extPrices[$arOffer['ID']])) {
$extPrices[$arOffer['ID']] = array();
}
$extPrices[$arOffer['ID']][] =& $arResult[$intKey];
}
$intKey++;
}
}
if (!empty($arOfferIDs)) {
$rsRatios = CCatalogMeasureRatio::getList(array(), array('@PRODUCT_ID' => $arOfferIDs), false, false, array('PRODUCT_ID', 'RATIO'));
while ($arRatio = $rsRatios->Fetch()) {
$arRatio['PRODUCT_ID'] = (int) $arRatio['PRODUCT_ID'];
if (isset($arOffersLink[$arRatio['PRODUCT_ID']])) {
$intRatio = (int) $arRatio['RATIO'];
$dblRatio = (double) $arRatio['RATIO'];
$mxRatio = $dblRatio > $intRatio ? $dblRatio : $intRatio;
if (CATALOG_VALUE_EPSILON > abs($mxRatio)) {
$mxRatio = 1;
} elseif (0 > $mxRatio) {
$mxRatio = 1;
}
$arOffersLink[$arRatio['PRODUCT_ID']]['CATALOG_MEASURE_RATIO'] = $mxRatio;
}
}
if (!empty($arSelectProperties)) {
CIBlockElement::GetPropertyValuesArray($arOffersLink, $intOfferIBlockID, $arFilter);
foreach ($arResult as &$arOffer) {
if (self::$needDiscountCache) {
CCatalogDiscount::SetProductPropertiesCache($arOffer['ID'], $arOffer["PROPERTIES"]);
}
foreach ($arSelectProperties as $pid) {
if (!isset($arOffer["PROPERTIES"][$pid])) {
continue;
}
$prop =& $arOffer["PROPERTIES"][$pid];
$boolArr = is_array($prop["VALUE"]);
if ($boolArr && !empty($prop["VALUE"]) || !$boolArr && strlen($prop["VALUE"]) > 0) {
$arOffer["DISPLAY_PROPERTIES"][$pid] = CIBlockFormatProperties::GetDisplayValue($arOffer, $prop, "catalog_out");
}
unset($prop);
}
}
示例11: array
$lAdmin->AddGroupError(GetMessage("ERROR_DELETING_TYPE"), $ID);
}
} else {
$DB->Commit();
}
break;
}
}
}
$arSelect = array("ID", "MEASURE_TITLE", "SYMBOL_RUS", "SYMBOL_INTL", "SYMBOL_LETTER_INTL", "IS_DEFAULT");
if (array_key_exists("mode", $_REQUEST) && $_REQUEST["mode"] == "excel") {
$arNavParams = false;
} else {
$arNavParams = array("nPageSize" => CAdminResult::GetNavSize($sTableID));
}
$dbResultList = CCatalogMeasure::getList(array($_REQUEST["by"] => $_REQUEST["order"]), array(), false, $arNavParams, $arSelect);
$dbResultList = new CCatalogMeasureAdminResult($dbResultList, $sTableID);
$dbResultList->NavStart();
$lAdmin->NavText($dbResultList->GetNavPrint(GetMessage("CAT_MEASURE_TITLE")));
$lAdmin->AddHeaders(array(array("id" => "ID", "content" => "ID", "sort" => "ID", "default" => true), array("id" => "CODE", "content" => GetMessage("CAT_MEASURE_CODE"), "sort" => "CODE", "default" => true), array("id" => "MEASURE_TITLE", "content" => GetMessage("CAT_MEASURE_MEASURE_TITLE"), "sort" => "MEASURE_TITLE", "default" => true), array("id" => "SYMBOL_RUS", "content" => GetMessage("CAT_MEASURE_SYMBOL_RUS"), "sort" => "SYMBOL_RUS", "default" => true), array("id" => "SYMBOL_INTL", "content" => GetMessage("CAT_MEASURE_SYMBOL_INTL"), "sort" => "SYMBOL_INTL", "default" => true), array("id" => "SYMBOL_LETTER_INTL", "content" => GetMessage("CAT_MEASURE_SYMBOL_LETTER_INTL"), "sort" => "SYMBOL_LETTER_INTL", "default" => false), array("id" => "IS_DEFAULT", "content" => GetMessage("CAT_MEASURE_IS_DEFAULT"), "sort" => "IS_DEFAULT", "default" => true)));
$arSelectFieldsMap = array("ID" => false, "CODE" => false, "MEASURE_TITLE" => false, "SYMBOL_RUS" => false, "SYMBOL_INTL" => false, "SYMBOL_LETTER_INTL" => false, "IS_DEFAULT" => false);
$arSelectFields = $lAdmin->GetVisibleHeaderColumns();
if (!in_array('ID', $arSelectFields)) {
$arSelectFields[] = 'ID';
}
$arSelectFieldsMap = array_merge($arSelectFieldsMap, array_fill_keys($arSelectFields, true));
$arUserList = array();
$arUserID = array();
$strNameFormat = CSite::GetNameFormat(true);
$arRows = array();
while ($arRes = $dbResultList->Fetch()) {
示例12: getCurrentRatioWithMeasure
/**
* Returns ratio and measure for products.
*
* @param array|int $product Product ids.
* @return array|bool
* @throws Main\ArgumentException
*/
public static function getCurrentRatioWithMeasure($product)
{
if (!is_array($product)) {
$product = array($product);
}
Main\Type\Collection::normalizeArrayValuesByInt($product, true);
if (empty($product)) {
return false;
}
$result = array();
$defaultMeasure = \CCatalogMeasure::getDefaultMeasure(true, true);
$defaultRow = array('RATIO' => 1, 'MEASURE' => !empty($defaultMeasure) ? $defaultMeasure : array());
$existProduct = array();
$measureMap = array();
$productRows = array_chunk($product, 500);
foreach ($productRows as &$row) {
$productIterator = self::getList(array('select' => array('ID', 'MEASURE'), 'filter' => array('@ID' => $row), 'order' => array('ID' => 'ASC')));
while ($item = $productIterator->fetch()) {
$item['ID'] = (int) $item['ID'];
$item['MEASURE'] = (int) $item['MEASURE'];
self::$existProductCache[$item['ID']] = true;
$existProduct[] = $item['ID'];
$result[$item['ID']] = $defaultRow;
if ($item['MEASURE'] > 0) {
if (!isset($measureMap[$item['MEASURE']])) {
$measureMap[$item['MEASURE']] = array();
}
$measureMap[$item['MEASURE']][] =& $result[$item['ID']];
}
}
unset($item, $productIterator);
}
unset($row, $productRows);
unset($defaultRow, $defaultMeasure);
if (empty($existProduct)) {
return false;
}
$ratioResult = MeasureRatioTable::getCurrentRatio($existProduct);
if (!empty($ratioResult)) {
foreach ($ratioResult as $ratioProduct => $ratio) {
$result[$ratioProduct]['RATIO'] = $ratio;
}
unset($ratio, $ratioProduct);
}
unset($ratioResult);
unset($existProduct);
if (!empty($measureMap)) {
$measureIterator = \CCatalogMeasure::getList(array(), array('@ID' => array_keys($measureMap)), false, false, array());
while ($measure = $measureIterator->getNext()) {
$measure['ID'] = (int) $measure['ID'];
if (empty($measureMap[$measure['ID']])) {
continue;
}
foreach ($measureMap[$measure['ID']] as &$product) {
$product['MEASURE'] = $measure;
}
unset($product);
}
unset($measure, $measureIterator);
}
unset($measureMap);
return $result;
}
示例13: foreach
foreach ($arResult["SET_ITEMS"][$key]["PRICE_MATRIX"]["COLS"] as $keyColumn => $arColumn) {
$arResult["SET_ITEMS"][$key]["PRICE_MATRIX"]["COLS"][$keyColumn]["NAME_LANG"] = htmlspecialcharsbx($arColumn["NAME_LANG"]);
}
}
} else {
$arResult["SET_ITEMS"][$key]["PRICES"] = CIBlockPriceTools::GetItemPrices($arParams["IBLOCK_ID"], $arResultPrices, $arResult["SET_ITEMS"][$key], $arParams['PRICE_VAT_INCLUDE'], $arConvertParams);
if (!empty($arResult["SET_ITEMS"][$key]["PRICES"])) {
foreach ($arResult["SET_ITEMS"][$key]['PRICES'] as &$arOnePrice) {
if ('Y' == $arOnePrice['MIN_PRICE']) {
$arResult["SET_ITEMS"][$key]['MIN_PRICE'] = $arOnePrice;
break;
}
}
unset($arOnePrice);
}
}
if ($arParams["SHOW_MEASURE"] == "Y" && $setItem["CATALOG_MEASURE"]) {
$arResult["SET_ITEMS"][$key]["MEASURE"] = CCatalogMeasure::getList(array(), array("ID" => $setItem["CATALOG_MEASURE"]), false, false, array())->GetNext();
}
}
}
}
/*$cp = $this->__component;
if (is_object($cp))
{
$cp->arResult["SECTION_FULL"] =$db_res;
$cp->SetResultCacheKeys("SECTION_FULL");
}*/
if ($arResult["DETAIL_PICTURE"]["SRC"]) {
$APPLICATION->AddHeadString('<link rel="image_src" href="' . $arResult["DETAIL_PICTURE"]["SRC"] . '" />', true);
}
示例14: array
"ORDER_ID" => $ID
),
false,
false,
array()
);
while ($arItems = $dbBasketItems->Fetch())
{
$arResult["ORDER_INFO"]["ITEMS"][$arItems["PRODUCT_ID"]] = $arItems;
$orderSumm = $orderSumm + ($arItems["PRICE"] * $arItems["QUANTITY"]);
$arBasketItems[] = $arItems["PRODUCT_ID"];
}
$arResult["ORDER_INFO"]["ITEMS_SUMM"] = $orderSumm;
$arMeasure = Array();
$res_measure = CCatalogMeasure::getList();
while($measure = $res_measure->Fetch()){
$arMeasure[$measure["ID"]] = $measure["SYMBOL_RUS"];
}
if (count($arBasketItems) > 0){
$db_res = CCatalogProduct::GetList(
array(),
array("ID" => $arBasketItems),
false,
false,
Array("ID", "MEASURE")
);
while ($ar_res = $db_res->Fetch())
{
$arResult["ORDER_INFO"]["ITEMS"][$ar_res["ID"]]["MEASURE"] = $arMeasure[$ar_res["MEASURE"]];
示例15: GetOffersArray
//.........这里部分代码省略.........
}
if($element_id > 0)
{
$arOffer["LINK_ELEMENT_ID"] = intval($element_id);
$arOffer["PROPERTIES"] = array();
$arOffer["DISPLAY_PROPERTIES"] = array();
$arOffer['CHECK_QUANTITY'] = ('Y' == $arOffer['CATALOG_QUANTITY_TRACE'] && 'N' == $arOffer['CATALOG_CAN_BUY_ZERO']);
$arOffer['CATALOG_TYPE'] = CCatalogProduct::TYPE_OFFER;
$arOffer['CATALOG_MEASURE_NAME'] = $arDefaultMeasure['SYMBOL_RUS'];
$arOffer['~CATALOG_MEASURE_NAME'] = $arDefaultMeasure['SYMBOL_RUS'];
$arOffer["CATALOG_MEASURE_RATIO"] = 1;
if (!isset($arOffer['CATALOG_MEASURE']))
$arOffer['CATALOG_MEASURE'] = 0;
$arOffer['CATALOG_MEASURE'] = intval($arOffer['CATALOG_MEASURE']);
if (0 > $arOffer['CATALOG_MEASURE'])
$arOffer['CATALOG_MEASURE'] = 0;
if (0 < $arOffer['CATALOG_MEASURE'])
{
if (!isset($arMeasureMap[$arOffer['CATALOG_MEASURE']]))
$arMeasureMap[$arOffer['CATALOG_MEASURE']] = array();
$arMeasureMap[$arOffer['CATALOG_MEASURE']][] = $intKey;
}
$arOfferIDs[] = $arOffer['ID'];
$arResult[$intKey] = $arOffer;
$arOffersLink[$arOffer['ID']] = &$arResult[$intKey];
$intKey++;
}
}
if (!empty($arOfferIDs))
{
$rsRatios = CCatalogMeasureRatio::getList(
array(),
array('PRODUCT_ID' => $arOfferIDs),
false,
false,
array('PRODUCT_ID', 'RATIO')
);
while ($arRatio = $rsRatios->Fetch())
{
$arRatio['PRODUCT_ID'] = intval($arRatio['PRODUCT_ID']);
if (isset($arOffersLink[$arRatio['PRODUCT_ID']]))
{
$intRatio = intval($arRatio['RATIO']);
$dblRatio = doubleval($arRatio['RATIO']);
$mxRatio = ($dblRatio > $intRatio ? $dblRatio : $intRatio);
if (CATALOG_VALUE_EPSILON > abs($mxRatio))
$mxRatio = 1;
elseif (0 > $mxRatio)
$mxRatio = 1;
$arOffersLink[$arRatio['PRODUCT_ID']]['CATALOG_MEASURE_RATIO'] = $mxRatio;
}
}
if (!empty($arSelectProperties))
{
CIBlockElement::GetPropertyValuesArray($arOffersLink, $intOfferIBlockID, $arFilter);
foreach ($arResult as &$arOffer)
{
CCatalogDiscount::SetProductPropertiesCache($arOffer['ID'], $arOffer["PROPERTIES"]);
foreach ($arSelectProperties as $pid)
{
if (!isset($arOffer["PROPERTIES"][$pid]))
continue;