Link to: Video
My shopping cart is my invoice.html changed to shopping_cart.html. Each product has an “add to cart” button that can be used one at a time. The selected quantities will be accessible in the shopping cart. There is also a navigation bar on every page with a product key that allows users to access products seamlessly without having several html pages. If the quantity is valid, the user will be redirected to the shopping cart where they can make changes or finalize their decision before purchasing the product.
I will utilize sessions to keep track of how much data the user enters into the session, including the product type, which links to the page of products they were on and the arrays that were selected using the product key. The product’s index and the requested quantity will also be included in the session. Despite conditional statements being endless, it’s currently what I’m working with at this level. With request.session.cart on the server, I can continue to make if statements to take quantities in the cart and increment or reduce the amount depending on the goal of each button.
Example: if (typeof request.session.cart == ‘undefined’) { request.session.cart = {}; //empty cart object }
I haven’t got to this step, but I plan on denying access to the final purchase if the user isn’t logged in or registered. I will allow non users to access my shopping cart only if they have selected quantities, but users must be logged in to purchase. This is because I noticed that many online shopping sites do this so that users can keep track of their items, but in this case, users must be logged in or registered to officially make the purchase. The security risk is that if the user is not logged in, they may still be able to obtain the invoice.
I personalize my UI by thanking the user with their name and I also include their email to ensure that the information will be sent to them. In order to achieve this, I will use cookies to store the user information. Then, I will request the cookie to get the customer’s name to display on the page. For instance, a conditional statement would start of as: if (getCookie(‘user_info’) != false)
I am not working with a partner.
In Assignment 3, I definitely spent more time planning the visual aspect instead of going straight to the code. Although I attempted to experiment with code, I quickly realized that the best method was to analyze my own code to alter the code because the changes are very little since Assignment 3 has similarities to Assignment 2. I am also focusing more on the design to make the website more flexible and convenient to the user, this takes more thought than the previous assignment. I’m also looking at online sites that I shop at for inspiration and I also notice more details that I haven’t before as a consumer.