REmove Manufacturers as a search option

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
pmcalister
Ensign (ENS)
Ensign (ENS)
Posts: 16
Joined: Mon Apr 28, 2008 9:58 am

REmove Manufacturers as a search option

Post by pmcalister » Tue Oct 07, 2008 8:45 am

I have a client who wants to remove the search by Manufacturer option. Any ideas?

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

Re: REmove Manufacturers as a search option

Post by mazhar » Tue Oct 07, 2008 9:09 am

Lets for example you can remove the manufacturers search option from the Advacne Search Page by first removing the manufactures dropdown list and data source form the AdvanceSearchPages.ascx and then setting the default value for ManufactureId parameter to 0.

For example on the AdvanceSearchPage.ascx file locate and comment out following two blocks of code

Code: Select all

<%--<asp:DropDownList ID="ManufacturerList" runat="server" AppendDataBoundItems="True"
                DataSourceID="ManufacturerDs" DataTextField="Name" DataValueField="ManufacturerId">
                <asp:ListItem Text="- Any Manufacturer -" Value="0"></asp:ListItem>
            </asp:DropDownList>--%>

and 

<%--<asp:ObjectDataSource ID="ManufacturerDs" runat="server" OldValuesParameterFormatString="original_{0}"
    SelectMethod="LoadForStore" TypeName="CommerceBuilder.Products.ManufacturerDataSource">
    <SelectParameters>
        <asp:Parameter Name="sortExpression" DefaultValue="Name" />
    </SelectParameters>
</asp:ObjectDataSource>--%>
and then locate the following line of code

Code: Select all

<asp:ControlParameter Name="manufacturerId" Type="Int32" ControlID="ManufacturerList" PropertyName="SelectedValue" />
and make it look like

Code: Select all

<asp:Parameter Name="manufacturerId" Type="Int32" DefaultValue="0" />

User avatar
compunerdy
Admiral (ADM)
Admiral (ADM)
Posts: 1283
Joined: Sun Nov 18, 2007 3:55 pm

Re: REmove Manufacturers as a search option

Post by compunerdy » Tue Oct 07, 2008 9:11 am

I like to use the manufacturer field but I did not want is displayed to customers. Here are the files I had to edit to remove it.

Edit <conlibs> searchpage.ascx and .cs/categorysearchsidebar.ascx and .cs/categorygridpage.ascx and .cs to not display manufacturer info.

Hope that helps.

pmcalister
Ensign (ENS)
Ensign (ENS)
Posts: 16
Joined: Mon Apr 28, 2008 9:58 am

Re: REmove Manufacturers as a search option

Post by pmcalister » Tue Oct 07, 2008 10:13 am

Great! This worked just fine. Thanks a bunch.

dappy2
Commander (CMDR)
Commander (CMDR)
Posts: 114
Joined: Wed Jan 18, 2006 5:53 pm
Contact:

Re: REmove Manufacturers as a search option

Post by dappy2 » Thu Dec 18, 2008 4:40 pm

How can I remove the manufacturer column from the search results on the advanced search also? I've commented out all the sections that pertain to choosing a manufacturer but I don't even want the column in the results. Everytime I try to remove it and comment out the c# code that mentions manufacturer I get:

Code: Select all

Failed to load viewstate.  The control tree into which viewstate is being loaded must match the control tree that was used to save viewstate during the previous request.  For example, when adding controls dynamically, the controls added during a post-back must match the type and position of the controls added during the initial request.
Our store doesn't use a manufacturer (98% of the time we are the manufacturer in a round about sort of way) and in the 2-3 years it has been running I've never used it. And since I'm transitioning from storefront software to AbleCommerce I don't forsee us using it. I can always add it back if needed.

Thanks,
Dappy

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

Re: REmove Manufacturers as a search option

Post by mazhar » Fri Dec 19, 2008 4:52 am

Find the following code in AdvanceSearchPage.ascx file

Code: Select all

<asp:TemplateField HeaderText="Manufacturer" SortExpression="Manufacturer">                    
                <ItemTemplate>
                    <asp:Label ID="Manufacturer" runat="server" Text='<%#GetManufacturerLink((int)Eval("ManufacturerId"))%>'
                        ></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
and comment it out like below

Code: Select all

<%--<asp:TemplateField HeaderText="Manufacturer" SortExpression="Manufacturer">                    
                <ItemTemplate>
                    <asp:Label ID="Manufacturer" runat="server" Text='<%#GetManufacturerLink((int)Eval("ManufacturerId"))%>'
                        ></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>--%>

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

Re: REmove Manufacturers as a search option

Post by jmestep » Fri Dec 19, 2008 7:34 am

dappy2- I occasionally get that error when I'm editing something that has code in it where paramters were passed, like the search page. If I go to another page, then go back to it, it is usually OK.
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

dappy2
Commander (CMDR)
Commander (CMDR)
Posts: 114
Joined: Wed Jan 18, 2006 5:53 pm
Contact:

Re: REmove Manufacturers as a search option

Post by dappy2 » Fri Dec 19, 2008 8:39 am

Thanks - that worked. But i had commented that section out before and was getting the error like jmstep said.

Works now.

Post Reply