i have not been able to figure out a way to put the items in my store in alphabeticial order I have tried to change the display order from 1 being A and up put that did not change it. How can I make this happen?
EXCELLENT! This is exactly what I was looking for. I have been struggling with this for a while, and Mikes steps work perfectly for my situation. Thanks Mike!
Here's what I did, and it seems like it's working.
Stored Procedure Name: Nop_ProductLoadAllPaged
Changes: Original lines are commented out, new lines are in bold.
--display order CREATE TABLE #DisplayOrder ( ProductID int not null PRIMARY KEY, DisplayOrder int not null )
IF @CategoryID IS NOT NULL AND @CategoryID > 0 BEGIN INSERT #DisplayOrder SELECT p.ProductID, row_number() OVER (ORDER BY p.Name) FROM [Nop_Product_Category_Mapping] pcm INNER JOIN [Nop_Product] p ON pcm.ProductID = p.ProductID WHERE pcm.CategoryID = @CategoryID --SELECT pcm.ProductID, pcm.DisplayOrder --FROM [Nop_Product_Category_Mapping] pcm WHERE pcm.CategoryID = @CategoryID END ELSE IF @ManufacturerID IS NOT NULL AND @ManufacturerID > 0 BEGIN INSERT #DisplayOrder SELECT pmm.ProductID, row_number() OVER (ORDER BY p.Name) FROM [Nop_Product_Manufacturer_Mapping] pmm INNER JOIN [Nop_Product] p ON pmm.ProductID = p.ProductID WHERE pmm.ManufacturerID = @ManufacturerID --SELECT pmm.ProductID, pmm.Displayorder --FROM [Nop_Product_Manufacturer_Mapping] pmm WHERE pmm.ManufacturerID = @ManufacturerID END ELSE BEGIN INSERT #DisplayOrder SELECT p.ProductID, row_number() OVER (ORDER BY p.[Name]) --SELECT p.ProductID, 1 FROM [Nop_Product] p --ORDER BY p.[Name] END
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.