diff --git a/front-ui/app/components/cart/cartPage.js b/front-ui/app/components/cart/cartPage.js index 307217f..7820029 100644 --- a/front-ui/app/components/cart/cartPage.js +++ b/front-ui/app/components/cart/cartPage.js @@ -32,7 +32,6 @@ var CartPage = React.createClass({ product image -

{i.get('brand').name}

@@ -42,12 +41,9 @@ var CartPage = React.createClass({ { Globals.FormatCurrency(price) } - { Globals.FormatCurrency(count * price) } - - diff --git a/front-ui/app/stores/cartStore.js b/front-ui/app/stores/cartStore.js index 7759b59..7ba3ac6 100644 --- a/front-ui/app/stores/cartStore.js +++ b/front-ui/app/stores/cartStore.js @@ -18,6 +18,7 @@ var states = {} var _itemsInCart = new ItemInCartCollection(); var _itemsForDisplay = new ItemCollection(); _itemsForDisplay.setFromCart(true); + var _deliveryDestination = new DeliveryDestination(); var _deliveryDestinationErrors = {}; var _deliveryCosts = new Place({ @@ -26,10 +27,8 @@ var _deliveryCosts = new Place({ var _cartDataLoadCalled = false; - var loadCart = function() { - states = {}; _itemsInCart.fetch({ success: function() { states = {} @@ -37,26 +36,22 @@ var loadCart = function() { var itemInCart = _itemsInCart.models[i]; states[itemInCart.get('item_id')] = itemInCart; } - CartActions.dataLoaded(); + _itemsForDisplay.fetch({ + success: function() { + CartActions.dataLoaded(); + } + }); } }); - _itemsForDisplay.fetch({ - success: function() { - CartActions.dataLoaded(); - } - }); - - _deliveryDestination.fetch({ - success: function() { - validateDeliveryDestinationForm(); - fetchPlace(); - CartActions.dataLoaded(); - } - }); - + //_deliveryDestination.fetch({ + //success: function() { + //validateDeliveryDestinationForm(); + //fetchPlace(); + //CartActions.dataLoaded(); + //} + //}); _cartDataLoadCalled = true; - }; @@ -265,7 +260,6 @@ AppDispatcher.register(function(payload) { var text; switch (action.actionType) { - case CartConstants.LOAD_CART_CONTENTS: loadCart(); break; diff --git a/front-ui/app/stores/itemStore.js b/front-ui/app/stores/itemStore.js index 37a89d6..a4bb6cf 100644 --- a/front-ui/app/stores/itemStore.js +++ b/front-ui/app/stores/itemStore.js @@ -34,7 +34,9 @@ var getItemIdFromUrl = function() { var itemIdRegex = /artikal\/(\d+)\//g; var match = itemIdRegex.exec(url); - return match[1]; + if (match) { + return match[1]; + } }; var fetchItemWithDetails = function() { @@ -191,4 +193,4 @@ AppDispatcher.register(function(payload) { }); -module.exports = ItemStore; \ No newline at end of file +module.exports = ItemStore;