Page 1 of 1

Product ordering not working as expected

Posted: Fri Jun 13, 2014 2:29 pm
by jeffsodeman
When you go into a category in Admin you can change the order of the products. This custom ordering isn't reflected in the way the products are show on the category grid page. I've tried disabling the sorting UI and related code in the page's code behind, but I'm still not seeing the ordering that we would like.

I would guess there's a way to get this to work, otherwise I don't see why there would even be the Admin-side tools for changing the product ordering. Can someone point me in the right direction?

Re: Product ordering not working as expected

Posted: Sat Jun 14, 2014 4:24 am
by nadeem
I did tested this and the product ordering is working correctly for all category grid display pages. For me, the issue exists in category list page where the ordering is not working as expected when it is changed from the admin. I have reported the issue and will be fixed in next release.
The fix is simple and you can apply it by yourself. Just open Conlib/CategoryListPage.ascx in some editor of your choice, locate the following line:

Code: Select all

<asp:ListItem Text="Featured" Value="IsFeatured ASC"></asp:ListItem>
and replace with:

Code: Select all

<asp:ListItem Text="Featured" Value="IsFeatured ASC, OrderBy ASC, Name ASC"></asp:ListItem>

Re: Product ordering not working as expected

Posted: Sat Jun 14, 2014 9:43 am
by jeffsodeman
So this is what I have in the CategoryGridPage.asc.cs

Code: Select all

protected void BindProductList()
		{
			IList<Product> products = ProductDataSource.AdvancedSearch(_keywords, this._categoryId, _manufacturerId, true, true,
                true, 0, 0, _pageSize, (_hiddenPageIndex * _pageSize), "IsFeatured ASC, OrderBy ASC, Name ASC"); //SortResults.SelectedValue); 
And you can see in the sample images that Bunny Prize is at the end of the page instead of after Beaver 2.

Image

Image



Image

Re: Product ordering not working as expected

Posted: Sun Jun 15, 2014 11:20 pm
by nadeem
Which Ablecommerce build are you using? I am still not able to reproduce the issue in latest Gold R8 build. I suspect the issue might exists in some older releases and been fixed.

Re: Product ordering not working as expected

Posted: Mon Jun 16, 2014 3:01 am
by nadeem
If you have both featured and non-featured products in a category, it will sort and list featured first and then care about the admin sort order. If you want to sort the products by admin sort order by default, you need to add the following line in Conlib/CategoryGridPage.ascx above "Featured" list item

Code: Select all

<asp:ListItem Text="Click for options" Value="OrderBy ASC, Name ASC"></asp:ListItem>
It should work, no need to change your code in CategoryGridPage.ascx.cs.

One thing more, in category grid page the items are listed from all sub categories recursively. when your product is in more than one categories and you are listing products from multiple categories, conflict may occur. For more information read this thread viewtopic.php?f=65&t=17402&p=74701

Re: Product ordering not working as expected

Posted: Mon Jun 16, 2014 6:25 am
by jeffsodeman
Thanks for the help. It's the latest version, and it's not the Featured, I had tried it with that removed.

I suspect it's the multiple categories, each product is in at least 3 like Gender, Length, Style. I'll see if the shallow option will work for us.