I am creating a website that will have a login system. By logging into the site, you will have several products inside, one next to the other ...
Each product will have its value, and each user will have a credit to spend on the site ...
When you click on a product, it will be selected, it will have to pick up the product value, check if it has reached its credit limit, if it has reached, it will have to show a message on the screen, if it did not hit the user you can select another product ...
Example:
The user's plan is $ 30.00 of credit to spend.
The user chose a product with the value of: R $ 15.00. The system will get this value and check if it has reached the limit of its plan, if it has not reached, it can continue selecting the products, if it selects another product, but the value of it is $ 20.00, there it will show a message in the screen, saying that it has crossed the line.
How can I do this?
Could you provide a working example here?