Manual Sort Category not working on CategoryGridPage.ascx

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
Loly19
Ensign (ENS)
Ensign (ENS)
Posts: 7
Joined: Fri Aug 15, 2008 3:12 am

Manual Sort Category not working on CategoryGridPage.ascx

Post by Loly19 » Thu Nov 06, 2008 4:44 pm

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

User avatar
jmestep
AbleCommerce Angel
Posts: 8164
Joined: Sun Feb 29, 2004 8:04 pm
Location: Dayton, OH
Contact:

Re: Manual Sort Category not working on CategoryGridPage.ascx

Post by jmestep » Thu Nov 06, 2008 6:32 pm

What category page are you using?
Judy Estep
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Manual Sort Category not working on CategoryGridPage.ascx

Post by mazhar » Fri Nov 07, 2008 7:55 am

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);

Loly19
Ensign (ENS)
Ensign (ENS)
Posts: 7
Joined: Fri Aug 15, 2008 3:12 am

Re: Manual Sort Category not working on CategoryGridPage.ascx

Post by Loly19 » Fri Nov 07, 2008 8:55 am

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

Loly19
Ensign (ENS)
Ensign (ENS)
Posts: 7
Joined: Fri Aug 15, 2008 3:12 am

Re: Manual Sort Category not working on CategoryGridPage.ascx

Post by Loly19 » Tue Nov 11, 2008 12:59 pm

This is still not working, any additional help would be great, thank you

User avatar
jmestep
AbleCommerce Angel
Posts: 8164
Joined: Sun Feb 29, 2004 8:04 pm
Location: Dayton, OH
Contact:

Re: Manual Sort Category not working on CategoryGridPage.ascx

Post by jmestep » Tue Nov 11, 2008 3:30 pm

This might be the problem:
using a modified version of CategoryGridPage
Can you try the suggestions on the original CategoryGridPage?
Judy Estep
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Manual Sort Category not working on CategoryGridPage.ascx

Post by mazhar » Thu Nov 13, 2008 6:11 am

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.

Post Reply