diff --git a/ko-cart/index.html b/ko-cart/index.html index fa0885c..9386d48 100644 --- a/ko-cart/index.html +++ b/ko-cart/index.html @@ -10,17 +10,9 @@
- +
- +
@@ -163,7 +155,44 @@ Confirm Order - + diff --git a/ko-cart/js/viewmodel.js b/ko-cart/js/viewmodel.js index c09e1bf..128c856 100644 --- a/ko-cart/js/viewmodel.js +++ b/ko-cart/js/viewmodel.js @@ -101,6 +101,18 @@ var vm = (function () { $('#orderContainer').removeClass("hidden"); } + // The order template + var showCatalog = function () { + $("#catalogContainer").removeClass("hidden"); + $("$orderContainer").addClass("hidden"); + }; + var finishOrder = function() { + cart([]); + hideCartDetails(); + showCatalog(); + $("#finishOrderModal").modal('show'); + } + return { // first chapter searchTerm: searchTerm, @@ -114,7 +126,9 @@ var vm = (function () { grandTotal: grandTotal, removeFromCart: removeFromCart, hideCartDetails: hideCartDetails, - showOrder: showOrder + showOrder: showOrder, + showCatalog: showCatalog, + finishOrder: finishOrder }; })(); ko.applyBindings(vm);