Skip to content

Instantly share code, notes, and snippets.

@flayder
Created February 1, 2016 17:48
Show Gist options
  • Select an option

  • Save flayder/5df959b9f74dee00dd84 to your computer and use it in GitHub Desktop.

Select an option

Save flayder/5df959b9f74dee00dd84 to your computer and use it in GitHub Desktop.
В section.php добавляем:
<?if ($_GET["sort"] == "name" ||
$_GET["sort"] == "catalog_PRICE_3" ||
$_GET["sort"] == "property_PRODUCT_TYPE" ||
$_GET["sort"] == "timestamp_x"){
$arParams["ELEMENT_SORT_FIELD"] = $_GET["sort"];
$arParams["ELEMENT_SORT_ORDER"] = $_GET["method"];
}else{}?>
В template.php:
<p>Сортировать по:
<a <?if ($_GET["sort"] == "name"):?> class="actived" <?endif;?> href="<?=$arResult["SECTION_PAGE_URL"]?>?sort=name&method=asc">
Названию
</a>
<a <?if ($_GET["sort"] == "catalog_PRICE_3"):?> class="actived" <?endif;?> href="<?=$arResult["SECTION_PAGE_URL"]?>?sort=catalog_PRICE_3&method=asc">
Цене
</a>
<a <?if ($_GET["sort"] == "timestamp_x"):?> class="actived" <?endif;?> href="<?=$arResult["SECTION_PAGE_URL"]?>?sort=timestamp_x&method=desc">
Новые поступления
</a>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment