How to change default sort order for the category page?

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
User avatar
AbleMods
Master Yoda
Master Yoda
Posts: 5170
Joined: Wed Sep 26, 2007 5:47 am
Location: Fort Myers, Florida USA

How to change default sort order for the category page?

Post by AbleMods » Wed Nov 21, 2007 11:25 pm

Currently the default sort order for the category page is Name A->Z. Is there a way to change it's default be by price or one of the other options?

I found where it's doing it in the code, but I don't read C-Sharp well enough to understand how to change it.
Joe Payne
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com

User avatar
sohaib
Developer
Developer
Posts: 1079
Joined: Fri Jan 23, 2004 1:38 am

Post by sohaib » Thu Nov 22, 2007 1:06 am

This is pretty simple if all you want is that default sort order is by price.

Change this

Code: Select all

<asp:ListItem Text="By Price (Low to High)" Value="Price ASC"></asp:ListItem>
to this

Code: Select all

<asp:ListItem Text="By Price (Low to High)" Value="Price ASC" Selected="True"></asp:ListItem>
in the display page you are using for displaying the category

User avatar
AbleMods
Master Yoda
Master Yoda
Posts: 5170
Joined: Wed Sep 26, 2007 5:47 am
Location: Fort Myers, Florida USA

Post by AbleMods » Thu Nov 22, 2007 7:48 am

Ok, I'll give it a try - thanks for the tip.

In looking at the code-behind, it appears there is support for a parameter "s" to dictate the initial sortorder value with the tempSort variable.

Code: Select all

       //INITIALIZE SEARCH CRITERIA ON FIRST VISIT
            HiddenPageIndex.Value = Request.QueryString["p"];
            string tempSort = Request.QueryString["s"];
            
            if (!string.IsNullOrEmpty(tempSort))
            {
                ListItem item = SortResults.Items.FindByValue(tempSort);
                if (item != null) item.Selected = true;
            }

Is this an undocumented feature? Or am I not getting as good as I thought at reading C-Sharp?

Could we get it added as a parameter to the ConLib control at some point?
Joe Payne
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com

User avatar
AbleMods
Master Yoda
Master Yoda
Posts: 5170
Joined: Wed Sep 26, 2007 5:47 am
Location: Fort Myers, Florida USA

Post by AbleMods » Thu Nov 22, 2007 7:51 am

Works nicely, thank you.
Joe Payne
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com

User avatar
Hostmaster
Commander (CMDR)
Commander (CMDR)
Posts: 126
Joined: Fri Jan 04, 2008 3:30 pm
Location: Melbourne Fl
Contact:

Post by Hostmaster » Tue Feb 19, 2008 7:53 am

If the Default order on the Client Side is A>Z what is the Purpose of the Green up and down arrows on Admin side as well as the Sort Category Feature(button) at the bottom.

We would like our product to display in the same order as we Sort them using the Admin Features ( Sort Category, and green arrows) the on at top being firsts on the page for the client to see.

Any Ideas, or am I just missing something in front of my nose again ?

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

Post by jmestep » Tue Feb 19, 2008 8:01 am

I'm not sure of Able's reasoning, but I have know merchants who want it sorted differently in the admin. On the category page, the customer gets the choice how how they want it.
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
Hostmaster
Commander (CMDR)
Commander (CMDR)
Posts: 126
Joined: Fri Jan 04, 2008 3:30 pm
Location: Melbourne Fl
Contact:

Post by Hostmaster » Tue Feb 19, 2008 8:09 am

yes I like the fact that the customer gets the choice how how they want it. What we would like to decide on is the first time the customer sees the page.

There is the featured product choice , but we are utilizing that for Home page products. That is also another sort question, how to order the feature product, both within the category and on other pages like the home page.

User avatar
AbleMods
Master Yoda
Master Yoda
Posts: 5170
Joined: Wed Sep 26, 2007 5:47 am
Location: Fort Myers, Florida USA

Post by AbleMods » Tue Feb 19, 2008 8:11 am

Yeah, never made sense to me either. Almost like they were two different projects.

I enjoy the customer having the ability to sort the list, but the list should be defaulting to whatever is set in Admin so the experience can be better controlled.

What it really needs is an admin option by category to disable/enable visitor-side sorting for that category. That way the entire visitor experience can be controlled by the site admin.
Joe Payne
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com

User avatar
Hostmaster
Commander (CMDR)
Commander (CMDR)
Posts: 126
Joined: Fri Jan 04, 2008 3:30 pm
Location: Melbourne Fl
Contact:

Post by Hostmaster » Tue Feb 19, 2008 8:17 am

AS well as an Admin Section for sorting Featured Products, additionally, I think a Home page Product Check box and content page should be added. This would allow to have featured products in each category as well as allowing the Admin to quickly decide which product(s) will be on the home page.

We created a SpecialProductDisplay viewtopic.php?t=6452 That with more Work could be used to replace the Featured Product list on the home page, or any page, But the ability would be nice if built in and more idiot proof as well as the sorting feature which is absolutely needed.

Post Reply