cs 149 advance perl final project implementing an e-commerce shopping cart using cookies presented...
TRANSCRIPT
CS 149 Advance PerlFinal Project
Implementing an E-commerce shopping cart using cookies
Presented by Dzung Tran
Description The project is an online shopping website User may buy items at different quantity At time of checkout a cookie is use to
retrieve the items in the user’s shopping cart After buying the item, the user may have the
option to have the invoice sent to their email Make sure to enable cookies to test this
project
Partial walkthrough of the website
1. Begin at start.cgi2. Click on image of RC Helicopter3. Buy 2 items, click “Add to shopping cart”4. Click on Process to checkout to see item in
shopping cart5. Change quantity to 4, click “Update Qty”6. Enter email address, then click “Buy”7. Congratulations, you have bought your first
item on the site.
Explaination on how things work
A cookie is inserted to the user’s browser when first enter start.cgi
This cookie information will be inserted into gen35_cart_cookies table.
The cookie contains a session ID of the user, the cookie will be kept for 7days.
Products are displayed by retrieving the gen35_items database table information
Continue… When the user click on the product link, they
are routed to shopping.cgi, a product id parameter are also passed to the page.
On shopping.cgi page, when user click on “Add to shopping cart”, data gets inserted into the gen35_shoppingcart table. This table will store all bought items on the site.
Difficulties & Challenges Had trouble inserting the cookie to the site,
and keeping the cookie session alive throughout the shopping process
Initially didn’t know what to do with the cookie, other then inserting it to the page.
How to make everything work cohesively together, how to show the items, order the item, and how to implement the checkout page
Overcoming the difficulties
Searched the world wide web regarding cookies, also see examples
Read our CGI book on HTTP cookies, used snippets of the code to get the program working.
Through reading on cookies I understand on how to use it.
To make things work together, I went and take a look at Amazon.com and simplify it for my final project.
Disclaimer Try the program at your own risk This program is intended to be a basic
learning vessel into cookies, no heavy loading of features
If program explodes and you find yourself stuck with a core dump file, which had not ever happened on my tests, remove the file and continue at your own risk.