diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2018-07-24 18:41:15 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2018-07-24 18:41:15 +0200 |
| commit | 28553fe863564b44f810eacc0ce3f45608346297 (patch) | |
| tree | 057febb8a68355257048ebb1eae5b5a44b2b6341 /StoneIsland/platforms/ios/www/js/lib/cart/CartShipping.js | |
| parent | b6774fedca6a535e9f863d4bb72d87f46c47a59b (diff) | |
build the thing....
Diffstat (limited to 'StoneIsland/platforms/ios/www/js/lib/cart/CartShipping.js')
| -rwxr-xr-x | StoneIsland/platforms/ios/www/js/lib/cart/CartShipping.js | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/StoneIsland/platforms/ios/www/js/lib/cart/CartShipping.js b/StoneIsland/platforms/ios/www/js/lib/cart/CartShipping.js index 536b5161..ef8f94b7 100755 --- a/StoneIsland/platforms/ios/www/js/lib/cart/CartShipping.js +++ b/StoneIsland/platforms/ios/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') }, |
