I figured out what's going on. It's a bug that is causing this. I'm using a characteristic override and apparently the characteristic is not submitted. Firebug throws a javascript error.
This is the site:
exo-l.com/shop2/exo-l
If you change the colors firebug throws this error:
TypeError: form.elements is undefined
var checkFields = form.elements['hikashop_product_characteristic['+options[i]+']'];
Inside the function hikashopUpdateVariant()
In the override i made these 2 changes (I added comments to the lines i changed):
Original
case 'dropdown':
$main_html = '<table class="hikashop_product_characteristics_table">';
$config = & hikashop_config();
foreach ($obj->characteristics as $characteristic) {
$main_html.='<tr>';
$values = array();
if (!empty($characteristic->values)) {
foreach ($characteristic->values as $k => $value) {
if (!$config->get('show_out_of_stock')) {
$hasQuantity = false;
foreach ($element->variants as $variant) {
foreach ($variant->characteristics as $variantCharacteristic) {
if ($variantCharacteristic->characteristic_id == $value->characteristic_id) {
if ($variant->product_quantity != 0) {
$hasQuantity = true;
}
}
}
}
if (!$hasQuantity)
continue;
}
$values[$k] = $value->characteristic_value; //THIS LINE
}
}
$html = $obj->display($characteristic->characteristic_id, @$characteristic->default->characteristic_id, $values, $params->get('characteristic_display')); //THIS LINE
if ($params->get('characteristic_display_text')) {
$html = $characteristic->characteristic_value . '</td><td>' . $html;
}
$main_html.='<td>' . $html . '</td></tr>';
}
Modified
case 'dropdown':
$main_html = '<table class="hikashop_product_characteristics_table">';
$config = & hikashop_config();
foreach ($obj->characteristics as $characteristic) {
$main_html.='<tr>';
$values = array();
if (!empty($characteristic->values)) {
foreach ($characteristic->values as $k => $value) {
if (!$config->get('show_out_of_stock')) {
$hasQuantity = false;
foreach ($element->variants as $variant) {
foreach ($variant->characteristics as $variantCharacteristic) {
if ($variantCharacteristic->characteristic_id == $value->characteristic_id) {
if ($variant->product_quantity != 0) {
$hasQuantity = true;
}
}
}
}
if (!$hasQuantity)
continue;
}
$values[$k] = '<img src="/media/exo_colors/' . $value->characteristic_value . '.png" id=' . $value->characteristic_value . ' />'; //THIS LINE
}
}
$html = $obj->display($characteristic->characteristic_id, @$characteristic->default->characteristic_id, $values, $characteristic->characteristic_value, $params->get('characteristic_display')); //THIS LINE
if ($params->get('characteristic_display_text')) {
$html = $characteristic->characteristic_value . '</td><td>' . $html;
}
$main_html.='<td>' . $html . '</td></tr>';
}
I also changed the display method in the characteristic.php file like this.
function display($map, $value, $values, $customization, $characteristic_display = 'dropdown') {
if (empty($values) || !is_array($values)) {
return JText::_('NO_VALUES_FOUND');
}
if (is_array($this->characteristics)) {
$characteristic_id = $map;
$map = 'hikashop_product_characteristic[' . $characteristic_id . ']';
$id = 'hikashop_product_characteristic_' . $characteristic_id;
} else {
$id = $map;
}
$this->values = array();
foreach ($values as $key => $val) {
if (strlen($val) != 0 && empty($val)) {
$val = $val . ' ';
}
$this->values[] = JHTML::_('select.option', $key, $val);
}
if ($characteristic_display != 'radio') {
$characteristic_display = 'generic';
}
$html = '<div id="' . strtolower($customization) . '">' . JHTML::_('select.' . $characteristic_display . 'list', $this->values, $map, 'class="inputbox" size="1"' . $this->options, 'value', 'text', (int) $value, $id) . '</div>';
return $html;
}
This is the full override file:
pastebin.com/LLwZgQ1j
Apparently the problem lies as soon as the display method is called with that extra parameter. Not sure what's going on exactly. I'm running on 1.6