项目作者: amaechi-chuks

项目描述 :
ShoppingCart
高级语言: HTML
项目地址: git://github.com/amaechi-chuks/SUPERMART-EXPRESS-NIGERIA.git
创建时间: 2018-07-16T12:55:43Z
项目社区:https://github.com/amaechi-chuks/SUPERMART-EXPRESS-NIGERIA

开源协议:

下载


SUPERMART-EXPRESS-NIGERIA

Introduction

Create a ShoppingCart class with the following attributes
items(variable): a member variable for collection of cart item, item name as key, item quantity as value
deliveryFee(variable): the variable that hold the value of delivery fee which is calculated based on the number of item in the collection of item (50 Naira per cart Item)
netTotal(variable): total amount of item in the cart
grossTotal(variable): total amount of everything, price of item and delivery fee
calculateDeliveryFee: function=>returns calculated delivery fee based on items
addItem(name, quantity, price): function=add item to the shopping cart
removeItem(name, quantity, price): function=>remove item from shopping cart
checkout(paid_amount): function=>if paid_amount is smaller than the amount to be paid return “Insufficient fund” else clear the cart and return the balance
Create a CouponShoppingCart with all the attributes above but SUPERMART_DEV Coupon will reduce the amount to be paid by 1000 Naira

Instructions

Click the “add to cart” button beneath the item that you want to purchase. The Item will then show up in a cart at the bottom along with your current subtotal.

To remove an item from the cart simply click the Item in the cart area that you want to remove

After you have selected and removed all items and are ready to checkout click the “checkout” button at the bottom. Your total with deliveryFee will be shown along with a “pay now” button.
deliverFee is 5% of each item

To pay simply click the “pay now” button

Live Demo

Click below to preview live demo