Last things first... you shouldn't relly on JS to calculate the final price. You can use JS to calculate and show the price to the user, but once you send the selected products to your PHP script you should use the prices from the database. What I mean is, don't post the price from JS to your PHP and use it to commit the transaction.
About storing the products, if your shopping cart will have more then one page you could store in the session in PHP. If it's only one page, you don't need it. I don't think cookies are a good option because it has very low size limits (4kb I guess, but not sure)