On the productdetails page we display parent and its child products by means of the Multivariant custom field. By default, the variants are rendered as OPTIONS of the <SELECT> dropdown list. But I need to display them with some another HTML tag(s). For example, the wrapper may be as <UL> and the variants as <LI>.
In the file sublayouts/customfield.php I tried commenting the line
//$html .= JHtml::_ ('select.genericlist', $options, $fieldname, $attribs , "value", "text", $selected,$idTagK);
and replaced it with
$myLIs = array();
foreach($options as $optionText) {
$myLIs[] = '<li>'.$optionText.'</li>';
}
$html .= '<ul id="'.$idTagK.'" name="'.$fieldname.'" data-dynamic-update="1">'.implode('',$myLIs).'</ul>';
But switching between the variants stopped working after that.
Everything seems to be binded to the SELECT html tag in the components/com_virtuemart/assets/js/dynupdate.js
There I tried to replace
default:
el[0].onchange = null;
el.off('change',Virtuemart.upd);
el.on('change',Virtuemart.upd);
with
default:
el[0].onclick = null;
el.off('click',Virtuemart.upd);
el.on('click',Virtuemart.upd);
But it also didn't help
How to resolve the problem?
VM 3.0.12
I would like to find out the solution to that problem as well
Just thought you may find it useful. VM 3.0.17.2 has working radio type multi variant custom field feature. Then you can easily use some CSS to change the actual display style of the radio buttons. You can find the package here - http://dev.virtuemart.net/projects/virtuemart/files
Thanks Jumbo!
Really useful