VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: d0ublezer0 on June 06, 2018, 08:16:30 AM

Title: Sort ordering in search results
Post by: d0ublezer0 on June 06, 2018, 08:16:30 AM
Hello! VM3.2.12
Is it possible to specify how to sort products after the search?
The default sorting for products is set "ordering" in backend.
After performing the search, I get a list of products in a random (for me) order.
I want to sort products by SKU when searching, .
Here is an example of doing a search for article "210":
https://www.zebra-tara.ru/component/virtuemart/?keyword=210&limitstart=0&option=com_virtuemart&view=category&virtuemart_category_id=0 (https://www.zebra-tara.ru/component/virtuemart/?keyword=210&limitstart=0&option=com_virtuemart&view=category&virtuemart_category_id=0)
As you can see, the desired product is at the very bottom of the list.
(https://image.prntscr.com/image/1D3eceyuSWmxp3TFSTH90w.png)

Also, I did not understand how to assign menu items to search results? To avoid such an ugly link...


Title: Re: Sort ordering in search results
Post by: Ghost on June 06, 2018, 08:31:25 AM
Yes, go to VM Configuration -> Product Order Settings.
Title: Re: Sort ordering in search results
Post by: d0ublezer0 on June 06, 2018, 08:44:47 AM
Quote from: Ghost on June 06, 2018, 08:31:25 AM
Yes, go to VM Configuration -> Product Order Settings.
As i already said: The default sorting for products is set "ordering" in backend.
this is correct, because I can arrange the goods in the right order within the same category
Is it possible to set the sort order for the search results? Forced?
Title: Re: Sort ordering in search results
Post by: Ghost on June 06, 2018, 10:12:37 AM
Add this to the form in your search module:

<input type="hidden" name="orderby" value="product_sku"/>