Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By AxelStoll on
Hi,
I´m using Commerce on my Online-Shop, but I having some difficulties with the standard search provided by Drupal.
It´s just impossible to search by the SKU for products (for visitors) with the standard Search, given by Drupal.
I guess, the SKU-field is just not getting indexed. Does there exist a module or a patch, that could help me, to let the SKU-Field of commerce being indexed?
Thanks for any help,
Marc
Comments
Maybe there is already a solution.. but I´m too stupid
I´ve found this thread: https://drupal.org/node/1929780 incl. this screenshot: http://cl.ly/image/1h0L3m000l1K
I guess, this could be the solution. But... frankly - I´m very new to commerce. Where can I find this option?
Core search leaves a lot to
Core search leaves a lot to be desired. I would recommend using the search API, search API database, fuzzy search and search pages modules for a more enhanced search experience. You can pull and index any fields on any entity and even weight each field for relevance. It takes a bit more to get up and running but is worth it in the long run.
hook_node_update_index
You could implement hook_node_update_index() in a module this way:
Just replace mymodule and field_produit by the actual names of your module and your product reference field; requires Entity API, which is already a dependency of Drupal Commerce anyway. You will have to rebuild your search index.
@FMB This snippet is awesome.
@FMB This snippet is awesome. Thanks for sharing.
-----------------------------------------------------
Bob @ Drupal Aid (https://www.drupalaid.com)
can somebody build a module
can somebody build a module please, I am too stupid to use this snipet code
Drupal webdesign - regular sites and ubercart ecommerce sites
Drupal webdesign
~
There is a module. Search API. I mention it above.