Is there a way, when hiring for Attribute field setting


to add an additional choice added.

I need urgently an auto-complete feature in the frontend for the field type term reference.

For a very large amount of product variations, it is otherwise with a 5 meter long drop down menu very user unfriendly (+4000 zip codes for a single service).

With the Finder module, I could not solve the problem unfortunately.

  • This was posted via Google translate from German to English. Corrections welcome: "Auto Komplett für Produkt-variationen nutzen. Gibt es eine Möglichkeit, bei der Einstellung für Atribute (siehe Bild) eine weitere Auswahlmöglichkeit hinzu zu fügen. Ich benötige hier dringend eine Auto-Komplett-Funktion im Frontend für den Feldtyp Term Referenz. Bei einer sehr großen Menge an Produkt-variationen wird es sonst bei einem 5 Meter langem Drop-Down-Menü sehr Nutzerunfreundlich (+4000 Postleitzahlen für eine einzelne Dienstleistung). Mit dem Finder-Modul konnte ich das Problem leider nicht lösen."
    – mpdonadio
    Apr 1, 2013 at 12:44

1 Answer 1


You will need to write your own module and implement a hook_form_alter to override the normal Commerce way of displaying attribute selection.

A good example to look at is the Commerce Fancy Attributes module, which replaces the drop down with image selection. http://drupal.org/project/commerce_fancy_attributes

You can change the input type to autocomplete and point it to the correct callback url which returns your zipcode options in the format required for the product field.

$form['attribute_field_name']['#type'] = 'textfield';
$form['attribute_field_name']['#autocomplete_path'] = 'path/that/returns/list/of/zip/codes';
  • Hi, firstonce Thanks and Happy Easter. I've said a little differently. In the selection, there are the options (select list, radio buttons, rendered term). I've already searched the bloody fingers could, but unfortunately can not find the file, where the functions are programmed. Strictly speaking, you need really only in the appropriate file, for example, copy the code for select list, designate with Autocomplete and insert the core code for autocomplete accordingly. Sorry but I have absolutely no idea of php and co. Greetings Frank Translated with Google
    – user16188
    Apr 1, 2013 at 14:35
  • Well, you will need some knowledge of PHP to do what you want to do, or at least hire someone to do it for you. And no, you do not want to modify Drupal core or Commerce core files. Writing your own module is not that difficult. You'll just need to read the Drupal.org documentation.
    – jazzdrive3
    Apr 1, 2013 at 15:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.