Answer the question
In order to leave comments, you need to log in
How to implement a shopping cart without PHP?
There is an online store with 9 products. I write mainly in HTML, JQuery and I would like to know if it is possible to somehow implement a shopping cart with product design later without using PHP?
The problem is simply that I don’t know where to store information about the selected product if the user selected the product and the size of the product on the same page, and then continued to climb the site and ordered something else. I heard that PHP has a session in which you can store it, but how without PHP?
Answer the question
In order to leave comments, you need to log in
citforum.ru/internet/html/cookie.shtml
This is what you need. But from experience with a shopping cart (quite complex, with options and various stages), which hangs completely on the frontend - no need . Use backend and sessions. Everything is more logical and more beautiful there.
There is an online store with 9 products.
localStorage['backet'] = ['Мухи'];
localStorage['backet'] = ['Мухи','Котлеты'];
If you don’t want to figure it out at all, you can simply find a ready-made solution and use it. For example, here heeg.ru the entire engine of the online store (including the shopping cart and the admin panel) is made on pure javascript without using php at all, even sending PHP orders is not needed.
To store the selected product, you can use localstorage or websql
And what do you need?
You can use php c js ... or purely php, but the load on the server will increase significantly.
Using array or session..
There is a script for an electronic store (basket) EasyShop . There is a code in JS, online payment is implemented, storage of selected goods in localStorage, invoicing, it works both on bare HTML and under DLE and other engines, and PHP is executed on the developer's side. Free for small orders (up to 2 items per order).
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question