Page 1 of 1
Changing default sort method
Posted: Tue Mar 25, 2008 5:51 pm
by Brewhaus
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?
Posted: Tue Mar 25, 2008 11:49 pm
by m_plugables
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.
Posted: Thu Mar 27, 2008 6:09 am
by Brewhaus
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.