Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - JQuery thinkphp Shopping Cart Multi-commodity quantity addition and subtraction+total price calculation
JQuery thinkphp Shopping Cart Multi-commodity quantity addition and subtraction+total price calculation
(1), which means connection with+= in js, not accumulation, so s+= cannot be used, but S = XXX+S is needed.

(2) If+1 and the database is also+1, you need to use ajax. When you are independent, trigger ajax.

$.post("url ",{"id": "product id"}, function(data){

})

Fill in an address in the url and send the product id to the processing page.