First off all I'm rather new with Drupal & Drupal Commerce. I'm going to do my best to describe what I have done and tried.
I'm developing a website where people can register (buy) a place in event. One of the things is that on the "add to cart" page they should be able to give some information like name, club, etc.
I added some fields to the line item "Product" like for example a textfield name Club and where I selected the option "Include this field on Add to Cart forms for line items of this type" so that it is shows in my add to cart form.
The problem I now have, is that I want (for a start) autocomplete that line-item field Club using #ajax and a ajax callback.
I started off with a hook_form_alter. I dumped (after checking the form id) the $form variable (with dpm()) to look for the Club #textfield so that I can modify it to include #ajax or #autcomplete_path, but I can't find that element.
The only thing I see is an array line_item_fields containing field_club, field_name (my fields that I attached to the line item) of the type #container (and I looked for a #texfield node within it, but didn't find it). I tried adding #ajax to it but that didn't work.
To be honest I'm totally stuck now as I don't know how to proceed further with this. Is it even possible to attach #ajax or any other attributes to a line-item field visible in the add to cart form ?