4

I have created a configurable product A and simple child products A1, A2 and A3. When I search for product A by its name, the search gives me A, A1, A2 and A3. However, if I set child visibility to Not Visible Individually I do not get duplicate search results, BUT this way I am no longer able to search for child products by SKU. I need to be able to search for products by SKU without getting duplicate results when searching for product by it's name. How could I achieve that? Thank You.

EDIT: I'll try to put it in other words:

  • Search by name should only output the parent product.
  • Search by SKU should only output the child that SKU belongs to.

The only solution I came up with so far is to add new search meanings with links to products so that search term with particular SKU would open the child product with that SKU. However, I believe that this is a very bad approach, as it requires manual creation of search term for each child product.

Miles
  • 53
  • 6

2 Answers2

0

Set all the children as not visible

Then you can add a new attribute to the attribute sets you use to make your configurable products, you could call it something like childSkus. Make sure when you make the attribute that you set "Use in Quick Search" and "Use in Advanced Search" to Yes Set "Catalog Input Type for Store Owner" to Text area

In your configurable product find the attribute and enter the sku's of all the children of that configurable into it.

Save product, rebuild the Catalog Search Index and flush cache to be sure

  • This approach outputs the parent when searching for child sku. However I need SKU of A1 to display A1, not A. – Miles Jul 08 '15 at 09:01
0

You will have to modify search to achieve this.

  1. Get a list of configurable products from your collection.
  2. Using list of configurable you query DB table to get associated simple products.

  3. Now remove these associated products from collection.

Other way is that query that is fired for collection need to have a sub query to eliminate simple products.

Oscprofessionals
  • 2,161
  • 2
  • 15
  • 17