本文整理汇总了PHP中CIBlockPriceTools::setRatioMinPrice方法的典型用法代码示例。如果您正苦于以下问题:PHP CIBlockPriceTools::setRatioMinPrice方法的具体用法?PHP CIBlockPriceTools::setRatioMinPrice怎么用?PHP CIBlockPriceTools::setRatioMinPrice使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CIBlockPriceTools
的用法示例。
在下文中一共展示了CIBlockPriceTools::setRatioMinPrice方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: foreach
}*/
if (-1 == $intSelected) {
$intSelected = 0;
}
/*if (!$arMatrix[$intSelected]['OWNER_PICT'])
{
$arItem['PREVIEW_PICTURE'] = $arMatrix[$intSelected]['PREVIEW_PICTURE'];
$arItem['PREVIEW_PICTURE_SECOND'] = $arMatrix[$intSelected]['PREVIEW_PICTURE_SECOND'];
}*/
$arItem['JS_OFFERS'] = $arMatrix;
//$arItem['OFFERS_SELECTED'] = $intSelected;
$arItem['OFFERS_PROPS_DISPLAY'] = $boolSKUDisplayProperties;
$arItem['MIN_PRICE'] = CIShop::getMinPriceFromOffersExt($arItem['OFFERS'], $boolConvert ? $arResult['CONVERT_CURRENCY']['CURRENCY_ID'] : $strBaseCurrency);
}
if ($arItem['CATALOG'] && CCatalogProduct::TYPE_PRODUCT == $arItem['CATALOG_TYPE']) {
CIBlockPriceTools::setRatioMinPrice($arItem, true);
}
if (!empty($arItem['DISPLAY_PROPERTIES'])) {
foreach ($arItem['DISPLAY_PROPERTIES'] as $propKey => $arDispProp) {
if ('F' == $arDispProp['PROPERTY_TYPE']) {
unset($arItem['DISPLAY_PROPERTIES'][$propKey]);
}
}
}
$arItem['LAST_ELEMENT'] = 'N';
$arNewItemsList[$key] = $arItem;
}
$arNewItemsList[$key]['LAST_ELEMENT'] = 'Y';
$arResult['ITEMS'] = $arNewItemsList;
$arResult['SKU_PROPS'] = $skuPropList;
$arResult['DEFAULT_PICTURE'] = $arEmptyPreview;
示例2: array
'SLIDER_COUNT' => $arOffer['MORE_PHOTO_COUNT'],
'BUY_URL' => $arOffer['~BUY_URL']
);
$arMatrix[$keyOffer] = $arOneRow;
}
if (-1 == $intSelected)
$intSelected = 0;
$arResult['JS_OFFERS'] = $arMatrix;
$arResult['OFFERS_SELECTED'] = $intSelected;
$arResult['OFFERS_IBLOCK'] = $arSKU['IBLOCK_ID'];
}
if ($arResult['MODULES']['catalog'] && $arResult['CATALOG'] && CCatalogProduct::TYPE_PRODUCT == $arResult['CATALOG_TYPE'])
{
CIBlockPriceTools::setRatioMinPrice($arResult, true);
}
if (!empty($arResult['DISPLAY_PROPERTIES']))
{
foreach ($arResult['DISPLAY_PROPERTIES'] as $propKey => $arDispProp)
{
if ('F' == $arDispProp['PROPERTY_TYPE'])
unset($arResult['DISPLAY_PROPERTIES'][$propKey]);
}
}
$arResult['SKU_PROPS'] = $arSKUPropList;
$arResult['DEFAULT_PICTURE'] = $arEmptyPreview;
$arResult['wish']['isWished'] = CIBlockElement::GetList(false, array(
示例3: array
$arMatrix[$keyOffer] = $arOneRow;
}
if (-1 == $intSelected) {
$intSelected = 0;
}
$arResult['JS_OFFERS'] = $arMatrix;
$arResult['OFFERS_SELECTED'] = $intSelected;
if ($arMatrix[$intSelected]['SLIDER_COUNT'] > 0) {
$arResult['MORE_PHOTO'] = $arMatrix[$intSelected]['SLIDER'];
$arResult['MORE_PHOTO_COUNT'] = $arMatrix[$intSelected]['SLIDER_COUNT'];
}
$arResult['OFFERS_IBLOCK'] = $arSKU['IBLOCK_ID'];
}
if ($arResult['MODULES']['catalog'] && $arResult['CATALOG']) {
if ($arResult['CATALOG_TYPE'] == CCatalogProduct::TYPE_PRODUCT || $arResult['CATALOG_TYPE'] == CCatalogProduct::TYPE_SET) {
CIBlockPriceTools::setRatioMinPrice($arResult, false);
$arResult['MIN_BASIS_PRICE'] = $arResult['MIN_PRICE'];
}
if (CBXFeatures::IsFeatureEnabled('CatCompleteSet') && $arResult['CATALOG_TYPE'] == CCatalogProduct::TYPE_PRODUCT) {
$rsSets = CCatalogProductSet::getList(array(), array('@OWNER_ID' => $arResult['ID'], '=SET_ID' => 0, '=TYPE' => CCatalogProductSet::TYPE_GROUP), false, false, array('ID', 'OWNER_ID'));
if ($arSet = $rsSets->Fetch()) {
$arResult['OFFER_GROUP'] = true;
}
}
}
if (!empty($arResult['DISPLAY_PROPERTIES'])) {
foreach ($arResult['DISPLAY_PROPERTIES'] as $propKey => $arDispProp) {
if ('F' == $arDispProp['PROPERTY_TYPE']) {
unset($arResult['DISPLAY_PROPERTIES'][$propKey]);
}
}
示例4:
$arItem['MIN_PRICE'] = CIBlockPriceTools::getMinPriceFromOffers(
$arItem['OFFERS'],
$boolConvert ? $arResult['CONVERT_CURRENCY']['CURRENCY_ID'] : $strBaseCurrency
);
}
}
if (
$arResult['MODULES']['catalog']
&& $arItem['CATALOG']
&&
($arItem['CATALOG_TYPE'] == CCatalogProduct::TYPE_PRODUCT
|| $arItem['CATALOG_TYPE'] == CCatalogProduct::TYPE_SET)
)
{
CIBlockPriceTools::setRatioMinPrice($arItem, false);
$arItem['MIN_BASIS_PRICE'] = $arItem['MIN_PRICE'];
}
if (!empty($arItem['DISPLAY_PROPERTIES']))
{
foreach ($arItem['DISPLAY_PROPERTIES'] as $propKey => $arDispProp)
{
if ('F' == $arDispProp['PROPERTY_TYPE'])
unset($arItem['DISPLAY_PROPERTIES'][$propKey]);
}
}
$arItem['LAST_ELEMENT'] = 'N';
$arNewItemsList[$key] = $arItem;
}
$arNewItemsList[$key]['LAST_ELEMENT'] = 'Y';
示例5: getMinPriceFromOffers
public static function getMinPriceFromOffers(&$offers, $currency)
{
$result = false;
$minPrice = 0;
if (!empty($offers) && is_array($offers))
{
$doubles = array();
foreach ($offers as $oneOffer)
{
$oneOffer['ID'] = intval($oneOffer['ID']);
if (isset($doubles[$oneOffer['ID']]))
continue;
if (!$oneOffer['CAN_BUY'])
continue;
CIBlockPriceTools::setRatioMinPrice($oneOffer, true);
$oneOffer['MIN_PRICE']['CATALOG_MEASURE_RATIO'] = $oneOffer['CATALOG_MEASURE_RATIO'];
$oneOffer['MIN_PRICE']['CATALOG_MEASURE'] = $oneOffer['CATALOG_MEASURE'];
$oneOffer['MIN_PRICE']['CATALOG_MEASURE_NAME'] = $oneOffer['CATALOG_MEASURE_NAME'];
$oneOffer['MIN_PRICE']['~CATALOG_MEASURE_NAME'] = $oneOffer['~CATALOG_MEASURE_NAME'];
if (empty($result))
{
$minPrice = ($oneOffer['MIN_PRICE']['CURRENCY'] == $currency
? $oneOffer['MIN_PRICE']['DISCOUNT_VALUE']
: CCurrencyRates::ConvertCurrency($oneOffer['MIN_PRICE']['DISCOUNT_VALUE'], $oneOffer['MIN_PRICE']['CURRENCY'], $currency)
);
$result = $oneOffer['MIN_PRICE'];
}
else
{
$comparePrice = ($oneOffer['MIN_PRICE']['CURRENCY'] == $currency
? $oneOffer['MIN_PRICE']['DISCOUNT_VALUE']
: CCurrencyRates::ConvertCurrency($oneOffer['MIN_PRICE']['DISCOUNT_VALUE'], $oneOffer['MIN_PRICE']['CURRENCY'], $currency)
);
if ($minPrice > $comparePrice)
{
$minPrice = $comparePrice;
$result = $oneOffer['MIN_PRICE'];
}
}
$doubles[$oneOffer['ID']] = true;
}
}
return $result;
}