Gold coin deduction for shopping cart? Calculate the total price of the shopping cart?

clipboard.png
such a shopping cart page, how to write the price after deduction with gold coins at the front end is the final total

Feb.28,2021

bind the change event to the check box that uses gold coins. If selected, add gold coins, otherwise do not add gold coins, and update the final result to the total


without thinking about it? If you turn to


the front end calculates, the back end also has to judge whether the submitted data is correct


when the general user adds the product to the shopping cart click settlement page, it is judged by the backend, and there is no need for the front end to judge. The backend directly determines whether the user meets the conditions for the use of gold coins and how many gold coins can be used, and then automatically displays them on the page. There is no need for the user to operate manually. After all, few users take the initiative to close the gold coin deduction when there are cheap to take advantage of, so if the user does turn it off, then a DOM operation at the front end will be OK. The rest is to submit the order and the payment is over.


isn't there a check box after the value of usable gold coins? judge whether this check box is selected. When selected for true, the total value there is the total value minus the value of usable gold coins. If not selected, there is no need to subtract

.
Menu