Jump to content

decreasing/increasing number depending on selections


Spiew

Recommended Posts

Hello,

 

I'd like to know if someone know how I can do this.

Example when sites use this function is in a store etc.

You choose your product-types, if you for example chose a larger size, the price becomes higher and then it updates in real time.

So what I mean is like, the number increases/decreases depending on the users selections, if he wants that or not that included, the number changes so he/she can see the exact price he needs to pay for the product.

 

Like this for standard

----------------

25$

---------------

 

but if I for example choose a larger size it automatically updates to

 

-------------

30$

------------

 

I hope u understand what I mean.

Thanks in advanced

There are a couple of ways you could do it:

Save the base price into the DOM somewhere -> in a hidden div or hidden input

or

Use ajax to query the server for the base price every time the quantity updates

 

Then, when the quantity is changed, multiply the base price by the new quantity, and set the result into the 'total' field.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.