Page 1 of 1

Manual Sort Category not working on CategoryGridPage.ascx

Posted: Thu Nov 06, 2008 4:44 pm
by Loly19
Hello

I am attempting to manually sort products and have been unable to do so.

I've tried the following methods so far.

Code: Select all

<asp:Label ID="SortResultsLabel" runat="server" Text="Sort:" SkinID="FieldHeader"></asp:Label>&nbsp;
<asp:DropDownList ID="SortResults" runat="server" AutoPostBack="true" CssClass="sorting" OnSelectedIndexChanged="SortResults_SelectedIndexChanged">
<asp:ListItem Text="<Select Sort>" Value="" Selected="True"></asp:ListItem>
<asp:ListItem Text="By Name (A -> Z)" Value="Name ASC"></asp:ListItem>
<asp:ListItem Text="By Name (Z -> A)" Value="Name DESC"></asp:ListItem>
<asp:ListItem Text="Featured" Value="IsFeatured DESC, Name ASC"></asp:ListItem>
<asp:ListItem Text="By Price (Low to High)" Value="Price ASC"></asp:ListItem>
<asp:ListItem Text="By Price (High to Low)" Value="Price DESC"></asp:ListItem>                            
<asp:ListItem Text="By Manufacturer (A -> Z)" Value="Manufacturer ASC"></asp:ListItem>
<asp:ListItem Text="By Manufacturer (Z -> A)" Value="Manufacturer DESC"></asp:ListItem>
</asp:DropDownList>
As well as :

Code: Select all

//SORT THE CATEGORIES ACCORDINGLY
// jme 050608 string sortExpression = SortResults.SelectedValue;
string sortExpression = String.Empty;
However I was unsure where to put the above code I could not find "string sortExpression" anywhere in the .cs file for CategoryGridPage

Any help would be appreciated
Lori

Re: Manual Sort Category not working on CategoryGridPage.ascx

Posted: Thu Nov 06, 2008 6:32 pm
by jmestep
What category page are you using?

Re: Manual Sort Category not working on CategoryGridPage.ascx

Posted: Fri Nov 07, 2008 7:55 am
by mazhar
However I was unsure where to put the above code I could not find "string sortExpression" anywhere in the .cs file for CategoryGridPage
You can pass empty string in the following code in CategoryGridPage.ascx.cs file as below

Code: Select all

ProductList.DataSource = ProductDataSource.NarrowSearch(_Keywords, this.CategoryId, _ManufacturerId, 0, 0, _PageSize, (_HiddenPageIndex * _PageSize), string.Empty);

Re: Manual Sort Category not working on CategoryGridPage.ascx

Posted: Fri Nov 07, 2008 8:55 am
by Loly19
Thanks for the replies

However, the products are still not showing up in the order I've sorted them in the admin.

here is one of the pages in question http://216.139.232.83/Womens-C7.aspx

using a modified version of CategoryGridPage

They are not in alpha order now so I am not sure what it is using to sort, but it is definitely not the order I set up in admin.

Thanks very much,
Lori

Re: Manual Sort Category not working on CategoryGridPage.ascx

Posted: Tue Nov 11, 2008 12:59 pm
by Loly19
This is still not working, any additional help would be great, thank you

Re: Manual Sort Category not working on CategoryGridPage.ascx

Posted: Tue Nov 11, 2008 3:30 pm
by jmestep
This might be the problem:
using a modified version of CategoryGridPage
Can you try the suggestions on the original CategoryGridPage?

Re: Manual Sort Category not working on CategoryGridPage.ascx

Posted: Thu Nov 13, 2008 6:11 am
by mazhar
You are right the NarrowSearch doesn't seems to care the catalog order. In fact the solution posted by me works for the order in which products were entered. If you manually adjust the product order in catalog and then pass an empty sort expression it brings the product in the order in which they were originally entered in the database. In order to support the catalog order with manual adjustments these methods should support some way to sort the results with OrderBy field of the ac_CatalogNodes table. I have created a bug entry for this.