Home arrow PHP arrow Page 11 - Building an E-Commerce Site Part 3: Catalogs and Shopping Carts

Step 4: New Shopping Scripts - PHP

This is the third and final article in a three-part series dealing with using PHP 4 and MySQL to make a comprehensive e-commerce storefront solution. This article covers the shopping cart, payment processing, and database engine considerations, among many other topics. Full source code included!

TABLE OF CONTENTS:
  1. Building an E-Commerce Site Part 3: Catalogs and Shopping Carts
  2. Assumptions and Requirements
  3. Overview of The Process
  4. MyMarket Shopping Experience
  5. The Product Catalog
  6. The Shopping Cart
  7. Payment Processing
  8. Step 1: Database Changes
  9. Step 2: Extracting the New Scripts
  10. Step 3: General Script Changes from Tutorial 2
  11. Step 4: New Shopping Scripts
  12. Conclusion
By: Ying Zhang
Rating: starstarstarstarstar / 50
June 08, 2000

print this article
SEARCH DEV SHED

TOOLS YOU CAN USE

advertisement

We've gone over the general script changes, let's go through the product catalog, shopping cart, and purchaseing scripts (collectively called the shopping scripts). These are in the brand new shopping directory.

shopping/index.php

The main shopping index page is our product catalog page. I will display information for the selected level category (remember our discussion way before about what to show when going throught he product catalog -- it is all here in this one file!). If no category is specified, it will start from the top level category.

shopping/product_details.php

This script simply loads up the details for the specified product and displays it on the screen. When a user is viewing the product details page, they can add the product to their shopping cart.

shopping/cart_add.php

This is a very simple script that adds the selected product to the shopping cart. This script is so simple that it does not even display anything, it just adds to the shopping cart and sends the customer back to where they came from.

shopping/cart_view.php

Viewing the shopping cart is a bit more work than adding to the cart. We have to show the customer the contents of their shopping cart. From here, the customer can choose to empty the shopping cart, to update the quantities of the items in the cart, or to make the purchase.

shopping/purchase_now.php

When the user decides to make the purchase, they will go to this script. At this point, we need to have the user log in so that we know who they are (up till this point, we didn't care). This screen prompts the user for their billing information, and to specify and special instructions or comments for the purchase. After the user submits their information, they are asked to confirm the order.

shopping/complete_order.php

The user has filled out their purchase information, and confirmed the order. It is the responsibility of this script to talk to the payment authorization party and try to process they payment. As described earlier, this is the tricky part that requires your attention. I only provide a template of what should happen.



 
 
>>> More PHP Articles          >>> More By Ying Zhang
 

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort
   

PHP ARTICLES

- Hackers Compromise PHP Sites to Launch Attac...
- Red Hat, Zend Form OpenShift PaaS Alliance
- PHP IDE News
- BCD, Zend Extend PHP Partnership
- PHP FAQ Highlight
- PHP Creator Didn't Set Out to Create a Langu...
- PHP Trends Revealed in Zend Study
- PHP: Best Methods for Running Scheduled Jobs
- PHP Array Functions: array_change_key_case
- PHP array_combine Function
- PHP array_chunk Function
- PHP Closures as View Helpers: Lazy-Loading F...
- Using PHP Closures as View Helpers
- PHP File and Operating System Program Execut...
- PHP: Effects of Wrapping Code in Class Const...

Developer Shed Affiliates

 


Dev Shed Tutorial Topics: