Product Ordering by Admin Order

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
User avatar
Hostmaster
Commander (CMDR)
Commander (CMDR)
Posts: 126
Joined: Fri Jan 04, 2008 3:30 pm
Location: Melbourne Fl
Contact:

Product Ordering by Admin Order

Post by Hostmaster » Fri Feb 29, 2008 2:01 pm

I had a thread a while back where I was trying to figure out a way to order the products the same way as in the admin area, at least for the default, first view of the page.


I am using the Category Grid Page with Category Data, CategoryGridPage4.ascx

By adding this line

<asp:ListItem Text="Sort" Value="" Selected="True"></asp:ListItem>

Our initial sort order is now the same as in the Admin Area for the categories.

Additionally it seems that for this page at least the Featured Items is not handled so we removed this line.

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

For our Home Page we are still using the FeaturedProductsGrid.

User avatar
mfreeze
Commodore (COMO)
Commodore (COMO)
Posts: 421
Joined: Mon Jan 24, 2005 2:07 pm
Location: Washington, NJ
Contact:

Post by mfreeze » Mon Mar 24, 2008 5:45 am

I am using categorygridpage. Where in the code did you add the line?
Was it in the drop down list definition?
Mary E Freeze

Freeze Frame Graphics
Web Hosting and Design, ASP and CFMX Development

http://www.ffgraphics.com

User avatar
mfreeze
Commodore (COMO)
Commodore (COMO)
Posts: 421
Joined: Mon Jan 24, 2005 2:07 pm
Location: Washington, NJ
Contact:

Post by mfreeze » Mon Mar 24, 2008 5:50 am

Never mind. I figured it out. Thanks.
Mary E Freeze

Freeze Frame Graphics
Web Hosting and Design, ASP and CFMX Development

http://www.ffgraphics.com

User avatar
mfreeze
Commodore (COMO)
Commodore (COMO)
Posts: 421
Joined: Mon Jan 24, 2005 2:07 pm
Location: Washington, NJ
Contact:

Post by mfreeze » Mon Mar 24, 2008 7:55 am

I put this in to categorygridpage.ascx and it didn't seem to work. It changed the sort order from A-Z but did not put it in the same order as in the administration.

Any ideas?
Mary E Freeze

Freeze Frame Graphics
Web Hosting and Design, ASP and CFMX Development

http://www.ffgraphics.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 » Mon Mar 24, 2008 8:01 am

NOt sure, I only tested with CategoryGridPage4.ascx

jdarby
Commander (CMDR)
Commander (CMDR)
Posts: 151
Joined: Thu Sep 25, 2008 2:21 pm

Re: Product Ordering by Admin Order

Post by jdarby » Fri Jul 24, 2009 6:45 am

Mary,

Did you ever figure this one out? I'm using CategoryGrid2.aspx, haven't yet tried to pop this in there to see if it works. I'd really like for the sort order to be the same as it is in the Admin, I always wondered why it isn't that way.

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

Re: Product Ordering by Admin Order

Post by mazhar » Fri Jul 24, 2009 7:05 am

To view the products in exact same order as entered by merchant makes use of CategoryDetails or CategoryList page because they display products from one category.

jdarby
Commander (CMDR)
Commander (CMDR)
Posts: 151
Joined: Thu Sep 25, 2008 2:21 pm

Re: Product Ordering by Admin Order

Post by jdarby » Fri Jul 24, 2009 9:20 am

Just knocked this one out. On CategoryGridPage2, the sort dropdown is what controls the default position of the products when a user first hits the page. The default option on this dropdown was "By Name A-Z". Initially, I thought that changing the default to "By Price Low->High" would fix my problem temporarily...

Then I had my AH HA! moment. I popped a blank item in the first slot of the dropdown with just a text label "Click for options". This causes the dropdown to have no control on the sort order of products. Then, the sort order falls back to the order the products are in in your merchant area so you can sort them with the arrows.

Here is the code I edited in ConLib/CategoryGridPage2.ascx around line 73 for the dropdown menu

Code: Select all

                            <asp:DropDownList ID="SortResults" runat="server" AutoPostBack="true" CssClass="sorting" EnableViewState="false">                            
                                <asp:ListItem Text="Click for options"></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 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:DropDownList>
Hope this helps.

jdarby
Commander (CMDR)
Commander (CMDR)
Posts: 151
Joined: Thu Sep 25, 2008 2:21 pm

Re: Product Ordering by Admin Order

Post by jdarby » Wed Jan 23, 2013 1:13 pm

Not sure which version we were on at the time of my last post, but to get this working in 7.0.7, we need to add a blank value for our "Click for options" selection or else a page error is thrown:

Code: Select all

                    <asp:DropDownList ID="SortResults" runat="server" AutoPostBack="true" CssClass="sorting"
                        OnSelectedIndexChanged="SortResults_SelectedIndexChanged">
                        <asp:ListItem Text="Click for options" Value=""></asp:ListItem>

Post Reply