Giter Site home page Giter Site logo

shopping-cart's Introduction

shopping-cart

A simple shopping cart frontend written. In this exercise, you will be implementing a Shopping Cart Page. Provided for you is a simple HTML page with Bootstrap that shows items and a section for the shopping cart your task is to implement the following features:

  • An Add to Cart Button for each item
  • Display the items in the shopping cart.
  • Display the subtotal, tax, and total (you can assume just one percentage like 10% for tax no matter what).
  • Display a form for the user to enter their Shipping Information.
  • A Submit button that will alert that the order has been sent (note, nothing is actually sent, just testing it does something when clicked.

Bonus Missions

  • Implement Validation ensure the fields are filled with correct type of information.
  • Calculate the Tax Rate based on Zip Code via a website called Avalera.

Tips:

In this assignment, a lot of data will be represented on the web page. It's a good practice to think of the "state" of the web page, that is, what are the variables and data that you need to know. For example, you may want to represent the order items as an array of objects where each object contains the name and price for display.

const orderItems = [
  {
    name: 'Some Item',
    price: 9.99
  },
  // ...
];

From there, you can "render" the cart by writing a function that takes this information and constructs it in a certain spot. Any changes, clears out the parent element, and re-renders using the same function. You can clear the parent element by doing the following in jQuery.

$(SOME_SELECTOR).empty()

In addition, for displaying price, the toFixed function is quite useful.

shopping-cart's People

Contributors

kmcgrady avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.