adam griffin
Posts: 0
Joined: Tue May 21, 2013 8:44 pm

How can I add the price of an item selected together?

I have created a shopping cart for my app. I'm trying to make the price of the items within my database add together as the user add to the cart. Can anyone help me with that?

I have a database of Product Names and Price of the product. As the user clicks what product they want, the app searches the database for the item id and returns the name of the product and price to the checkout page. How do I get the price of the items to add together or subtract from one another as the user select or deselect?

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

How can I add the price of an item selected together?

Any app UI logic is written in JavaScript. There are many good JS resources online. To add two numbers can be as simple as:

code
var num1;
var num2;
var total = num1 + num2;
/code

Return to “Issues”