Hiding manufacturers from advanced search?

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
William M
Commander (CMDR)
Commander (CMDR)
Posts: 150
Joined: Sat Feb 14, 2009 9:40 am
Contact:

Hiding manufacturers from advanced search?

Post by William M » Wed May 06, 2009 7:15 am

Is it possible to hide some manufacturers from advanced search? I've still got Sanasonic and Bell on my site for reference (but all products are hidden)... they show up in the drop-down list of manufacturers on the advanced search page. Results are null, but it looks like the site isn't working properly if nothing comes up.

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

Re: Hiding manufacturers from advanced search?

Post by mazhar » Wed May 06, 2009 9:14 am

Edit your ConLib/AdvanceSearchPage.ascx file and locate following code block

Code: Select all

<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 update is as below

Code: Select all

<asp:ObjectDataSource ID="ManufacturerDs" runat="server" OldValuesParameterFormatString="original_{0}"
    SelectMethod="LoadForCriteria" TypeName="CommerceBuilder.Products.ManufacturerDataSource">
    <SelectParameters>
        <asp:Parameter Name="sqlCriteria" DefaultValue=" Name NOT IN ('Sanasonic','Bell') " />
        <asp:Parameter Name="sortExpression" DefaultValue="Name" />
    </SelectParameters>
</asp:ObjectDataSource>
Note if you want to exclude more manufacturers then just add an entry in following code
('Sanasonic','Bell')
for example there is another manufacturer having name Manufacturer1 then it would be
('Sanasonic','Bell','Manufacturer1')

William M
Commander (CMDR)
Commander (CMDR)
Posts: 150
Joined: Sat Feb 14, 2009 9:40 am
Contact:

Re: Hiding manufacturers from advanced search?

Post by William M » Wed May 06, 2009 10:27 am

Thanks.

For future releases... this should be a control in admin. Manufacturers come and go and it can take weeks to complete a supplier's products for display. Hiding/exposing these should be much simpler.

MarcD
Ensign (ENS)
Ensign (ENS)
Posts: 7
Joined: Mon Aug 11, 2008 10:26 am

Re: Hiding manufacturers from advanced search?

Post by MarcD » Mon Jan 04, 2010 1:23 pm

It seems that this edit excludes the manufacturer from the drop down option, but doesn't exclude it from the search itself. We have a store where a number of items are not assigned a manufacturer. We want to include those in the search but exclude a certain manufacturer/manufacturerid. Do you, by chance, know the best way to approach that exclusion?

Thank you,
Marc

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

Re: Hiding manufacturers from advanced search?

Post by mazhar » Tue Jan 05, 2010 3:51 am

Yes you can do this by simply looking into object data source code of advance search and then pass 0 for manufacturer id to remove manufacturer filter. Right now search is inconclusive not exclusive so with this out of box component you can't make it ignore a single manufacturer.

Post Reply