0
I am creating a site that will have a login system. When you log 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...
By clicking on some product, it will be selected, will have to take the product value, check if it reached its credit limit, if it hit, will have to show a message on the screen, if it did not hit, the user can select another product...
Example:
The user plan is R $ 30,00 real credit to spend.
The user chose a product with the value of: R$ 15,00. The system will take this value and check if reached the limit of his plan, if not hit, he can continue selecting the products, if he select another product, but the value of it is $ 20,00, there will show a message on the screen, saying that passed the limit.
How can I do that?
Could provide a functional example here?
The question is a little too wide. Could you make it more specific by saying where is your difficulty? Buying values? Treat click? Communicate with the server? The way it is, it looks like a code request that solves all of this at once, which is not suitable for the website format. Thank you.
– bfavaretto
A suggestion: when logging in, leave a session variable with the value of the user’s credit. In javascript, you control for each click on a product the value of credit.
– ricidleiv