VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: sandomatyas on March 07, 2022, 18:54:49 PM

Title: Can't uncheck checkbox shopper field on order modify
Post by: sandomatyas on March 07, 2022, 18:54:49 PM
Steps to reproduce

It's because checkbox isn't processed on post if it's not checked.
Quick fix: in administrator/components/com_virtuemart/orders/tmpl/order.php there is a
foreach ($this->userfields['fields'] as $_field ) {

echo ' <tr>'."\n";

After the foreach I put this
if ( $_field['type'] == 'checkbox' )
{
echo '<input type="hidden" name="' . $_field['name'] . '" value="0" />';
}

So if the checkbox is not checked and submitted, there is a "default 0 value" from the dummy hidden field