Код |
---|
<?if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true)die();?> <div class="catalog_section"> <?if($arParams["DISPLAY_TOP_PAGER"]):?> <?=$arResult["NAV_STRING"]?> <?endif;?> <div class="table_catalog_section"> <? $i=0; foreach($arResult["ITEMS"] as $cell=>$arElement): $path=fn_get_chainpath($arElement["IBLOCK_ID"], $arElement["~IBLOCK_SECTION_ID"]); $arElement["DETAIL_PAGE_URL"]=$path.$arElement["CODE"].".html"; $i++; if ($i==1) { $arIBlock=GetIBlock($arElement["IBLOCK_ID"]); if ((preg_match('#'.$arIBlock['LIST_PAGE_URL'].'#',$APPLICATION->GetCurDir())) && (!preg_match('#^/store/brands#',$APPLICATION->GetCurDir())) && (!preg_match('#^/store/news#',$APPLICATION->GetCurDir())) && (!preg_match('#\.html#',$_SERVER['REQUEST_URI']))) { fn_set_iblocknavchain($arIBlock["ID"],$arResult["IBLOCK_TYPE_ID"],$arElement["IBLOCK_SECTION_ID"]); } } ?> <?if($cell%$arParams["LINE_ELEMENT_COUNT"] == 0):?> <?endif;?> <div class="catalog_section_item"> <div class="tovar_sravnit"> <?if($arParams["DISPLAY_COMPARE"]):?> <fo rm action="<?=POST_FORM_ACTION_URI?>" method="post" enctype="multipart/form-data"> <div class="checkbox"></div> <div class="sravnit"><a href="jav * ascript:void(0)" onc lick="GetPage_compare(<?=$arElement["ID"]?>);">Сравнить</a></div> <div class="clear"> </div> </form> <?endif?> </div> <div class="picture_razm"> <?if (is_array($arElement["PREVIEW_PICTURE"])):?> <table class="tovar_picture" valign="top" height="150" width="150" cellpadding="0" cellspacing="0" border="0"><tr><td align="center" valign="middle"><a href="<?=$arElement["DETAIL_PAGE_URL"]?>"><img border="0" src="<?=$arElement["PREVIEW_PICTURE"]["SRC"]?>" width="<?=$arElement["PREVIEW_PICTURE"]["WIDTH"]?>" height="<?=$arElement["PREVIEW_PICTURE"]["HEIGHT"]?>" alt="<?=$arElement["NAME"]?>" title="<?=$arElement["NAME"]?>" /></a></td></tr></table> <?endif;?> </div> <div class="tovar_name"><a href="<?=$arElement["DETAIL_PAGE_URL"]?>"><?=$arElement["NAME"]?></a></div> <div class="tovar_price"> <?foreach($arElement["PRICES"] as $code=>$arPrice):?> <?if($arPrice["CAN_ACCESS"]):?> <span class="pp">Цена: </span><b> <?if($arPrice["DISCOUNT_VALUE"] < $arPrice["VALUE"]):?> <s><?=$arPrice["PRINT_VALUE"]?></s> <span class="catalog_price"><?=$arPrice["PRINT_DISCOUNT_VALUE"]?></span>   |
Код |
---|
<? $GLOBALS['arrBestProdFilter']=array('PROPERTY_best_prod_VALUE'=>'да'); ?> <?$APPLICATION->IncludeComponent( "bitrix:catalog.section", "cat_main", Array( "IBLOCK_TYPE" => "xmlcatalog", "IBLOCK_ID" => "1", "SECTION_ID" => "", "SECTION_CODE" => "", "SECTION_USER_FIELDS" => array(0=>"",1=>"",), "ELEMENT_SORT_FIELD" => "sort", "ELEMENT_SORT_ORDER" => "asc", "FILTER_NAME" => "arrBestProdFilter", "INCLUDE_SUBSECTIONS" => "Y", "SHOW_ALL_WO_SECTION" => "Y", "PAGE_ELEMENT_COUNT" => "12", "LINE_ELEMENT_COUNT" => "2", "PROPERTY_CODE" => array(0=>"",1=>"polnoe_naimenovanie",2=>$arProperies,3=>"",), "SECTION_URL" => "", "DETAIL_URL" => "", "BASKET_URL" => "/personal/basket.php", "ACTION_VARIABLE" => "action", "PRODUCT_ID_VARIABLE" => "id", "PRODUCT_QUANTITY_VARIABLE" => "quantity", "PRODUCT_PROPS_VARIABLE" => "prop", "SECTION_ID_VARIABLE" => "SECTION_ID", "AJAX_MODE" => "N", "AJAX_OPTION_SHADOW" => "Y", "AJAX_OPTION_JUMP" => "N", "AJAX_OPTION_STYLE" => "Y", "AJAX_OPTION_HISTORY" => "N", "CACHE_TYPE" => "A", "CACHE_TIME" => "3600", "CACHE_GROUPS" => "Y", "META_KEYWORDS" => "-", "META_DESCRIPTION" => "-", "BROWSER_TITLE" => "-", "ADD_SECTIONS_CHAIN" => "N", "DISPLAY_COMPARE" => "Y", "SET_TITLE" => "N", "SET_STATUS_404" => "N", "CACHE_FILTER" => "N", "PRICE_CODE" => array(0=>"Розничная",), "USE_PRICE_COUNT" => "N", "SHOW_PRICE_COUNT" => "1", "PRICE_VAT_INCLUDE" => "Y", "PRODUCT_PROPERTIES" => array(), "USE_PRODUCT_QUANTITY" => "N", "DISPLAY_TOP_PAGER" => "N", "DISPLAY_BOTTOM_PAGER" => "N", "PAGER_TITLE" => "Товары", "PAGER_SHOW_ALWAYS" => "N", "PAGER_TEMPLATE" => "", "PAGER_DESC_NUMBERING" => "N", "PAGER_DESC_NUMBERING_CACHE_TIME" => "36000", "PAGER_SHOW_ALL" => "N", "AJAX_OPTION_ADDITIONAL" => "" ) );?></div> |
Код |
---|
$arrFilter=Array(); foreach($_REQUEST as $key => $value) { $arMatch=array(); if (preg_match('#property_(\d+)#',$key,$arMatch)) { $db_enum_list = CIBlockProperty::GetPropertyEnum($arMatch[1], Array(), Array("IBLOCK_ID"=>1, "ID"=>$value)); if($ar_enum_list = $db_enum_list->GetNext()) { $arrFilter['PROPERTY_'.$arMatch[1].'_VALUE']=$ar_enum_list['VALUE']; } } } if (intval($_REQUEST['costmin'])>0) { $arrFilter['>=CATALOG_PRICE_3']=intval($_REQUEST['costmin']); } if (intval($_REQUEST['costmax'])>0) { $arrFilter['<=CATALOG_PRICE_3']=intval($_REQUEST['costmax']); } $current_order_type='cost'; if (strlen($_COOKIE['order_type_cookie'])>0) { $current_order_type=$_COOKIE['order_type_cookie']; } if (strlen($_REQUEST['order_type'])>0) { $current_order_type=$_REQUEST['order_type']; } switch ($current_order_type) { case 'cost' : $arSort["SORT_FIELD"]='CATALOG_PRICE_3'; break; case 'brand' : $arSort["SORT_FIELD"]='propertysort_13'; break; default: $arSort["SORT_FIELD"]='NAME'; } ?> <? $res_properties = CIBlockProperty::GetList(Array("sort"=>"asc"), Array("ACTIVE"=>"Y", "IBLOCK_ID"=>$arIBlock["ID"])); $arProperies=array(); while($arProp=$res_properties->GetNext()) { if (($arProp["SORT"]!=5000)) { if (preg_match('#!#',$arProp['NAME'])==0) { $arProperies[]=$arProp["CODE"]; } } } ?> <?$APPLICATION->IncludeComponent( "bitrix:catalog.section", "cat_main", Array( "IBLOCK_TYPE" => "xmlcatalog", "IBLOCK_ID" => "15", "SECTION_ID" => $arSection["ID"], "SECTION_CODE" => "", "SECTION_USER_FIELDS" => array(0=>"",1=>"",), "ELEMENT_SORT_FIELD" => $arSort["SORT_FIELD"], "ELEMENT_SORT_ORDER" => "asc", "FILTER_NAME" => "arrFilter", "INCLUDE_SUBSECTIONS" => "Y", "SHOW_ALL_WO_SECTION" => "Y", "PAGE_ELEMENT_COUNT" => $element_count, "LINE_ELEMENT_COUNT" => "3", "PROPERTY_CODE" => array(0=>"",1=>"vendor_code",), "SECTION_URL" => "", "DETAIL_URL" => "", "BASKET_URL" => "/personal/basket.php", "ACTION_VARIABLE" => "action", "PRODUCT_ID_VARIABLE" => "id", "PRODUCT_QUANTITY_VARIABLE" => "quantity", "PRODUCT_PROPS_VARIABLE" => "prop", "SECTION_ID_VARIABLE" => "SECTION_ID", "AJAX_MODE" => "N", "AJAX_OPTION_SHADOW" => "Y", "AJAX_OPTION_JUMP" => "Y", "AJAX_OPTION_STYLE" => "Y", "AJAX_OPTION_HISTORY" => "N", "CACHE_TYPE" => "A", "CACHE_TIME" => "3600", "CACHE_GROUPS" => "Y", "META_KEYWORDS" => "-", "META_DESCRIPTION" => "-", "BROWSER_TITLE" => "-", "ADD_SECTIONS_CHAIN" => "N", "DISPLAY_COMPARE" => "Y", "SET_TITLE" => "N", "SET_STATUS_404" => "N", "CACHE_FILTER" => "N", "PRICE_CODE" => array(0=>"RETAIL",), "USE_PRICE_COUNT" => "N", "SHOW_PRICE_COUNT" => "1", "PRICE_VAT_INCLUDE" => "Y", "PRODUCT_PROPERTIES" => array(), "USE_PRODUCT_QUANTITY" => "N", "DISPLAY_TOP_PAGER" => "Y", "DISPLAY_BOTTOM_PAGER" => "Y", "PAGER_TITLE" => "Страницы", "PAGER_SHOW_ALWAYS" => "Y", "PAGER_TEMPLATE" => "", "PAGER_DESC_NUMBERING" => "N", "PAGER_DESC_NUMBERING_CACHE_TIME" => "36000", "PAGER_SHOW_ALL" => "N", "AJAX_OPTION_ADDITIONAL" => "" |