1 / 9

PHP – Chapter 27

PHP – Chapter 27. Building A Shopping Cart. Shopping Cart Implementation. A database of products to sell online An online catalog of products, listed by category A shopping cart to track items users want to buy A checkout script that processes payments An administration interface.

manny
Télécharger la présentation

PHP – Chapter 27

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. PHP – Chapter 27 Building A Shopping Cart CIS 305

  2. Shopping Cart Implementation • A database of products to sell online • An online catalog of products, listed by category • A shopping cart to track items users want to buy • A checkout script that processes payments • An administration interface CIS 305

  3. The Book-O-Rama Shopping Car Problem • Need to connect database to user’s browsers, so they are able to browse items by category • Users should be able to select items for later purchase • When they’re done, you need to total their order, take delivery details, and process payments • You will need an administration interface so that administrators can add and edit books and categories CIS 305

  4. User Views CIS 305

  5. Administrator Views CIS 305

  6. System Modules • Catalog • index.php, show_cat.php, show_book.php • Shopping cart and order processing • show_cart.php, checkout.php, purchase.php, process.php • Administration • login.php, logout.php, admin.php, change_password_form.php, etc… • Function Libraries • book_sc_fns.php, admin_fns.php, book_fns.php, order_fns.php, output_fns.php, data_valid_fns.php, db_fns.php, user_auth_fns.php CIS 305

  7. Book-O-Rama database tables create table customers1 ( customerid int unsigned not null auto_increment primary key, name char(60) not null, address char(80) not null, city char(30) not null, state char(20), zip char(10), country char(20) not null ); create table orders1 ( orderid int unsigned not null auto_increment primary key, customerid int unsigned not null, amount float(6,2), date date not null, order_status char(10), ship_name char(60) not null, ship_address char(80) not null, ship_city char(30) not null, ship_state char(20), ship_zip char(10), ship_country char(20) not null ); CIS 305

  8. Book-O-Rama database tables Other tables: books1, categories1, order_items1, and admin1 • Transaction safe: type=InnoDB • Requires the use of • autocommit(FALSE), commit(), autocommit(TRUE); CIS 305

  9. Bool-O-Rama Shopping Cart • Demo • Expanding the project: • Build an order tracking system • Add file upload for book pictures, etc. • Add book recommendations, online reviews, stock level checking, etc… • FishCartSQL: http://www.fishcart.org/ CIS 305

More Related