Manufacturer drop down list
Manufacturer drop down list
Good morning,
I have looked around and found a little about shopping by manufacturer on the old Able platform, but nothing pertaining to Gold. Is this something anyone has done and if so could you explain the steps to make it happen. Any help would be greatly appreciated.
Thanks!
David
I have looked around and found a little about shopping by manufacturer on the old Able platform, but nothing pertaining to Gold. Is this something anyone has done and if so could you explain the steps to make it happen. Any help would be greatly appreciated.
Thanks!
David
Re: Manufacturer drop down list
David, the default Able Gold search page has a sidebar that automatically provides a filter by manufacturer. This would permit your shoppers to easily shop your entire store by manufacturer.
Simply navigate your browser to /search.aspx and you should see the default search page with the sidebar filter choices.
Simply navigate your browser to /search.aspx and you should see the default search page with the sidebar filter choices.
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
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
Re: Manufacturer drop down list
Thanks for the reply. I know that the side search works and I think it's sufficient, but we are in the testing phase and everyone we have shown the site thinks it's great, but says it needs a manufacturer drop down menu. We are in golf retail and the other sites have that option so maybe that is why they think we need it. I am still working on loading products and tweaking the functionality of the site ( the top category menu is not fully coded yet), but you can see it at: http://216.54.71.17 for a reference.
Thanks again..we are just looking to make anything easier for the customer.
Thanks again..we are just looking to make anything easier for the customer.
Last edited by webbspot on Sat Dec 21, 2013 10:05 am, edited 1 time in total.
- jmestep
- AbleCommerce Angel
- Posts: 8164
- Joined: Sun Feb 29, 2004 8:04 pm
- Location: Dayton, OH
- Contact:
Re: Manufacturer drop down list
You might want to alter the link above (216..) so that it is text instead of a link. Search engines have a way of picking up urls for development sites and then we have seen development sites actually receive orders.
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
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
Re: Manufacturer drop down list
Thanks for the tip...still hoping someone can help me out on the drop down list. Have a good day!
- jmestep
- AbleCommerce Angel
- Posts: 8164
- Joined: Sun Feb 29, 2004 8:04 pm
- Location: Dayton, OH
- Contact:
Re: Manufacturer drop down list
You could probably take the code for the manufacturer dropdown from the edit product page in the admin. Then add code to send the customer somewhere after he selects a manufacturer. Able doesn't have a shop by manufacturer landing page, but you can send the customer to search.aspx?m=xx where xx is the id of the manufacturer.
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
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
Re: Manufacturer drop down list
David do you still need to have the search sidebar manufacturer list render as a dropdown instead of hyperlinks?
I have a working solution for it that I can post here if you still need it.
I have a working solution for it that I can post here if you still need 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
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
Re: Manufacturer drop down list
That would be awesome if you have the code to do that. For the time being I have just hard coded a drop down list in the control and have to manually update it. Thanks so much for your reply and I look forward to seeing the code.
Thanks again.
Thanks again.
Re: Manufacturer drop down list
ok, the following changes must be made in the /conlib/CategorySearchSidebar.ascx and .ascx.cs files.
Let's start with the ASCX file. Find this section of code that defines the manufacturer filtering panel:
Comment out the whole thing. You can do this easily by putting <%-- before the <asp:Panel> tag and put --%> after the </asp:Panel> closing tag.
What we've done is comment out the old way of rendering the manufacturers. Now we need to add a control to represent the new dropdown list we want to see on this page.
Immediately below the code you commented out above, add this code:
Now that we've hidden these controls and added our replacement control, the .cs code behind file is going to have some complaints. There will be references to objects that no longer exist in the page. So we have to find that code and comment it out as well.
Edit the /conlib/CategorySearchSidebar.ascx.cs file and find this code in the Page_Init() method:
Comment it out. Just add // to the beginning of each line.
Now find this code in the BindNarrowByManufacturerPanel() method:
Comment out all of those lines using the same // at the beginning of each line as before.
Now, we've commented out the page's ability to populate the manufacturer links the way it was designed. We need to replace this behavior with our own way of populating the dropdown control. Immediately below the code you just commented out, add this new code:
Our new code will build a nice list of manufacturers into the dropdown. But, there's a problem. There's nothing so far that tells the page what to do when the dropdown's selected item is changed. In other words, changing the dropdown to a different manufacturer won't do anything yet. We need to add an event to the code to process a dropdown selection change.
Find the ManufacturerList_ItemCreated() method in the code. Add this code as a new method immediately before the ItemCreated() method:
Finally, comment out the whole ManufacturerList_ItemCreated() method, we don't need it any more.
At this point, we've eliminated the old controls and code for rendering manufacturer choices. We've added a new control and the necessary code in the backend to handle the selection changes. Give it a try and see how it works for you. Good luck! 
Let's start with the ASCX file. Find this section of code that defines the manufacturer filtering panel:
Code: Select all
<asp:Panel ID="NarrowByManufacturerPanel" runat="server" CssClass="criteriaPanel">
<h3 class="searchCriteria">Narrow by Manufacturer</h3>
<asp:DataList ID="ManufacturerList" runat="server" DataKeyField="ManufacturerId" OnItemCreated="ManufacturerList_ItemCreated" EnableViewState="false">
<ItemTemplate>
<asp:HyperLink ID="NarrowByManufacturerLink" runat="server" CssClass="searchCriteria">
<span class="itemName"><%# Eval("Name")%></span>
<span class="count">(<%#Eval("ProductCount")%>)</span>
</asp:HyperLink>
</ItemTemplate>
</asp:DataList>
<asp:LinkButton ID="ShowAllManufacturers" runat="server" Text="See All »" CssClass="showAll" EnableViewState="false"></asp:LinkButton>
</asp:Panel>
What we've done is comment out the old way of rendering the manufacturers. Now we need to add a control to represent the new dropdown list we want to see on this page.
Immediately below the code you commented out above, add this code:
Code: Select all
<asp:DropDownList runat="server" ID="list_Manufacturers" OnSelectedIndexChanged="list_Manufacturers_OnSelectedIndexChanged" AutoPostBack="True"/>
Edit the /conlib/CategorySearchSidebar.ascx.cs file and find this code in the Page_Init() method:
Code: Select all
if (eventTarget.StartsWith(ShowAllManufacturers.UniqueID))
{
ShowAllManufacturers.Visible = false;
}
Now find this code in the BindNarrowByManufacturerPanel() method:
Code: Select all
if (!ExpandManufacturerLink.Visible)
{
NarrowByManufacturerPanel.Visible = true;
if (_manufacturers.Count > _MaximumManufacturers)
{
if (ShowAllManufacturers.Visible)
{
int count = _manufacturers.Count - _MaximumManufacturers;
for (int i = 0; i < count; i++)
{
if (_manufacturers.Count > _MaximumManufacturers)
_manufacturers.RemoveAt(_MaximumManufacturers);
}
}
}
else ShowAllManufacturers.Visible = false;
ManufacturerList.DataSource = _manufacturers;
ManufacturerList.DataBind();
NarrowByManufacturerPanel.Visible = (ManufacturerList.Items.Count > 0);
}
else NarrowByManufacturerPanel.Visible = false;
Now, we've commented out the page's ability to populate the manufacturer links the way it was designed. We need to replace this behavior with our own way of populating the dropdown control. Immediately below the code you just commented out, add this new code:
Code: Select all
// populate the manufacturer dropdown list
list_Manufacturers.Items.Add(new ListItem("- choose -"));
foreach (ManufacturerProductCount mfpc in _manufacturers)
{
ListItem item = new ListItem(mfpc.Name + " (" + mfpc.ProductCount.ToString() + ")", mfpc.ManufacturerId.ToString());
list_Manufacturers.Items.Add(item);
}
Find the ManufacturerList_ItemCreated() method in the code. Add this code as a new method immediately before the ItemCreated() method:
Code: Select all
protected void list_Manufacturers_OnSelectedIndexChanged(object sender, EventArgs e)
{
Response.Redirect(ModifyQueryStringParameters("m", list_Manufacturers.SelectedValue.ToString()));
}
Code: Select all
//protected void ManufacturerList_ItemCreated(object source, DataListItemEventArgs e)
//{
// ManufacturerProductCount m = (ManufacturerProductCount)e.Item.DataItem;
// HyperLink narrowByManufacturerLink = (HyperLink)e.Item.FindControl("NarrowByManufacturerLink");
// narrowByManufacturerLink.NavigateUrl = ModifyQueryStringParameters("m", m.ManufacturerId.ToString());
//}

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
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