Hi,
Thank you for your reply, which helped a lot. (I do have some questions below)
This is the result that I came up with.
Maybe it can still be made easier, so anyone feel free to make it cleaner and shorter. (I don't mind)
Oh yes, I added a if-statement to be able to select(selected="selected") the right value ($row->cart_product_quantity).
<select id="hikashop_checkout_quantity_<?php echo $row->cart_product_id; ?>" name="item[<?php echo $row->cart_product_id;?>]" class="hikashop_product_quantity_field_dropdown">
<?php
$min_quantity = $row->product_min_per_order;
$cart_product_quantity = $row->cart_product_quantity;
$jmax = $min_quantity*10;
for($j=1; $j<=20; $j++) {
$multiple_min_quantity = $min_quantity * $j;
if ($multiple_min_quantity == $cart_product_quantity) {
?>
<option value="<?php echo $multiple_min_quantity; ?>" selected="selected" onchange="var qty_field = document.getElementById('hikashop_checkout_quantity_<?php echo $row->cart_product_id;?>'); if (qty_field){<?php echo $input; ?>}"> <?php echo $multiple_min_quantity; ?></option>
<?php }
else {
?>
<option value="<?php echo $multiple_min_quantity; ?>" onchange="var qty_field = document.getElementById('hikashop_checkout_quantity_<?php echo $row->cart_product_id;?>'); if (qty_field){<?php echo $input; ?>}"> <?php echo $multiple_min_quantity; ?></option>
<?php
}
}
?>
</select>
I changed the class name of the select into
.hikashop_product_quantity_field_dropdown and added the following in the
frontend_custom.css.hikashop_product_quantity_field_dropdown{
float:left;
}
Some related questions:
1) Does the onchange in the option value do something. I'm not sure what $input is used for and what is happening.
Can you elaborate in what this does and whether it makes a difference if it's there or not?
I mean this code:
onchange="var qty_field = document.getElementById('hikashop_checkout_quantity_<?php echo $row->cart_product_id;?>'); if (qty_field){<?php echo $input; ?>}"
2) STANGE BEHAVIOUR: I didn't change anything in the delete button but when I click on it, it jumps step 2.
This is the code which I didn't touch:
<?php if($this->params->get('show_delete',1)){ ?>
<div class="hikashop_cart_product_quantity_delete">
<a href="<?php echo hikashop_completeLink('product&task=updatecart&product_id='.$row->product_id.'&quantity=0&return_url='.urlencode(base64_encode(urldecode($this->params->get('url'))))); ?>" onclick="var qty_field = document.getElementById('hikashop_checkout_quantity_<?php echo $row->cart_product_id;?>'); if(qty_field){qty_field.value=0; <?php echo $input; ?> qty_field.form.submit();} return false;" title="<?php echo JText::_('HIKA_DELETE'); ?>">
<img src="<?php echo HIKASHOP_IMAGES . 'delete2.png';?>" border="0" alt="<?php echo JText::_('HIKA_DELETE'); ?>" />
</a>
</div>
<?php } ?>
Thanks