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

Edited by Spiew
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.