Page 1 of 1

Hiding manufacturers from advanced search?

Posted: Wed May 06, 2009 7:15 am
by William M
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.

Re: Hiding manufacturers from advanced search?

Posted: Wed May 06, 2009 9:14 am
by mazhar
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')

Re: Hiding manufacturers from advanced search?

Posted: Wed May 06, 2009 10:27 am
by William M
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.

Re: Hiding manufacturers from advanced search?

Posted: Mon Jan 04, 2010 1:23 pm
by MarcD
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

Re: Hiding manufacturers from advanced search?

Posted: Tue Jan 05, 2010 3:51 am
by mazhar
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.