I'm new to nopcommerce and I'm considering using it for a projet for a technical books webshop.
There will be sereral hundreds sub-catogories, mainly car brands as first level sub-catogories and car models as second level sub-categories.
What makes sense is to sort by manufacturer, and then by models, on names (without having to input a sort order number corresponding to the alphabetic position).
It seems that by default, nopcomerce sorts categories and sub-categories by sort order and then categoryid, which is not very usefull (that means that you have to create the categories in the same order that you want to display them)
So my question is - would it be possible to have the category name as secondary sort order field when the sort order field is not specified or same for 2 categories ? ; in other terms sorting on sort_order + categoryname
I ended up finding my solution here: https://www.nopcommerce.com/boards/t/5049/helpful-tip-on-re-alphabetizing-categories.aspx
This is a bit more challenging because I have over 1200 categories but with a little excel
SELECT CategoryID, ParentCategoryID, Name, Published, DisplayOrder FROM Nop_Category ORDER BY DisplayOrder
copying the 'parentCategoyID' into excel
then using Concatenation to merge the 'parentcategoryID to the end of 'SELECT CategoryID, Name, ROW_NUMBER() OVER (ORDER BY Name) AS 'RowNumber' FROM Nop_Category WHERE ParentCategoryID='
I was able to run about 1200 queries right away.
this is a round about way but it worked quickly.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.