Click here to view a PowerPoint screencast presentation of my site
The design of my shopping cart will be on a seperate page where the user can view and edit the products. On each of the product pages, there will be a add to cart button that the user can press to add their items to the cart. On the carts page, there will be a button to either remove the item completely or add/remove quantities
The way that I am using session to manage my shooping cart is that when a user adds items to their cart, the product type of the items will be added to the session data as an object key. The value for each product type key will be the quantities for each product in an array format. An example of this would be like if a user adds products from multiple product types, this will be the format of item data in the session data: { Console: [ 1, 0, 1 ], Controller: [ 2, 1, 0 ] }
When the purchase button is pressed, the server will check if the user has a cookie or not, if they do not, then the user will be redirected to the login page to sign in or will have to register for an account, while they are there the cookie will give the user a certain amount of time to log in/register, if not completed then they will be sent back to the index page. Now if the user does have a cookie and is logged in, they will be redirected to the invoice. A security concern with this though is that cookies can be accessed and modified.
Once you successfully login, I would provide the user with their username and email in the invoice message. Additionally, if a user is logged in, I would have the page show the logout button instead of the login on the top right of the page instead with the username i.e. [Logout {users_name}], if they ever want to logout you can logout using that button
I have no partner
For Assignment 3, there is not a lot of code to do when comapring it to Assignment 2, but there is a lot more in thinking about how exactly you want your website to be displayed. That is why I am going to work on Assignment 3 bit by bit rather than cramming all of the work at once like I did with Assignment 2.