Remove alphabetical ordering in category list

Store UI, layout, design, look and feel; Discussion on the customer facing pages of your online store. Cascading Style Sheets, Themes, Scriptlets, NVelocity and the components in the ConLib directory.
Post Reply
User avatar
tonz
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 48
Joined: Thu Mar 13, 2008 4:08 am

Remove alphabetical ordering in category list

Post by tonz » Tue Apr 01, 2008 9:44 am

I would like to customize category list page so that products appear in the order which they are in Browse Catalog and not the alphabetical order. Anyone any idea? thanks in advance

User avatar
m_plugables
Commander (CMDR)
Commander (CMDR)
Posts: 149
Joined: Tue Mar 11, 2008 12:44 am
Contact:

Re: Remove alphabetical ordering in category list

Post by m_plugables » Mon Apr 07, 2008 3:34 am

Locate the following line of code

Code: Select all

string sortExpression = SortResults.SelectedValue;
You can change the sort order and make it like in the Browse Catalog page. For this just make the above line of code look like

Code: Select all

string sortExpression = String.Empty;
means pass an empty string int sort expression parameter then it will display the catalog items without sorting.
Image
Visit the links below to Download Plugins for your AC7 Store
http://www.plugables.com
http://blog.plugables.com

User avatar
m_plugables
Commander (CMDR)
Commander (CMDR)
Posts: 149
Joined: Tue Mar 11, 2008 12:44 am
Contact:

Re: Remove alphabetical ordering in category list

Post by m_plugables » Mon Apr 07, 2008 3:45 am

Well although the above code works but a much better solution is to modify the sorting options drop down list. You can use the code below instead of the above code for the same task

Edit the ConLib/CategoryListPage.ascx file and locate the following line of code

Code: Select all

<asp:ListItem Text="By Name (A -> Z)" Value="Name ASC"></asp:ListItem>

and put the following line of code just above it.

Code: Select all

<asp:ListItem Text="<Select Sort>" Value="" Selected="True"></asp:ListItem>
It will make an extra option available in the sort options list. Use this option to keep the result order same as in the Browse Catalog.
Image
Visit the links below to Download Plugins for your AC7 Store
http://www.plugables.com
http://blog.plugables.com

User avatar
tonz
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 48
Joined: Thu Mar 13, 2008 4:08 am

Re: Remove alphabetical ordering in category list

Post by tonz » Tue Apr 08, 2008 3:07 am

Thanks a lot! Worked great! Our company doesn't have that many products, so the sort header was not even necessary. So I made the changes you suggested, and then I made the sort header disappear from css. Thanks again for sharing your knowledge.

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

Re: Remove alphabetical ordering in category list

Post by jmestep » Fri Jun 06, 2008 12:24 pm

I had to change from the first method to this:
<asp:ListItem Text="<Select Sort>" Value="" Selected="True"></asp:ListItem>

When I used string sortExpression = String.Empty; it retained the catalog order of the products, but the sorting selections didn't work.
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
jmestep
AbleCommerce Angel
Posts: 8164
Joined: Sun Feb 29, 2004 8:04 pm
Location: Dayton, OH
Contact:

Re: Remove alphabetical ordering in category list

Post by jmestep » Sun Jun 29, 2008 1:24 pm

I had to switch to using the CategoryGridPage.ascx in order to get the "C" out of my product links on that page . ( It was easier than working with the CategoryGridpage4.ascx).
Anyway, neither of the above codes work on that page. I think this code sets the sort value when the page loads, but I can't figure out how to change it:
ProductList.DataSource = ProductDataSource.NarrowSearch(_Keywords, this.CategoryId, _ManufacturerId, 0, 0, _PageSize, (_HiddenPageIndex * _PageSize), SortResults.SelectedValue);
I think I need to put something else for SortResults.SelectedValue, but I'm not sure what. I tried "" and nothing changed.
Anyone know?
Thanks
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

Post Reply