Hi. What version of nopCommerce do you use? In the 3.80 you don't need to change the code, go to the catalog settings and configure an order of sorting options by changing display order.
I'm using 3.8. Can you tell me how to add a value to that list where I want the field to be AvailableEndDateTimeUtc with a title of Course Data? Really need some help.
I found that in 3.8 the "ProductLoadAllPaged" stored procedure orderby default was set at 'position' which ends up being the 'Id' of the product.
I altered the SP to this:
--sorting SET @sql_orderby = '' IF @OrderBy = 5 /* Name: A to Z */ SET @sql_orderby = ' p.[Name] ASC' ELSE IF @OrderBy = 6 /* Name: Z to A */ SET @sql_orderby = ' p.[Name] DESC' ELSE IF @OrderBy = 10 /* Price: Low to High */ SET @sql_orderby = ' p.[Price] ASC' ELSE IF @OrderBy = 11 /* Price: High to Low */ SET @sql_orderby = ' p.[Price] DESC' ELSE IF @OrderBy = 15 /* creation date */ SET @sql_orderby = ' p.[CreatedOnUtc] DESC'
-- added this ELSE IF @OrderBy = 0 /* SKU */ SET @sql_orderby = ' p.[SKU] ASC'
I want to set a different sorting function to product page. On category page I want the products to be sorted by random and in vendor page I want the product to be sorted by newest.
I couldn't understand what I should change in the code in order to do so.. Does anybody know how can I do that?
Thanks in advance!
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.