Автор: alextool
Дата сообщения: 07.07.2015 10:25
LineykaSBK
В хелпе есть отдельная глава по правам доступа!
Вопрос кто сталкивался, ставлю типовый магазин адаптивный шаблон.
Каталог товаров, выводит в публичке цены в РУБ.
Валюта в магазине стоит ГРН.
нужно грн!
если меняю валюту магазина все равно выводит РУБ!
код RESULT_modifer.PHP
<?
if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true)die();
// PRICE
foreach($arResult['ITEMS'] as $k=>$arItem)
{
if($arItem['PROPERTIES']['PRICE']['VALUE'])
{
$arItem['PRICE'] = CPortalTools::FormatCurrency($arItem['PROPERTIES']['PRICE']['VALUE']);
}
// MORE_PHOTO
if($arItem['DETAIL_PICTURE']['ID'])
{
$arItem['PROPERTIES']['MORE_PHOTO']['VALUE'] = array_merge(array($arItem['DETAIL_PICTURE']['ID']), $arItem['PROPERTIES']['MORE_PHOTO']['VALUE']);
}
$arItem['MORE_PHOTO_CNT'] = is_array($arItem['PROPERTIES']['MORE_PHOTO']['VALUE'])?count($arItem['PROPERTIES']['MORE_PHOTO']['VALUE']):0;
if($arItem['MORE_PHOTO_CNT'])
{
foreach($arItem['PROPERTIES']['MORE_PHOTO']['VALUE'] as $ki=>$id)
{
$arFile = CFile::GetFileArray($id);
$arImageResized = CFile::ResizeImageGet($arFile["ID"], Array("width" => 250, "height" => 270), BX_RESIZE_IMAGE_EXACT, true);
$arItem['MORE_PHOTO'][] = array(
'ID'=>$arFile['ID'],
'SRC'=>$arImageResized['src'],
'WIDTH'=>$arImageResized['width'],
'HEIGHT'=>$arImageResized['height'],
);
}
// MORE_PHOTO_PREVIEW
foreach($arItem['MORE_PHOTO'] as $arImage)
{
$arImageResized = CFile::ResizeImageGet($arImage["ID"], Array("width" => 80, "height" => 80), BX_RESIZE_IMAGE_EXACT, true);
$arItem['MORE_PHOTO_PREVIEW'][] = array(
'ID'=>$arImage['ID'],
'SRC'=>$arImageResized['src'],
'WIDTH'=>$arImageResized['width'],
'HEIGHT'=>$arImageResized['height'],
);
}
}
$arItem['STATUS'] = array(
'NEW' => $arItem['PROPERTIES']['NEW']['VALUE']?true:false,
'SALE' => $arItem['PROPERTIES']['SALE']['VALUE']?true:false,
'POPULAR' => $arItem['PROPERTIES']['POPULAR']['VALUE']?true:false,
'RECOMEND' => $arItem['PROPERTIES']['RECOMEND']['VALUE']?true:false,
);
$arResult['ITEMS'][$k] = $arItem;
}
// SECTIONS
$arResult['SECTIONS_EX'] = false;
$arSort = array("SORT"=>"ASC", "NAME"=>"ASC", );
$arFilter = array('IBLOCK_ID'=>$arParams['IBLOCK_ID'], 'GLOBAL_ACTIVE'=>'Y');
$arSelect = array('IBLOCK_ID', 'ID', 'NAME', 'DEPTH_LEVEL', 'IBLOCK_SECTION_ID');
$res = CIBlockSection::GetList($arSort, $arFilter, false, $arSelect, false);
while($arFields = $res->GetNext())
{
if($arFields['DEPTH_LEVEL'] == 1)
{
$arResult['SECTIONS_EX'][] = $arFields;
}
$arResult['SECTIONS_EX_ALL'][] = $arFields;
//print_r($arFields);
}
foreach($arResult['SECTIONS_EX'] as $k=>$arSection)
{
$arSection['CHILDRENS_IDS'] = array();
foreach($arResult['SECTIONS_EX_ALL'] as $arSectionAll)
{
if($arSectionAll['IBLOCK_SECTION_ID'] == $arSection['ID'])
{
$arSection['CHILDRENS_IDS'][] = $arSectionAll['ID'];
}
}
$arResult['SECTIONS_EX'][$k] = $arSection;
}
foreach($arResult['SECTIONS_EX'] as $k=>$arSection)
{
foreach($arResult['ITEMS'] as $arItem)
{
if($arItem['IBLOCK_SECTION_ID'] == $arSection['ID'] || in_array($arItem['IBLOCK_SECTION_ID'], $arSection['CHILDRENS_IDS']))
{
$arSection['ITEMS'][] = $arItem;
}
}
$arSection['ITEMS_CNT'] = is_array($arSection['ITEMS'])?count($arSection['ITEMS']):0;
$arResult['SECTIONS_EX'][$k] = $arSection;
}
?>