For simplicity, we will shorten the Checkout
process by skipping some steps. We have modified the process so that we can only have one product per order; we will also skip the updating of shipping details and the customer order confirmation steps:
Create tables to hold the products and orders data:
CREATE TABLE IF NOT EXISTS store_products ( id int(11) NOT NULL AUTO_INCREMENT, name varchar(255) NOT NULL, desc varchar(255) NOT NULL, cost float(9,2) NOT NULL, PRIMARY KEY (id) ); CREATE TABLE IF NOT EXISTS store_orders ( id int(11) NOT NULL AUTO_INCREMENT, store_product_id int(11) NOT NULL, qty int(11) NOT NULL, total float(9,2) NOT NULL, status enum('new', 'completed', 'shipped', 'cancelled') DEFAULT NULL, stamp timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, first_name varchar(255) DEFAULT NULL, last_name varchar(255) DEFAULT NULL, email varchar(255) DEFAULT NULL, ship_to_street varchar(255) DEFAULT NULL, ship_to_city...