Product Variant Sorting

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
13 years ago
I had the same problem. The bug seems to be in the cache logic as mentioned on the last post.
A workaround is to sort the variants list after retrieval. For example, add this in ProductVariantsInGrid.ascx.cs:

productVariants.Sort(delegate(ProductVariant p1, ProductVariant p2) { return p1.DisplayOrder.CompareTo(p2.DisplayOrder); });
13 years ago
Thanx for the answer. It would be gerat if the bug will be solved in a future release.
13 years ago
This issue appears to be solved in the latest release (1.7).
13 years ago
This issue is not sorted in V1.7 sd I have the exact same problem!
13 years ago
hunaid wrote:
Thanks you for your help in this regard.

I have different products with same variant name like

Product 1
  Variant -- > Green
  Variant -- > Blue

Product 2
  Variant -- > Green
  Variant -- > Blue

Any Suggestions ? Cache Key checked and created can cause issue with this ?

Hunaid


I was having a similar issue with products not being sorted properly in the front end. I edited the Nop_ProductLoadAllPaged stored procedure and changed dbo.NOP_getnotnullnotempty(p1.[Name],p.[Name]) END ASC to the following: dbo.NOP_getnotnullnotempty(pv.[DisplayOrder],p.[Name]) END ASC. This will sort your products by product variant display order when "sort by position" is selected in the front end and will default to sorting by product name if a variant does not exist. You might also want to set Cache.ProductManager.CacheEnabled = false.
12 years ago
jsr wrote:
I had the same problem. The bug seems to be in the cache logic as mentioned on the last post.
A workaround is to sort the variants list after retrieval. For example, add this in ProductVariantsInGrid.ascx.cs:

productVariants.Sort(delegate(ProductVariant p1, ProductVariant p2) { return p1.DisplayOrder.CompareTo(p2.DisplayOrder); });


I had the same problem with version 1.8

This line of code have solved the problem. cheers ;)
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.