Ok, so what I am trying to do here is to "connect" CCK field with taxonomy autocomplete path or vocabulary if you like.
I tried this and it works:
$form['taxonomy']['tags'][$vocabulary->vid] = array(
'#type' => 'textfield',
'#default_value' => $typed_string,
'#maxlength' => 100,
'#autocomplete_path' => 'taxonomy/autocomplete/'. $vocabulary->vid,
'#required' => $vocabulary->required,
'#title' => $vocabulary->name,
'#description' => t('A comma-separated list of terms describing this content (Example: funny, bungie jumping, "Company, Inc.").')
);
Example taken from http://drupal.org/node/42552
However, what I need to do is to connect the vocabulary field with CCK field so that any entered term in my CCK field is saved as a taxonomy term so I could manipulate with those terms later. This would be easy but my CCK field is actually an Ubercart Name field and I cannot convert it to the vocabulary field type or change the field ID if I want it to store the product names to Ubercart SQL tables.
So far I manged two things:
1. To make the Name field an autocomplete one so that my products are listed there but this is not a good solution for me since I need those results as taxonomy terms as stated before.
2.
// hook_form_alter is being used here
$form['title'] = array(
'#type' => 'textfield',
'#autocomplete_path' => 'taxonomy/autocomplete/11',
'#title' => t('Name'),
'#description' => t('Enter the product name'),
// '#default_value' => ,
'#required' => TRUE,
'#weight' => -20,
);
unset($form['taxonomy']['tags']['11']);
So here I have the Ubercart Name field connected to the $form['taxonomy']['tags']['11'] field which is created by taxonomy module. That same field is unset. So some alternative solution would be to make the data entered in the Name field duplicate into this $form['taxonomy']['tags']['11'] field which would then be hidden.
But I find that somewhat silly. So is there any normal solution to my problem?