The labels for radio buttons do not appear correctly. Instead of:
No (0) Yes (X)
They appear as:
No Yes (0) (X)
In other words, the labels are beside each other, then the buttons beside each other instead of: label button label button
also the custom used on cart modification they wrap and display on two lines
Also the ID's are duplicated for multi buttons
<span class="product-field-display"><input id="17" checked="checked" type="radio" value="100" name="customPrice[3][17]" /><label
for="17">No No additional charge</label><input id="17" type="radio" value="98" name="customPrice[3][17]" /><label
for="17">Yes $100.00</label></span>
note that both radio buttons have the same ID
Hi,
is this problem already solved. I have the same problem.
Do you have a solution?
(http://jtouchmobile.com/download/vm-2016-same-id-bug-2.jpeg)
Add attachement for details 8)
Solution (VM 2016):
File: /administrator/components/com_virtuemart/models/customfields.php
Line:939
Replace those code block:
foreach ($group->options as $productCustom) {
//vmdebug('getProductCustomsFieldCart',$productCustom);
$price = self::_getCustomPrice($productCustom->custom_price, $currency, $calculator);
$productCustom->field_type = $group->field_type;
$productCustom->is_cart = 1;
// $group->display .= '<input id="' . $productCustom->virtuemart_custom_id . '" ' . $checked . ' type="radio" value="' .
// $productCustom->virtuemart_custom_id . '" name="customPrice[' . $row . '][' . $productCustom->virtuemart_customfield_id . ']" /><label
// for="' . $productCustom->virtuemart_custom_id . '">' . $this->displayProductCustomfieldFE ($productCustom, $row) . ' ' . $price . '</label>';
//MarkerVarMods
$group->display .= '<input id="' . $productCustom->virtuemart_custom_id . '" ' . $checked . ' type="radio" value="' .
$productCustom->virtuemart_customfield_id . '" name="customPrice[' . $row . '][' . $productCustom->virtuemart_custom_id . ']" /><label
for="' . $productCustom->virtuemart_custom_id . '" class="other-customfield">' . $this->displayProductCustomfieldFE ($product, $productCustom, $row) . ' ' . $price . '</label>';
$checked = '';
}
by:
$i = 0;
foreach ($group->options as $productCustom) {
$i++;
//vmdebug('getProductCustomsFieldCart',$productCustom);
$price = self::_getCustomPrice($productCustom->custom_price, $currency, $calculator);
$productCustom->field_type = $group->field_type;
$productCustom->is_cart = 1;
// $group->display .= '<input id="' . $productCustom->virtuemart_custom_id . '" ' . $checked . ' type="radio" value="' .
// $productCustom->virtuemart_custom_id . '" name="customPrice[' . $row . '][' . $productCustom->virtuemart_customfield_id . ']" /><label
// for="' . $productCustom->virtuemart_custom_id . '">' . $this->displayProductCustomfieldFE ($productCustom, $row) . ' ' . $price . '</label>';
//MarkerVarMods
$group->display .= '<input id="' . $productCustom->virtuemart_custom_id . $i . '" ' . $checked . ' type="radio" value="' .
$productCustom->virtuemart_customfield_id . '" name="customPrice[' . $row . '][' . $productCustom->virtuemart_custom_id . ']" /><label
for="' . $productCustom->virtuemart_custom_id . $i . '" class="other-customfield">' . $this->displayProductCustomfieldFE ($product, $productCustom, $row) . ' ' . $price . '</label>';
$checked = '';
}
I know this solution, but that did not worked for me.
and is it working with $row?
Hi,
what do you mean with $row. Did i miss something ?
But it is still not working. The only difference is that the both input tags have there own id.
regards Jan
$group->display .= '<input id="' . $productCustom->virtuemart_custom_id .$row. '" ' . $checked . ' type="radio" value="' .
$productCustom->virtuemart_customfield_id . '" name="customPrice[' . $row . '][' . $productCustom->virtuemart_custom_id . ']" /><label
for="' . $productCustom->virtuemart_custom_id . '" class="other-customfield">' . $this->displayProductCustomfieldFE ($product, $productCustom, $row) . ' ' . $price . '</label>';