M
M
mrrangerr2020-07-12 22:04:53
MySQL
mrrangerr, 2020-07-12 22:04:53

How to add data to the table on click?

Hello everyone, I'm new to the backend, there is a task to add an item to the cart on click. Added addEventListener to the button. And then what? Please explain the principle of working with such operations.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
Lynatik001, 2020-07-12
@mrrangerr

badly worded requirement. Working with a shopping cart is a front-end pure js + freemwork, what kind of react is there or vu. the shopping list is stored in the shopping cart. - and the basket data is probably in cookies, local storage or somewhere else. It's not the final product yet. Another thing is when the buyer has filled the basket and clicks to buy, pay, or whatever. Only then are you already starting to work with the server.
and only then you transfer the ID and the number of ordered goods to the server, on the server you get the price by IDs. and only then can you sum it up.
Never transfer money from the frontend to the server. count everything on the server. (c. Security) Here it is spelled out how to implement payment https://www.youtube.com/watch?v=AfypOVaB5r0&t and how to move data correctly

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question