You will need
- - access to the Internet;
- - programming skills in PHP or JavaScript.
Instruction
1
Create a basket start with a definition of the algorithm of its work. Going to the online store, the buyer should be able to view the product list and select (highlight) the desired. After that, he clicks on the button "add to cart", and the information about the selected product (ID) and its number is stored on the site in the database. When all the goods placed in the cart and go to the payment procedure – that is, pressing the button "Pay". As a rule, the calculation is carried out by credit card or electronic money.
2
In that case, if an unauthorized buyer left the site without making the payment, a file containing information about the selected items must be deleted. If the user is authorized, the information is better to keep giving him the opportunity the next time you log on to the site to continue the purchasing process previously selected items. Also the buyer should have the option to empty trash or remove some positions.
3
On the basis of the algorithm, it is clear that the site should present the "Add to cart" and "Checkout". In addition, you must display the quantity of the item, its price and the total cost of the purchases. You can add a button "View cart" when clicked will display the full list of selected products, their quantity and value. On this page you will implement and the ability to clean the recycle bin or rejection of a product. All of these functions must be provided in the script of the basket.
4
Select the language in which you write the script. Usually it is created in PHP, but the basket can be implemented in JavaScript, the latter method is easier. Online you can find any ready script and modify it as needed. This is the best option, since it makes no sense to write code from scratch when there is already ready decision. A large amount of source code in PHP and JavaScript posted on the website AceWeb.ru.
5
It should be understood that the code of the online store, or elements thereof, written by a layman, is the ultimate dream of a hacker. As a rule, samopisnom engine almost always has a large number of vulnerabilities, especially if the programmer is not tempted in such matters. Therefore, it is better to use a ready-made solution and, if necessary, to modify it. Be sure to read about the typical mistakes made by the authors of such programs. Don't forget that on the website of the online store in any case should not save information about CVV code Bank cards of clients of the resource.