Answer the question
In order to leave comments, you need to log in
Why might the request not be displayed in the url string?
Good afternoon, there was such a difficulty.
There is such a code
<?
$GLOBALS['arrFilter1'] = array("PROPERTY_YAVLYAETSI_VALUE"=>"новинкой");
$GLOBALS['arrFilter2'] = array("PROPERTY_YAVLYAETSI_VALUE"=>"популярным");
$GLOBALS['arrFilter3'] = array("PROPERTY_YAVLYAETSI_VALUE"=>"акцией");
if ($_GET["sort"] == "price")
{
$arParams["ELEMENT_SORT_FIELD"] = "SCALED_PRICE_1";
}
switch ($_GET["order"]) {
case "new":
$arParams["FILTER_NAME"]= "arrFilter1";
break;
case "hit":
$arParams["FILTER_NAME"]= "arrFilter2";
break;
case "sale":
$arParams["FILTER_NAME"]= "arrFilter3";
break;
case "vozvr":
$arParams["ELEMENT_SORT_ORDER"]= "asc" ;
break;
case "ubiv":
$arParams["ELEMENT_SORT_ORDER"]= "desc" ;
break;
case "popular":
$arParams["ELEMENT_SORT_ORDER"]= "shows" ;
break;
}
?>
<?
if ($_GET["order"]=='new')
{
$href=$APPLICATION->GetCurPageParam("", array("?order"));
}
elseif($_GET["order"]=='')
{
$href=$APPLICATION->GetCurPageParam("order=new");
}
?>
Answer the question
In order to leave comments, you need to log in
Your code has been taken out of context. Most likely, you are still using some component. Displaying a list of products / sections with the ability to sort this list? Most likely this component uses the entry of the selected sort in $_SESSION or cookies and the values are used from there, so you have
but sorting works.
So, $APPLICATION->GetCurPageParam when using it, in theory, should be displayed in the url of the get request, but it is empty there
$APPLICATION->GetCurPageParam("", array("?order"));
<?php
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/prolog_before.php");
/**
* @global CMain $APPLICATION
*/
var_dump($APPLICATION->GetCurPageParam());
var_dump($APPLICATION->GetCurPageParam("", ["?order"]));
var_dump($APPLICATION->GetCurPageParam("", ["order"]));
var_dump($APPLICATION->GetCurPageParam("order=new"));
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/epilog_after.php");
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question