diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2018-07-24 15:06:18 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2018-07-24 15:06:18 +0200 |
| commit | a0b5692d077544ea2f44b41ed72f0b3c26b3dcf6 (patch) | |
| tree | d461abcd7a8161fbdd301a639c6ec4f0cc9f04be /StoneIsland/www/js/lib/cart/CartShipping.js | |
| parent | 656fe312be45b2838f9c5397abaa244472c3d0ea (diff) | |
zipcode check, other error field checkz
Diffstat (limited to 'StoneIsland/www/js/lib/cart/CartShipping.js')
| -rwxr-xr-x | StoneIsland/www/js/lib/cart/CartShipping.js | 17 |
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') }, |
