summaryrefslogtreecommitdiff
path: root/StoneIsland/www/js/lib/cart/CartShipping.js
diff options
context:
space:
mode:
Diffstat (limited to 'StoneIsland/www/js/lib/cart/CartShipping.js')
-rwxr-xr-xStoneIsland/www/js/lib/cart/CartShipping.js17
1 files changed, 16 insertions, 1 deletions
diff --git a/StoneIsland/www/js/lib/cart/CartShipping.js b/StoneIsland/www/js/lib/cart/CartShipping.js
index 536b5161..ef8f94b7 100755
--- a/StoneIsland/www/js/lib/cart/CartShipping.js
+++ b/StoneIsland/www/js/lib/cart/CartShipping.js
@@ -129,7 +129,22 @@ var CartShipping = FormView.extend({
success: function(){
app.router.go('cart/payment')
},
-
+
+ error: function(res){
+ console.log('error', res.responseJSON)
+ var data = res.responseJSON || { 'Error': { 'Description': 'Unknown' } }
+ const errors = []
+ switch(data['Error']['Description']) {
+ case 'InvalidFormatParameterException:AddressPostalCode':
+ errors.push(['ZipCode', 'Please enter a valid US/Canada Zip Code.'])
+ break
+ default:
+ errors.push(['', 'An unknown error occured.'])
+ break
+ }
+ this.show_errors(errors)
+ },
+
cancel: function(){
app.router.go('cart/summary')
},