Merge branch 'master' into order-delivery-flow

This commit is contained in:
Almira Krdzic
2018-11-04 11:17:42 +01:00
23 changed files with 1745 additions and 459 deletions

View File

@@ -65,7 +65,7 @@ export const cartMessages = {
QUANTITY_UPDATED: "Quantity has been updated for the package!",
INVALID_PACKAGE_FOR_REMOVE: "This package is not available in your cart! In case this error persists contact Co-Market!",
PACKAGE_REMOVED_FROM_CART: "The package has been removed from the cart!",
INVALID_QUANTITY: "The quantity can be a number between 1 and 100!",
INVALID_QUANTITY: "The quantity can be a number between 1 and 65000!",
CART_EMPTY: "You must have at least one package in the cart!",
NO_DELIVERY_ADDRESS: "No delivery address was added! Please fill the necessary info",
INCOMPLETE_DELIVERY_ADDRESS: "Incomplete delivery address. Please review!",

View File

@@ -32,7 +32,7 @@ export const coMarketMessages = {
QUANTITY_UPDATED: "Quantity has been updated for the package!",
INVALID_PACKAGE_FOR_REMOVE: "This package is not available in your cart! In case this error persists contact the Co-Market!",
PACKAGE_REMOVED_FROM_CART: "The package has been removed from the cart!",
INVALID_QUANTITY: "The quantity can be a number between 1 and 100!",
INVALID_QUANTITY: "The quantity can be a number between 1 and 65000!",
CART_EMPTY: "You must have at least one package in the cart!",
NO_DELIVERY_ADDRESS: "No delivery address was added! Please fill the necessary info",
INCOMPLETE_DELIVERY_ADDRESS: "Incomplete delivery address. Please review!",

View File

@@ -35,13 +35,13 @@ class CartItem extends Component {
}
isQuantityValid(quantity) {
return quantity > 0 && quantity <= 100;
return quantity > 0 && quantity <= 65000;
}
updateQuantity(cartItem, quantity) {
if(quantity) {
this.setState({itemQuantity: quantity});
if(this.isQuantityValid(quantity)) {
this.setState({itemQuantity: quantity});
this.sumPrices(cartItem, quantity);
this.props.dispatch(updateQuantity(cartItem, quantity));
} else {