How to change Magento search to check child skus?

Currently, a site search will search for all skus items marked as visible in the search. This is good and good.

The problem occurs when the client knows about a single child. So, let's say the product comes in both 20 feet and 25 feet. We put them in a custom product and have one product page where the customer can choose one of these two lengths.

What happens, the customer always knows that the sku of the 20-foot variation is RDB-20 and the other is RDB-25. Then the RDB-25 search returns without any results, since a simple product does not appear in the search - it does not understand that there is a match.

How do I get a search to search for an item with the visibility "Not visible individually" when it appears in the search?

The desired effect is that when looking for a child SKU, the parent should appear in the results.

+4
source share
2 answers

There is no good way to do this without expanding the default search, but at this point you can also look for other options.

Here is a workaround that you can follow depending on how you manage your products, and this worked for me until I switched to the default search.

Instead of changing the search, try adding an attribute to all products and make it hidden by orienting all skus in this field. A search should find a text attribute and show custom.

Its a bit of a workaround, but works for me.

+1
source

This has not been tested, but I am a little versed in our attributes, and I think I found something that might help.

Currently, since our child products do not appear in our search, we have a parent placeholder with child product attributes.

However, things like brand, taxable amount, description, are filled out for each subsidiary product until our SKU does.

The only difference that I see between the two attributes is to manage the control attributes → click on the attribute →, and then go to the properties of the interface by properties and select

  • Use in search results Layered navigation: YES
  • Used in product listing: YES
  • Use in multi-level navigation: filtering (with results)

I'm not sure which of them do something, but in the aggregate table of full-text search data, they say somewhere that they are populated for children, and I believe that the admin panel is there.

Hope this helps!

0
source

All Articles