To control the number of products that are added to cart when ordering via the from, you must add a quantity-selector to your form, en let your javascript add the correct value in the VirteMart quantity box.
Put an input or select with the quantity in your form. Set the ID to "form_qty".
| Code: |
<div class="form_item">
<div class="form_element cf_textbox">
<label class="cf_label" style="width: 150px;">Quantity</label>
<input class="cf_inputbox required validate-number" maxlength="10"
size="30" title="Please enter a valid number" id="form_qty"
name="quantity" type="text" onchange="processform()" value="1" />
</div>
<div class="cfclear"> </div>
</div>
|
Then add these lines to your form-javascript:
| Code: |
function processform() {
var quantitybox = $('quantity'+<?php echo JRequest::getInt('product_id',0); ?>);
var qty = $('form_qty').value;
quantitybox.value = qty ;
}
|