Bixie Forum

This is the forum for the free Bixie extensions and general questions.
Bixie customers can use the Support Center for their support questions.

You can visit the old forum here.

Video Tutorials

Bixie now provides video tutorials to help you setting up the Bixie VM-Chrono module.

Check out the video tutorials here for a step-by-step installation help!

Welcome, Guest
Please Login or Register.    Lost Password?

Changing the product quantity with your form
(1 viewing) (1) Guest
Go to bottomPage: 1
TOPIC: Changing the product quantity with your form
#314
Changing the product quantity with your form 1 Year, 6 Months ago  
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">&nbsp;</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 ; 
}

malles
malles
Admin
Posts: 206
graph
User Offline Click here to see the profile of this user
Last Edit: 2010/07/30 14:05 By malles.
The administrator has disabled public write access.
Bixie customers can use the Support Center for their support questions.
 
#316
Re:Changing the product quantity with your form 1 Year, 6 Months ago  
Thank You!

This should probably be put in the general forum in case others need it?
mowlman
mowlman
Posts: 13
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#319
Re:Changing the product quantity with your form 1 Year, 6 Months ago  
mowlman wrote:
This should probably be put in the general forum in case others need it?
That's why it's posted here
malles
malles
Admin
Posts: 206
graph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
Bixie customers can use the Support Center for their support questions.
 
#713
Re:Changing the product quantity with your form 10 Months, 1 Week ago  
Hello mowiman,

I am not a coder, but I still want to try out your solution. You mentioned that the following code should be added to a file:

Code:
function processform() {
var quantitybox = $('quantity'+<?php echo JRequest::getInt('product_id',0); ?>);
var qty = $('form_qty').value;
quantitybox.value = qty ;
}

Could you please tell me the name of the file and where I can find the file which should contain this code.

Thanks for your your reply.
evhamersv
evhamersv
Posts: 5
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
Go to topPage: 1
Moderators: baf