Changing default sort method

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
Brewhaus
Vice Admiral (VADM)
Vice Admiral (VADM)
Posts: 878
Joined: Sat Jan 19, 2008 4:30 pm

Changing default sort method

Post by Brewhaus » Tue Mar 25, 2008 5:51 pm

We would like to change the default sort method for our product pages from alphabetical to 'featured' so that we can sort the products to show the best way. I assumed that this would be handled easily from the admin area, but I do not see any option to change this. Does anyone know how to do this?

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

Post by m_plugables » Tue Mar 25, 2008 11:49 pm

Edit ConLib/SearchPage.ascx file and locate following of code

Code: Select all

<asp:DropDownList ID="SortResults" runat="server" AutoPostBack="true" CssClass="sorting" OnSelectedIndexChanged="SortResults_SelectedIndexChanged" EnableViewState="true">
                            <asp:ListItem Text="Featured" Value="IsFeatured DESC, Name ASC"></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="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>
Now cut the third list item from the dropdownlist.

Code: Select all

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

and paste it above the first item in the dropdownlist code. After this modification your code should look like

Code: Select all

<asp:DropDownList ID="SortResults" runat="server" AutoPostBack="true" CssClass="sorting" OnSelectedIndexChanged="SortResults_SelectedIndexChanged" EnableViewState="true">
                            <asp:ListItem Text="Featured" Value="IsFeatured DESC, Name ASC"></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="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>
Now check the product finder page you will see that the Featured is default option for your sort.

Brewhaus
Vice Admiral (VADM)
Vice Admiral (VADM)
Posts: 878
Joined: Sat Jan 19, 2008 4:30 pm

Post by Brewhaus » Thu Mar 27, 2008 6:09 am

Thank you. I was actually meaning to change the sort method on the Category pages, but that appears to be done the same way- just on a different file.

Post Reply