Spiew Posted February 5, 2014 Share Posted February 5, 2014 (edited) 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 February 5, 2014 by Spiew Quote Link to comment https://forums.phpfreaks.com/topic/285962-decreasingincreasing-number-depending-on-selections/ Share on other sites More sharing options...
denno020 Posted February 13, 2014 Share Posted February 13, 2014 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. Quote Link to comment https://forums.phpfreaks.com/topic/285962-decreasingincreasing-number-depending-on-selections/#findComment-1468711 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.