Skip to content
Snippets Groups Projects
Commit d3720ff2 authored by Will Billingsley's avatar Will Billingsley
Browse files

Added missing grocery_shop variable

parent 81568c89
No related branches found
No related tags found
No related merge requests found
......@@ -209,11 +209,7 @@ In the index.html file we have specified a global variable called `grocery_shop`
* Welcome users to the shop
* Allow the users to choose which isle they are shopping in
* Allow the users to add items to their cart
* For simplicities sake, all items will have a drop-down that has pre-determined quantities and costs.
* Costs for the items are defined in the JSON.
* Users should be able to add multiple of the same item to their cart
* Have a check-out page that displays the cart in a table, each row containing the item, per instance cost, amount, and how much it is in total.
* The check-out page should also display the total
* The check-out page should allow users to cancel their order for an item.
* This shouldn't get confused if I order e.g. "3 apples" and "5 apples" separately and cancel the "3 apples" - I still want "5 apples"!
* Below the items, the page should also display the running total cost of the order
\ No newline at end of file
We might use a different `grocery_shop` value that follows the same structure for marking.
......@@ -38,6 +38,38 @@
<script src="provided.js"></script>
<script>
grocery_shop = {
aisles: [
{
name: "fruit and veg",
items: [
{ name: "apples", cost: "4.50", per: "kg" },
{ name: "bananas", cost: "3.50", per: "kg" },
{ name: "mandarins", cost: "2.50", per: "kg" }
]
},
{
name: "bakery",
items: [
{ name: "sandwich loaf", cost: "2.50", per: "ea" },
{ name: "tiger loaf", cost: "3.50", per: "ea" },
{ name: "baguette", cost: "2.50", per: "ea" },
{ name: "cob", cost: "1.50", per: "ea"}
]
},
{
name: "biscuits",
items: [
{ name: "jaffa cakes", cost: "2.50", per: "200g" },
{ name: "fig rolls", cost: "3.50", per: "150g" },
{ name: "jam drops", cost: "2.50", per: "300g" }
]
}
]
}
</script>
<script src="studentcode.js"></script>
</body>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment