Developer forum

Forum » Ecommerce - Standard features » Multiple SortBy in list (querystring)

Multiple SortBy in list (querystring)

Jonas Mersholm
Reply

Hi there,

Is it possible to do a secondary sortBy through the query-string on an eCom (index based) productlist?

Best,

Jonas


Replies

 
Steffen Kruse Hansen Dynamicweb Employee
Steffen Kruse Hansen
Reply

Hi Jonas,

If you are running on a 9.2.? version of Dynamicweb, you should be able to get multiple sortBy in the querystring by comma-seperating them.

?sortBy=Name,Price&sortOrder=desc,asc

OR

?sortBy=-Name,Price

Where the '-' means descending

Hope this what you where looking for

Best regards

Steffen

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Steffen,

Is this rule available only for product sorting? Is there anything similar for Query Publisher?

Thanks,

Adrian

 
Steffen Kruse Hansen Dynamicweb Employee
Steffen Kruse Hansen
Reply

Hi Adrian,

This functionality is only implemented in the Product Catalog. As far as I can see in the code, the Query Publisher only supports one "SortBy" parameter.

Best regards

Steffen

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Steffen,

I have tried the above scenario on a QueryPublisher and it seems to only sort by Ascending.

I have this page:http://ttonline.dotfusion.ro/business-directory

And I have tried this URL: http://ttonline.dotfusion.ro/business-directory?SortBy=NameSortable&SortOrder=DESC

This one works: http://ttonline.dotfusion.ro/business-directory?SortBy=NameSortable&SortOrder=ASC 

It works even without the SortOrder parameter.

The index is built with SqlIndexer, the NameSortable is a string field that is not analyzed and I am using 9.2.14

Any ideas?

Thanks,

Adrian

 
Steffen Kruse Hansen Dynamicweb Employee
Steffen Kruse Hansen
Reply

Hi Adrian,

It looks like there are some inconsistency in the naming of the sorting parameters between the product catalog and the QueryPublisher.

In the QueryPublisher, you should use ?SortBy=NameSortable&SortDirection=DESC

And in the Product Catalog, you should use ?SortBy=NameSortable&SortOrder=DESC

I hope this helps 

Best regards

Steffen

 

 
Nicolai Pedersen
Reply

I've just updated the Qp to also support SortOrder parameter, TFS#39114, due with 9.3.2

NP

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Thank you guys.

Adrian

 
Allan Iversen
Allan Iversen
Reply

Hi guys,

We would like you to enable multiple "Sort by" parameters with the Query Publisher - like using the Product Catalog.

Is this possible for you to implement this?

- Allan

 

You must be logged in to post in the forum