OK, I've been rooting around in the code and in an effort to enable the use of radio-button style attributes, I've made the following changes:
LINE 69
FROM:
if(uc_cano_is_parent_attribute($aid, $form['node']['#value']->type, element_children($attributes)) && $attr['#type'] == 'select') {TO:
if(uc_cano_is_parent_attribute($aid, $form['node']['#value']->type, element_children($attributes)) && ($attr['#type'] == 'select' || $attr['#type'] == 'radios')) {LINES 164-165
FROM:
//fetch only select box control attributes
$result = db_query("SELECT aid, label FROM {uc_attributes} WHERE display = '%d'", 1);TO:
//fetch only select box or radio button control attributes
$result = db_query("SELECT aid, label FROM {uc_attributes} WHERE display = '%d' OR display = '%d'", 1, 2);Of course, all I've done is essentially remove the restriction without understanding what the full consequences may be, but it does appear to work, at least for parent attributes.
The only glitch I see so far is under the following circumstance:
1. I have a parent attribute (radio style) where option A enables a child attribute and option B doesn't.
2. I select option A, which enables the child attribute. Said child attribute is required.
3. I do not make a selection in the child attribute and hit "Add to Cart" anyway.
I get the expected error telling me that the child attribute is required. However, although option A is still selected, the child attribute is no longer enabled. I have to click option B, then option A again to re-enable the child attribute. This doesn't happen when the parent attribute is a select box.
I imagine the solution is in uc_cano_add_to_cart_form_validate, but I haven't had much sleep and I get a little lost reading through it.
Anyone care to further my attempts to enable radio attributes?
