Adding Cart id for order number
This commit is contained in:
@@ -10,6 +10,7 @@ var DeliveryDestination = require('../models/deliveryDestination');
|
||||
var OrderConfirmation = require('../models/orderConfirmation');
|
||||
var Place = require('../models/place');
|
||||
var Validation = require('../utils/validation');
|
||||
var Cart = require('../models/cart');
|
||||
|
||||
var _ = require('underscore');
|
||||
|
||||
@@ -25,6 +26,8 @@ var _deliveryCosts = new Place({
|
||||
postalCode: _deliveryDestination.get('place')
|
||||
});
|
||||
|
||||
var _cart = new Cart();
|
||||
|
||||
var _addressColapsed = false;
|
||||
|
||||
var supportedPlaces = [{
|
||||
@@ -2568,29 +2571,31 @@ var nameOfThePlace = function(code) {
|
||||
}
|
||||
|
||||
var loadCart = function() {
|
||||
_itemsInCart.fetch({
|
||||
success: function() {
|
||||
states = {}
|
||||
for (var i = 0; i < _itemsInCart.models.length; i++) {
|
||||
var itemInCart = _itemsInCart.models[i];
|
||||
states[itemInCart.get('item_id')] = itemInCart;
|
||||
}
|
||||
_itemsForDisplay.fetch({
|
||||
success: function() {
|
||||
CartActions.dataLoaded();
|
||||
_cart.fetch({success: function() {
|
||||
_itemsInCart.fetch({
|
||||
success: function() {
|
||||
states = {}
|
||||
for (var i = 0; i < _itemsInCart.models.length; i++) {
|
||||
var itemInCart = _itemsInCart.models[i];
|
||||
states[itemInCart.get('item_id')] = itemInCart;
|
||||
}
|
||||
_itemsForDisplay.fetch({
|
||||
success: function() {
|
||||
CartActions.dataLoaded();
|
||||
|
||||
_deliveryDestination.fetch({
|
||||
success: function() {
|
||||
validateDeliveryDestinationForm();
|
||||
collapseAddressIfNeeded();
|
||||
fetchPlace();
|
||||
CartActions.dataLoaded();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
_deliveryDestination.fetch({
|
||||
success: function() {
|
||||
validateDeliveryDestinationForm();
|
||||
collapseAddressIfNeeded();
|
||||
fetchPlace();
|
||||
CartActions.dataLoaded();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}});
|
||||
|
||||
_cartDataLoadCalled = true;
|
||||
};
|
||||
@@ -2875,7 +2880,8 @@ var CartStore = _.extend({}, EventEmitter.prototype, {
|
||||
deliveryCosts: _deliveryCosts,
|
||||
destinationValid: isDeliveryDestinationValid(),
|
||||
address_colapsed: _addressColapsed,
|
||||
deliveryCostsTarget: getDeliveryCostTarget()
|
||||
deliveryCostsTarget: getDeliveryCostTarget(),
|
||||
cart: _cart
|
||||
};
|
||||
return state;
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user