PDF Archive

Easily share your PDF documents with your contacts, on the Web and Social Networks.

Share a file Manage my documents Convert Recover PDF Search Help Contact



How to Create a Simple PHP MYSQL Shopping Cart .pdf



Original filename: How to Create a Simple PHP MYSQL Shopping Cart.pdf
Title: HOW TO CREATE A PHP MYSQL SHOPPING CART
Author: W.S. Toh

This PDF 1.7 document has been generated by Microsoft® PowerPoint® 2016, and has been sent on pdf-archive.com on 31/05/2018 at 03:16, from IP address 58.182.x.x. The current document download page has been viewed 158 times.
File size: 273 KB (10 pages).
Privacy: public file




Download original PDF file









Document preview


CREATE A PHP MYSQL
SHOPPING CART

2

I am Robert Tou
I am a web developer and
share the love for
programming by giving
free presentations.

3

Everyday life is like programming, I guess.
If you love something you can put beauty
into it.

- Donald Knuth

1) THE DATABASE

»
»
»
»
»

Create a database to hold the products and orders first.
Products – Product ID, Name, Description.
Orders – Order ID, Name, Order Date.
Ordered Products – Product ID, Order ID, Quantity.
You can further expand on the database, but these
should are the basic requirements.

4

2) PRODUCTS CATALOG

» Create a HTML page to pull and display the products.
» Connect to the database, and use a simple “SELECT *

5

FROM `products`” SQL query to pull the data.
» Use a while loop to generate a table, layout the products
as you deem fit.
» Remember to attach an “add to cart” button for each
product.

3) CART ACTIONS I

6

» Recommended to use AJAX to handle the add to cart.
» Use jQuery to speed up your development.
» Pass the selected product ID via AJAX to another PHP
script to handle the add action.
» Start the session, and record the cart in a simple array of
product ID => quantity.

4) CART ACTIONS II

7

» Handle the rest of the actions in a similar manner via
AJAX.
» Javascript fires an AJAX request to the PHP handler.
» Change quantity and remove items from the session cart.

5) CHECKOUT

8

» Show the checkout button if there is at least 1 item in the
cart.
» Similar AJAX process.
» Record cart into the database, wipe off the session, then
redirect the customer to a thank you page.

Thank you!

For the complete guide and source code,
please visit Code Boxx:
https://code-boxx.com/simple-phpmysql-shopping-cart/

9


Related documents


PDF Document php sql shoopping cart
PDF Document welcome year 2015 using a1040
PDF Document devry cis 336 week 5 group
PDF Document devry cis 336 week 5 group project task 3
PDF Document what is php
PDF Document php ecommerce script


Related keywords