From 0f114b0fe0a2cf9ce26481beeb48ce23d557fd25 Mon Sep 17 00:00:00 2001 From: Nemanja Popovic Date: Tue, 15 Dec 2015 14:11:44 +0100 Subject: [PATCH] 1.0.0 --- .gitignore | 3 +- config/karma.conf.js | 14 +- public/img/ico_default.png | Bin 0 -> 2138 bytes public/index.html | 23 +- .../app/account/controllers/account-ctrl.js | 23 +- .../app/account/services/account-service.js | 9 +- public/js/app/account/templates/account.html | 15 +- .../app/account/templates/address-form.html | 9 +- .../js/app/account/templates/addresses.html | 15 +- .../directives/localized-addresses.js | 58 +- .../js/app/addresses/templates/billingCA.html | 17 +- .../js/app/addresses/templates/billingCN.html | 18 +- .../js/app/addresses/templates/billingDE.html | 15 +- .../js/app/addresses/templates/billingGB.html | 15 +- .../js/app/addresses/templates/billingJP.html | 20 +- .../js/app/addresses/templates/billingUS.html | 18 +- .../app/addresses/templates/shippingCA.html | 18 +- .../app/addresses/templates/shippingCN.html | 18 +- .../app/addresses/templates/shippingDE.html | 17 +- .../app/addresses/templates/shippingGB.html | 16 +- .../app/addresses/templates/shippingJP.html | 19 +- .../app/addresses/templates/shippingUS.html | 19 +- public/js/app/cart/services/cart-rest.js | 12 + public/js/app/cart/services/cart-service.js | 5 +- public/js/app/cart/templates/cart-costs.html | 7 +- .../controllers/checkout-cart-ctrl.js | 10 +- .../app/checkout/controllers/checkout-ctrl.js | 162 +++++- .../directives/mobile-checkout-wizard.js | 3 +- .../js/app/checkout/services/checkout-rest.js | 14 + .../app/checkout/services/checkout-service.js | 5 +- .../app/checkout/templates/checkout-cart.html | 4 +- .../app/checkout/templates/checkout-form.html | 29 +- .../checkout/templates/checkout-frame.html | 5 +- public/js/app/errors/backendStub.js | 57 ++ .../app/orders/services/order-list-service.js | 4 +- public/js/app/orders/services/orders-rest.js | 4 +- .../controllers/product-detail-ctrl.js | 20 +- .../products/templates/product-detail.html | 3 + .../app/products/templates/product-list.html | 1 + .../search/controllers/search-list-ctrl.js | 3 + .../js/app/search/templates/search-list.html | 4 +- .../js/app/shared/directives/force-scroll.js | 29 + .../site-selector}/site-selector-ctrl.js | 4 +- .../site-selector/site-selector-directive.js | 26 + .../site-selector}/site-selector-service.js | 0 .../site-selector/site-selector.html | 31 + public/js/app/shared/directives/y-search.js | 12 +- public/js/app/shared/directives/y-tracking.js | 93 ++- public/js/app/shared/http-proxy.js | 12 +- public/js/app/shared/i18n/lang/de.js | 36 +- public/js/app/shared/i18n/lang/en.js | 536 ++++++++++-------- public/js/app/shared/router.js | 37 +- .../shared/services/configuration-service.js | 4 +- public/js/app/shared/services/cookie-svc.js | 21 + public/js/app/shared/services/global-data.js | 16 +- public/js/app/shared/settings.js | 1 + public/js/app/shared/site-config.js | 36 +- public/js/app/shared/templates/footer.html | 49 +- .../app/shared/templates/shipping-dialog.html | 27 + .../app/shared/templates/top-navigation.html | 71 ++- public/js/app/shared/templates/ysearch.html | 46 +- .../js/app/shipping/services/shipping-rest.js | 36 ++ .../app/shipping/services/shipping-service.js | 124 ++++ public/less/_account.less | 4 + public/less/_cart.less | 6 + public/less/_global.less | 52 ++ public/less/_modals.less | 26 +- public/less/_navigation.less | 86 ++- public/less/_pdp-carousel.less | 1 - public/less/_variables.less | 3 +- test/e2e/cart-tests.js | 76 +-- test/e2e/checkout-tests.js | 94 +-- test/e2e/coupon-tests.js | 134 ++--- test/e2e/login-tests.js | 25 +- test/e2e/product-tests.js | 31 +- test/e2e/protractor-utils.js | 74 ++- .../addresses/localized-addresses-spec.js | 20 +- test/unit/checkout/checkout-ctrl-spec.js | 214 ++++++- test/unit/checkout/checkout-svc-spec.js | 13 +- .../checkout/mobile-checkout-wizard-spec.js | 10 +- .../unit/products/product-detail-ctrl-spec.js | 5 +- test/unit/shared/force-scroll-spec.js | 33 ++ test/unit/shared/y-tracking-spec.js | 34 +- test/unit/shared/ysearch-spec.js | 6 +- 84 files changed, 2072 insertions(+), 853 deletions(-) create mode 100644 public/img/ico_default.png create mode 100644 public/js/app/shared/directives/force-scroll.js rename public/js/app/shared/{controllers => directives/site-selector}/site-selector-ctrl.js (90%) create mode 100644 public/js/app/shared/directives/site-selector/site-selector-directive.js rename public/js/app/shared/{services => directives/site-selector}/site-selector-service.js (100%) create mode 100644 public/js/app/shared/directives/site-selector/site-selector.html create mode 100644 public/js/app/shared/templates/shipping-dialog.html create mode 100644 public/js/app/shipping/services/shipping-rest.js create mode 100644 public/js/app/shipping/services/shipping-service.js create mode 100644 test/unit/shared/force-scroll-spec.js diff --git a/.gitignore b/.gitignore index e5c31fd26..92a6e2f14 100644 --- a/.gitignore +++ b/.gitignore @@ -13,4 +13,5 @@ public/js/app/shared/app-config.js coverage/ config/config.js dist -.DS_Store \ No newline at end of file +.DS_Store +.vscode \ No newline at end of file diff --git a/config/karma.conf.js b/config/karma.conf.js index bf9f80305..7e129c640 100644 --- a/config/karma.conf.js +++ b/config/karma.conf.js @@ -47,7 +47,11 @@ module.exports = function(config){ 'public/js/app/shared/services/http-queue.js', 'public/js/app/shared/services/event-service.js', 'public/js/app/shared/services/local-storage.js', - 'public/js/app/shared/services/site-selector-service.js', + + 'public/js/app/shared/directives/site-selector/site-selector-service.js', + 'public/js/app/shared/directives/site-selector/site-selector-ctrl.js', + 'public/js/app/shared/directives/site-selector/site-selector-directive.js', + 'public/js/app/shared/controllers/sidebar-navigation-ctrl.js', 'public/js/app/shared/controllers/top-navigation-ctrl.js', 'public/js/app/shared/i18n/i18-index.js', @@ -60,6 +64,7 @@ module.exports = function(config){ 'public/js/app/shared/directives/y-tracking.js', 'public/js/app/shared/directives/y-search.js', 'public/js/app/shared/directives/y-inputs-dir.js', + 'public/js/app/shared/directives/force-scroll.js', 'public/js/app/home/home-index.js', 'public/js/app/home/controllers/home-ctrl.js', @@ -94,6 +99,9 @@ module.exports = function(config){ 'public/js/app/checkout/services/checkout-rest.js', 'public/js/app/checkout/services/checkout-service.js', + 'public/js/app/shipping/services/shipping-service.js', + 'public/js/app/shipping/services/shipping-rest.js', + 'public/js/app/confirmation/confirmation-index.js', 'public/js/app/confirmation/controllers/confirmation-ctrl.js', 'public/js/app/confirmation/services/order-details-svc.js', @@ -132,7 +140,6 @@ module.exports = function(config){ 'public/js/app/shared/router.js', 'public/js/app/shared/http-proxy.js', - 'public/js/app/shared/controllers/site-selector-ctrl.js', 'public/js/app/shared/directives/quantity-input.js', 'public/js/app/shared/directives/popover.js', @@ -159,8 +166,7 @@ module.exports = function(config){ 'test/unit/orders/*.js', 'test/unit/products/*.js', 'test/unit/search/*.js', - 'test/unit/shared/*.js', - 'test/unit/shared/*/*.js' + 'test/unit/shared/**/*.js' ], diff --git a/public/img/ico_default.png b/public/img/ico_default.png new file mode 100644 index 0000000000000000000000000000000000000000..dc13899b9d8f44845d1baedd51ae4d008431af21 GIT binary patch literal 2138 zcmaJ?c~nz(7LFo{bZlh_h)8`#iYy^3ArKNMNr*rUB0Dl5S)LFfdD$Rgv5w#Z2(?ND zf`JMKbpWjt*<=bL1RH@-fm3XUii!i&qbTBGUnZeq=Z|6DIq&_JbHDF?_ulWEmmL_e zcZ>0MV;Bs!#m|=>q+9LvuhB-`H+QK~pj)hDJ`u8D=&(%AmVhvC9>f6wKLI-q3-*(;PWVm zZ~_a%64AhTzHh1o3{DLQ;ie{V-FXNvPk^i-=?Da%j14FRi9#t!K|!qWl5~6hH5vh| zgvb&oh(AO{umS-ZBmn^e%GH^RaU}vocNCUDB)Slh01ksCpfPwf9^;I|lUy()7aZ{6 zLFlqcc!x zx_gy@4obNazDUN0gn*ur&4H3+6ogLcA0-GxA8Ccs4{g#l46R^`&{z~kU(#wIi}n9Q z1%i*!QdtoAr{4cbEDcE!f#@Jm3MEOny1^aZtxqK)(Ig;S21!C7C~>umf$@+GlEy@z{IkSEIgZvTH&&4R<%aOdix>n}7M3b&s-SIL2s_ov%3JOl}v zk|J%`wcM$i=gf)H#;hSJW`6&3xVW;BdJA_Yk5Un6*dvdz%$z;uWZYv0WyzHb3^B>N zJ?wR24MUbSukm>9+c^eDXYJS-%l+QGuh%icsnje}Re!N#ezlrzQ3 zCCewj`0YGYKe5Z{t!7k-kGDMg;v}V{KIueWxMqEr$hiea+H?J^cVONv4qN3Ibzv1V! zxrpQYm4LBx^UT=q8%BJ;;+_1?v~Vl>fob>;sXY;3#Ez8k95N z(RZuoJ-phE%-i;K&eR-XQ6Nk*HagUq_DF3}sJ+Cjt9nYmI%zY*tl`uM2~~Kc9c?x# zrl4nP%kq8+yjo0h{r0A+`IAxkZ&y#*Vr;K08}ihxNjc`Z)XdQBUWI{e$vEu*$4iWM z5Ynm3)xn)M!;T7|)q3vln0nO`&gaCxC&8od^OBdmg_TtzMA|Xm&zf!z_!-Tr5vcr- z>EVg;fz3{4y}3QezX^lbD~ z{WNqrn+?WP7Bf)Mf4wBh^o^U}FtvO)x~;RQFY4z6YoD;FdU$&iIq`I6<|J>&NCPm#LPpi91HL@aOuliN1?Tx{Mrtwq{ z63XA5UA*w5KpktTrO;oh-XZD5|1fwwPBvtO_bPeoM)T6oSMZE4M9+j;i*FLkhVG4h zqlnK5h-}@s@3viFlmDojdydGgflbP)qs)Ff-cxkb<3YzR2eD)5yM01nYTA*%oIAK9 zwf1d&(Q*EHUW>HiobA~ItOn^$X;j8+Twu!8+ZR*L!N+_Ro~pjcUga=mbp4(5aq&y< zq3U2|)un%3-?%W^equCi(bGELqHE%jZ(Et_cy#20$6GW{J}Z`f*IB_$=$`zfN%I4@ zecj+|GVKfVJ=b#ys29by7vGuws4{p+*c`s&sMgN0EF}C6|IM}L#x~s7!|@TcvMB8) x`r^UHhl#cm5K?{Lex%^o?*8ex*~LPb0qlOJ(S6*gLx=uv@8=Uhzd?=7_z&8ld}aUu literal 0 HcmV?d00001 diff --git a/public/index.html b/public/index.html index de716108f..1286eee9a 100644 --- a/public/index.html +++ b/public/index.html @@ -1,5 +1,5 @@ - + @@ -21,11 +21,11 @@ -
- +
+
-
-
+
+
@@ -54,7 +54,7 @@ - + @@ -72,6 +72,7 @@ + @@ -79,8 +80,11 @@ - - + + + + + @@ -126,6 +130,8 @@ + + @@ -164,7 +170,6 @@ - diff --git a/public/js/app/account/controllers/account-ctrl.js b/public/js/app/account/controllers/account-ctrl.js index 0c3742486..e9f7b3576 100644 --- a/public/js/app/account/controllers/account-ctrl.js +++ b/public/js/app/account/controllers/account-ctrl.js @@ -19,7 +19,7 @@ angular.module('ds.account') var modalInstance; var originalAccountData; - var customerNumber = account.customerNumber; + var customerNumber = !!account ? account.customerNumber : null; var notSet = ''; $translate('NOT_SET').then(function(value){ notSet = value; @@ -86,7 +86,7 @@ angular.module('ds.account') if (response.data && response.data.details && response.data.details.length) { errors = response.data.details; } - } else if (response.status === 403 || response.status === 409 || response.status === 401 || response.status === 404 || response.status === 500) { + } else if (response.status === 403 || response.status === 409 || response.status === 401 || response.status === 404) { if (response.data && response.data.message) { errors.push({ message: response.data.message }); } @@ -94,6 +94,14 @@ angular.module('ds.account') return errors; }; + var extractAddressErrors = function (response, errorMsg) { + var errors = extractServerSideErrors(response); + if (response.status === 500) { + errors.push({ message: errorMsg }); + } + return errors; + }; + // handle dialog dismissal if user select back button, etc $scope.$on('$destroy', function () { if (modalInstance) { @@ -110,7 +118,8 @@ angular.module('ds.account') modalInstance.close(); }, function (response) { - $scope.errors = extractServerSideErrors(response); + $scope.errorAddressId = null; + $scope.errors = extractAddressErrors(response, $translate.instant('SAVE_ADDRESS_ERROR')); } ); } else { @@ -166,7 +175,6 @@ angular.module('ds.account') $scope.removeAddress = function (address) { address.account = customerNumber; - $translate('CONFIRM_ADDRESS_REMOVAL').then(function( msg){ if (window.confirm(msg)) { AccountSvc.removeAddress(address).then( @@ -174,7 +182,8 @@ angular.module('ds.account') $scope.refreshAddresses(); }, function (response) { - $scope.errors = extractServerSideErrors(response); + $scope.errorAddressId = address.id; + $scope.errors = extractAddressErrors(response, $translate.instant('REMOVE_ADDRESS_ERROR')); } ); } @@ -199,7 +208,9 @@ angular.module('ds.account') $scope.refreshAddresses(); }, function (response) { - $scope.errors = extractServerSideErrors(response); + $scope.refreshAddresses(); + $scope.errorAddressId = address.id; + $scope.errors = extractAddressErrors(response, $translate.instant('UPDATE_DEFAULT_ADDRESS_ERROR')); } ); }; diff --git a/public/js/app/account/services/account-service.js b/public/js/app/account/services/account-service.js index b5480805c..4a6abe7e4 100644 --- a/public/js/app/account/services/account-service.js +++ b/public/js/app/account/services/account-service.js @@ -29,7 +29,9 @@ angular.module('ds.account') account: function() { var promise = AuthREST.Customers.all('me').customGET(); promise.then(function(success){ - GlobalData.customerAccount = success.plain(); + if (success) { + GlobalData.customerAccount = success.plain(); + } }); return promise; }, @@ -44,7 +46,9 @@ angular.module('ds.account') getAddresses: function(query) { var addressesPromise = AuthREST.Customers.all('me').all('addresses').getList(query); addressesPromise.then(function(response) { - GlobalData.addresses.meta.total = parseInt(response.headers[settings.headers.paging.total.toLowerCase()], 10) || 0; + if (response.headers) { + GlobalData.addresses.meta.total = parseInt(response.headers[settings.headers.paging.total.toLowerCase()], 10) || 0; + } }); return addressesPromise; }, @@ -77,6 +81,7 @@ angular.module('ds.account') * Save addresses within logged in customer's address book. */ saveAddress: function(address) { + address.zip = '60656'; var promise = address.id ? AuthREST.Customers.all('me').all('addresses').customPUT(address, address.id) : AuthREST.Customers.all('me').all('addresses').customPOST(address); return promise; }, diff --git a/public/js/app/account/templates/account.html b/public/js/app/account/templates/account.html index 6b1091e27..9cb1501dd 100644 --- a/public/js/app/account/templates/account.html +++ b/public/js/app/account/templates/account.html @@ -31,7 +31,7 @@

-
@@ -36,7 +35,7 @@
+ autocomplete="on" placeholder="(Optional)" ng-change="$root.closeCartOnCheckout()">
@@ -45,7 +44,7 @@ + required autocomplete="on" ng-change="$root.closeCartOnCheckout()">
@@ -53,7 +52,7 @@
+ ng-model="order.billTo.address2" ng-change="$root.closeCartOnCheckout()">
@@ -63,7 +62,7 @@ + ng-model="order.billTo.city" ng-change="$root.closeCartOnCheckout()"> @@ -71,7 +70,7 @@
- @@ -96,7 +95,7 @@ + ng-model="order.billTo.zip" ng-change="$root.closeCartOnCheckout()">
@@ -104,7 +103,7 @@
+ autocomplete="on" placeholder="(Optional)" ng-change="$root.closeCartOnCheckout()">
\ No newline at end of file diff --git a/public/js/app/addresses/templates/billingCN.html b/public/js/app/addresses/templates/billingCN.html index 9d4a88691..32858d13e 100644 --- a/public/js/app/addresses/templates/billingCN.html +++ b/public/js/app/addresses/templates/billingCN.html @@ -17,7 +17,6 @@ @@ -28,7 +27,7 @@ + ng-model="order.billTo.zip" ng-change="$root.closeCartOnCheckout()"> @@ -37,7 +36,8 @@ ng-class="{'has-error': billToForm.province.$invalid && (billToForm.province.$dirty || showPristineErrors) }"> + class="form-control" id="provinceBill" name="province" ng-required="billToForm.country.$viewValue.id === 'CN'" autocomplete="on" ng-model="order.billTo.state" + ng-change="$root.closeCartOnCheckout()"> @@ -47,7 +47,7 @@ + ng-model="order.billTo.city" ng-change="$root.closeCartOnCheckout()"> @@ -57,7 +57,7 @@ + ng-model="order.billTo.address1" ng-change="$root.closeCartOnCheckout()"> @@ -65,7 +65,7 @@
+ ng-model="order.billTo.address2" ng-change="$root.closeCartOnCheckout()">
@@ -75,7 +75,7 @@ + required autocomplete="on" ng-change="$root.closeCartOnCheckout()"> @@ -83,7 +83,7 @@
+ autocomplete="on" placeholder="(Optional)" ng-change="$root.closeCartOnCheckout()">
@@ -91,7 +91,7 @@
+ autocomplete="on" placeholder="(Optional)" ng-change="$root.closeCartOnCheckout()">
\ No newline at end of file diff --git a/public/js/app/addresses/templates/billingDE.html b/public/js/app/addresses/templates/billingDE.html index 5385f1d5c..7710653fc 100644 --- a/public/js/app/addresses/templates/billingDE.html +++ b/public/js/app/addresses/templates/billingDE.html @@ -16,7 +16,7 @@ + required autocomplete="on" ng-change="$root.closeCartOnCheckout()"> @@ -27,7 +27,6 @@ @@ -36,7 +35,7 @@
+ autocomplete="on" placeholder="(Optional)" ng-change="$root.closeCartOnCheckout()">
@@ -45,7 +44,7 @@ + required autocomplete="on" ng-change="$root.closeCartOnCheckout()">
@@ -53,7 +52,7 @@
+ ng-model="order.billTo.address2" ng-change="$root.closeCartOnCheckout()">
@@ -63,7 +62,7 @@ + ng-model="order.billTo.city" ng-change="$root.closeCartOnCheckout()"> @@ -73,7 +72,7 @@ + ng-model="order.billTo.zip" ng-change="$root.closeCartOnCheckout()"> @@ -81,7 +80,7 @@
+ autocomplete="on" placeholder="(Optional)" ng-change="$root.closeCartOnCheckout()">
\ No newline at end of file diff --git a/public/js/app/addresses/templates/billingGB.html b/public/js/app/addresses/templates/billingGB.html index 95d3eb72e..730894ba7 100644 --- a/public/js/app/addresses/templates/billingGB.html +++ b/public/js/app/addresses/templates/billingGB.html @@ -16,7 +16,7 @@ + required autocomplete="on" ng-change="$root.closeCartOnCheckout()"> @@ -28,7 +28,6 @@ @@ -37,7 +36,7 @@
+ autocomplete="on" placeholder="(Optional)" ng-change="$root.closeCartOnCheckout()">
@@ -47,7 +46,7 @@ + required autocomplete="on" ng-change="$root.closeCartOnCheckout()"> @@ -55,7 +54,7 @@
+ ng-model="order.billTo.address2" ng-change="$root.closeCartOnCheckout()">
@@ -65,7 +64,7 @@ + ng-model="order.billTo.city" ng-change="$root.closeCartOnCheckout()"> @@ -75,7 +74,7 @@ + ng-model="order.billTo.zip" ng-change="$root.closeCartOnCheckout()"> @@ -83,7 +82,7 @@
+ autocomplete="on" placeholder="(Optional)" ng-change="$root.closeCartOnCheckout()">
\ No newline at end of file diff --git a/public/js/app/addresses/templates/billingJP.html b/public/js/app/addresses/templates/billingJP.html index 8d80427af..46aaf4265 100644 --- a/public/js/app/addresses/templates/billingJP.html +++ b/public/js/app/addresses/templates/billingJP.html @@ -16,7 +16,7 @@ + required autocomplete="on" ng-change="$root.closeCartOnCheckout()"> @@ -27,7 +27,6 @@ @@ -35,7 +34,8 @@
- +
@@ -45,7 +45,7 @@ + ng-model="order.billTo.zip" ng-change="$root.closeCartOnCheckout()"> @@ -54,7 +54,8 @@ ng-class="{'has-error': billToForm.province.$invalid && (billToForm.province.$dirty || showPristineErrors) }"> + class="form-control" id="provinceBill" name="province" ng-required="billToForm.country.$viewValue.id === 'JP'" autocomplete="on" ng-model="order.billTo.state" + ng-change="$root.closeCartOnCheckout()"> @@ -64,7 +65,7 @@ + ng-model="order.billTo.city" ng-change="$root.closeCartOnCheckout()"> @@ -74,7 +75,7 @@ + ng-model="order.billTo.address2" required autocomplete="on" ng-change="$root.closeCartOnCheckout()"> @@ -84,14 +85,15 @@ + required autocomplete="on" ng-change="$root.closeCartOnCheckout()">
- +
\ No newline at end of file diff --git a/public/js/app/addresses/templates/billingUS.html b/public/js/app/addresses/templates/billingUS.html index 0045e93cd..90e9cd121 100644 --- a/public/js/app/addresses/templates/billingUS.html +++ b/public/js/app/addresses/templates/billingUS.html @@ -16,7 +16,7 @@ + required autocomplete="on" ng-change="$root.closeCartOnCheckout()"> @@ -27,7 +27,6 @@ @@ -36,7 +35,7 @@
+ autocomplete="on" placeholder="(Optional)" ng-change="$root.closeCartOnCheckout()">
@@ -45,7 +44,7 @@ + required autocomplete="on" ng-change="$root.closeCartOnCheckout()">
@@ -53,7 +52,7 @@
+ ng-model="order.billTo.address2" ng-change="$root.closeCartOnCheckout()">
@@ -63,7 +62,7 @@ + ng-model="order.billTo.city" ng-change="$root.closeCartOnCheckout()"> @@ -72,7 +71,8 @@ ng-class="{'has-error': billToForm.state.$invalid && (billToForm.state.$dirty || showPristineErrors) }"> + ng-model="order.billTo.zip" ng-change="$root.closeCartOnCheckout()"> @@ -143,7 +143,7 @@
+ autocomplete="on" placeholder="(Optional)" ng-change="$root.closeCartOnCheckout()">
\ No newline at end of file diff --git a/public/js/app/addresses/templates/shippingCA.html b/public/js/app/addresses/templates/shippingCA.html index 92369e1d9..98e63a831 100644 --- a/public/js/app/addresses/templates/shippingCA.html +++ b/public/js/app/addresses/templates/shippingCA.html @@ -8,7 +8,7 @@ + ng-required="!shipToSameAsBillTo" autocomplete="on" ng-change="$root.closeCartOnCheckout()"> @@ -16,7 +16,7 @@
@@ -25,7 +25,7 @@
+ autocomplete="on" placeholder="(Optional)" ng-change="$root.closeCartOnCheckout()">
@@ -35,7 +35,7 @@ + ng-required="!shipToSameAsBillTo" autocomplete="on" ng-change="$root.closeCartOnCheckout()"> @@ -43,7 +43,7 @@
+ ng-model="order.shipTo.address2" autocomplete="on" ng-change="$root.closeCartOnCheckout()">
@@ -51,7 +51,7 @@
- +
@@ -59,7 +59,7 @@
- @@ -82,14 +82,14 @@
- +
- +
diff --git a/public/js/app/addresses/templates/shippingCN.html b/public/js/app/addresses/templates/shippingCN.html index a1c3342bd..b55cbf9e8 100644 --- a/public/js/app/addresses/templates/shippingCN.html +++ b/public/js/app/addresses/templates/shippingCN.html @@ -5,7 +5,7 @@
@@ -14,7 +14,7 @@
- +
@@ -23,7 +23,7 @@ ng-class="{'has-error': shipToForm.state.$invalid && (shipToForm.state.$dirty || showPristineErrors) }"> + id="stateShip" name="state" ng-required="!shipToSameAsBillTo" ng-model="order.shipTo.state" autocomplete="on" ng-change="$root.closeCartOnCheckout()"> @@ -32,7 +32,7 @@ ng-class="{'has-error': shipToForm.city.$invalid && (shipToForm.city.$dirty || showPristineErrors) }"> + id="cityShip" name="city" ng-required="!shipToSameAsBillTo" ng-model="order.shipTo.city" autocomplete="on" ng-change="$root.closeCartOnCheckout()"> @@ -42,7 +42,7 @@ + ng-model="order.shipTo.address1" ng-required="!shipToSameAsBillTo" ng-change="$root.closeCartOnCheckout()"> @@ -50,7 +50,7 @@
+ ng-model="order.shipTo.address2" autocomplete="on" ng-change="$root.closeCartOnCheckout()">
@@ -60,7 +60,7 @@ + ng-required="!shipToSameAsBillTo" autocomplete="on" ng-change="$root.closeCartOnCheckout()"> @@ -68,7 +68,7 @@
+ autocomplete="on" placeholder="(Optional)" ng-change="$root.closeCartOnCheckout()">
@@ -76,7 +76,7 @@
+ placeholder="(Optional)" ng-change="$root.closeCartOnCheckout()">
diff --git a/public/js/app/addresses/templates/shippingDE.html b/public/js/app/addresses/templates/shippingDE.html index 575c2c20e..30e292465 100644 --- a/public/js/app/addresses/templates/shippingDE.html +++ b/public/js/app/addresses/templates/shippingDE.html @@ -8,7 +8,7 @@ + ng-required="!shipToSameAsBillTo" autocomplete="on" ng-change="$root.closeCartOnCheckout()"> @@ -16,7 +16,7 @@
@@ -25,7 +25,7 @@
+ autocomplete="on" placeholder="(Optional)" ng-change="$root.closeCartOnCheckout()">
@@ -35,7 +35,7 @@ + ng-required="!shipToSameAsBillTo" autocomplete="on" ng-change="$root.closeCartOnCheckout()"> @@ -43,7 +43,7 @@
+ ng-model="order.shipTo.address2" autocomplete="on" ng-change="$root.closeCartOnCheckout()">
@@ -51,7 +51,7 @@
- +
@@ -59,14 +59,15 @@
- +
- +
diff --git a/public/js/app/addresses/templates/shippingGB.html b/public/js/app/addresses/templates/shippingGB.html index 0cb30267e..e29cc51a8 100644 --- a/public/js/app/addresses/templates/shippingGB.html +++ b/public/js/app/addresses/templates/shippingGB.html @@ -8,7 +8,7 @@ + ng-required="!shipToSameAsBillTo" autocomplete="on" ng-change="$root.closeCartOnCheckout()"> @@ -16,7 +16,7 @@
@@ -25,7 +25,7 @@
+ autocomplete="on" placeholder="(Optional)" ng-change="$root.closeCartOnCheckout()">
@@ -35,7 +35,7 @@ + ng-required="!shipToSameAsBillTo" autocomplete="on" ng-change="$root.closeCartOnCheckout()"> @@ -43,7 +43,7 @@
+ ng-model="order.shipTo.address2" autocomplete="on" ng-change="$root.closeCartOnCheckout()">
@@ -52,7 +52,7 @@ ng-class="{'has-error': shipToForm.city.$invalid && (shipToForm.city.$dirty || showPristineErrors) }"> + id="cityShip" name="city" ng-required="!shipToSameAsBillTo" ng-model="order.shipTo.city" autocomplete="on" ng-change="$root.closeCartOnCheckout()"> @@ -62,7 +62,7 @@ + ng-model="order.shipTo.zip" ng-change="$root.closeCartOnCheckout()"> @@ -70,7 +70,7 @@
+ placeholder="(Optional)" ng-change="$root.closeCartOnCheckout()">
diff --git a/public/js/app/addresses/templates/shippingJP.html b/public/js/app/addresses/templates/shippingJP.html index cb570bb4c..c86e07e0d 100644 --- a/public/js/app/addresses/templates/shippingJP.html +++ b/public/js/app/addresses/templates/shippingJP.html @@ -8,7 +8,7 @@ + ng-required="!shipToSameAsBillTo" autocomplete="on" ng-change="$root.closeCartOnCheckout()"> @@ -16,7 +16,7 @@
@@ -25,7 +25,7 @@
+ autocomplete="on" placeholder="(Optional)" ng-change="$root.closeCartOnCheckout()">
@@ -33,7 +33,7 @@
- +
@@ -41,7 +41,7 @@
- +
@@ -49,7 +49,7 @@
- +
@@ -59,7 +59,7 @@ + ng-model="order.shipTo.address2" required autocomplete="on" ng-change="$root.closeCartOnCheckout()"> @@ -69,14 +69,15 @@ + required autocomplete="on" ng-change="$root.closeCartOnCheckout()">
- +
diff --git a/public/js/app/addresses/templates/shippingUS.html b/public/js/app/addresses/templates/shippingUS.html index d4e900fd9..d464da4db 100644 --- a/public/js/app/addresses/templates/shippingUS.html +++ b/public/js/app/addresses/templates/shippingUS.html @@ -8,7 +8,7 @@ + ng-required="!shipToSameAsBillTo" autocomplete="on" ng-change="$root.closeCartOnCheckout()"> @@ -18,7 +18,7 @@ @@ -27,7 +27,7 @@
+ autocomplete="on" placeholder="(Optional)" ng-change="$root.closeCartOnCheckout()">
@@ -37,7 +37,7 @@ + ng-required="!shipToSameAsBillTo" autocomplete="on" ng-change="$root.closeCartOnCheckout()"> @@ -45,7 +45,7 @@
+ ng-model="order.shipTo.address2" autocomplete="on" ng-change="$root.closeCartOnCheckout()">
@@ -53,7 +53,7 @@
- +
@@ -62,7 +62,7 @@ ng-class="{'has-error': shipToForm.state.$invalid && (shipToForm.state.$dirty || showPristineErrors) }"> + ng-model="order.shipTo.zip" ng-change="$root.closeCartOnCheckout()">
- +
diff --git a/public/js/app/cart/services/cart-rest.js b/public/js/app/cart/services/cart-rest.js index 19f378a9f..4f9ef72d4 100644 --- a/public/js/app/cart/services/cart-rest.js +++ b/public/js/app/cart/services/cart-rest.js @@ -27,6 +27,18 @@ angular.module('ds.cart') httpConfig: httpConfig }; }); + }), + + CalculateCart: Restangular.withConfig(function (RestangularConfigurer) { + RestangularConfigurer.setBaseUrl(siteConfig.apis.cartcalculation.baseUrl); + RestangularConfigurer.addFullRequestInterceptor(function (element, operation, route, url, headers, params, httpConfig) { + return { + element: element, + params: params, + headers: _.extend(headers, { 'hybris-site': GlobalData.getSiteCode() }), + httpConfig: httpConfig + }; + }); }) }; diff --git a/public/js/app/cart/services/cart-service.js b/public/js/app/cart/services/cart-service.js index 2189baf85..60ee05f81 100644 --- a/public/js/app/cart/services/cart-service.js +++ b/public/js/app/cart/services/cart-service.js @@ -364,8 +364,11 @@ angular.module('ds.cart') return CartREST.Cart.one('carts', cartId).customPUT({ zipCode: zipCode, countryCode: countryCode }, '').then(function () { refreshCart(cartId, 'manual'); }); - } + }, + recalculateCart: function (data) { + return CartREST.CalculateCart.all('calculation').customPOST(data, ''); + } }; diff --git a/public/js/app/cart/templates/cart-costs.html b/public/js/app/cart/templates/cart-costs.html index 5c6617607..57eed962b 100644 --- a/public/js/app/cart/templates/cart-costs.html +++ b/public/js/app/cart/templates/cart-costs.html @@ -23,7 +23,11 @@ {{'SHIPPING' | translate}} - {{ cart.shippingCost.amount | currency: currencySymbol }} + {{ cart.shipping.fee.amount | currency: currencySymbol }} + + + + {{'ADDITIONAL_SHIPPING_OPTIONS' | translate}} @@ -42,6 +46,7 @@ {{taxLine.amount | currency: currencySymbol}} + {{'TAX' | translate}} diff --git a/public/js/app/checkout/controllers/checkout-cart-ctrl.js b/public/js/app/checkout/controllers/checkout-cart-ctrl.js index 6ab4847ae..fde5d50f3 100644 --- a/public/js/app/checkout/controllers/checkout-cart-ctrl.js +++ b/public/js/app/checkout/controllers/checkout-cart-ctrl.js @@ -14,11 +14,11 @@ angular.module('ds.checkout') /** Purpose of this controller is to "glue" the data models of cart and shippingCost into the order details view.*/ - .controller('CheckoutCartCtrl', ['$scope', '$rootScope', 'cart', 'shippingCost', 'GlobalData', 'CartSvc', - function ($scope, $rootScope, cart, shippingCost, GlobalData, CartSvc) { + .controller('CheckoutCartCtrl', ['$scope', '$rootScope', 'cart', 'GlobalData', 'CartSvc', + function ($scope, $rootScope, cart, GlobalData, CartSvc) { $scope.currencySymbol = GlobalData.getCurrencySymbol(cart.currency); - $scope.shippingCost = shippingCost.price[GlobalData.getCurrencyId()]; + //$scope.shippingCost = shippingCost.price[GlobalData.getCurrencyId()]; $scope.taxType = GlobalData.getTaxType(); $scope.taxConfiguration = GlobalData.getCurrentTaxConfiguration(); @@ -32,6 +32,10 @@ angular.module('ds.checkout') $scope.calculateTax = CartSvc.getCalculateTax(); }); + $rootScope.$on('order:previewed', function (){ + $scope.calculateTax.taxCalculationApplied = true; + }); + $scope.$on('$destroy', unbind); }]); diff --git a/public/js/app/checkout/controllers/checkout-ctrl.js b/public/js/app/checkout/controllers/checkout-ctrl.js index 1246b3b2a..e8a7be603 100644 --- a/public/js/app/checkout/controllers/checkout-ctrl.js +++ b/public/js/app/checkout/controllers/checkout-ctrl.js @@ -33,11 +33,11 @@ angular.module('ds.checkout') * is re-enabled so that the user can make changes and resubmit if needed. * * */ - .controller('CheckoutCtrl', ['$rootScope', '$scope', '$location', '$anchorScroll', 'CheckoutSvc','cart', 'order', '$state', '$modal', 'AuthSvc', 'AccountSvc', 'AuthDialogManager', 'shippingCost', 'GlobalData', - function ($rootScope, $scope, $location, $anchorScroll, CheckoutSvc, cart, order, $state, $modal, AuthSvc, AccountSvc, AuthDialogManager, shippingCost, GlobalData) { + .controller('CheckoutCtrl', ['$rootScope', '$scope', '$location', '$anchorScroll', 'CheckoutSvc','cart', 'order', '$state', '$modal', 'AuthSvc', 'AccountSvc', 'AuthDialogManager', 'shippingZones', 'GlobalData', 'ShippingSvc', 'shippingCountries', '$q', 'CartSvc', + function ($rootScope, $scope, $location, $anchorScroll, CheckoutSvc, cart, order, $state, $modal, AuthSvc, AccountSvc, AuthDialogManager, shippingZones, GlobalData, ShippingSvc, shippingCountries, $q, CartSvc) { $scope.order = order; - + $scope.displayCart = false; $scope.titles = GlobalData.getUserTitles(); //Resolve in the ui.router state returns cart object, problem is when the user is loged in @@ -45,13 +45,11 @@ angular.module('ds.checkout') //this method changes cart. That is the reason cart was empty on refresh //With this implementation we are getting the cart object from service after it is loaded cart = $scope.cart; - - $scope.shippingCosts = shippingCost || 0; // temporary handling of shipping cost not being set - default to zero + $scope.shippingCountries = shippingCountries; + $scope.shippingZones = shippingZones || 0; $scope.currencySymbol = GlobalData.getCurrencySymbol(cart.currency); - $scope.order.shippingCost = shippingCost.price[GlobalData.getCurrencyId()]; $scope.user = GlobalData.user; $scope.addresses = []; - var shouldAutoUpdateName = true; var Wiz = function () { @@ -88,6 +86,7 @@ angular.module('ds.checkout') var getDefaultAddress = function (addresses) { return _.find(addresses, function (addr) { + return addr.isDefault; }); }; @@ -107,6 +106,7 @@ angular.module('ds.checkout') $scope.order.billTo.city = address.city; $scope.order.billTo.state = address.state; $scope.order.billTo.zip = address.zipCode; + $scope.order.billTo.zipCode = address.zipCode; $scope.order.billTo.contactPhone = address.contactPhone; $scope.$emit('localizedAddress:updated', address.country, 'billing'); @@ -121,7 +121,10 @@ angular.module('ds.checkout') $scope.addresses = response; selectedBillingAddress = defaultAddress; selectedShippingAddress = defaultAddress; - populateBillTo(defaultAddress); + if ($scope.isShipToCountry(defaultAddress.country)) { + populateBillTo(defaultAddress); + } + $rootScope.updateShippingCost(defaultAddress); } /* populate name if the user has no default address but does have a name saved to the account @@ -262,6 +265,7 @@ angular.module('ds.checkout') angular.copy($scope.order.billTo, $scope.order.shipTo); selectedShippingAddress = $scope.order.shipTo; $scope.$emit('localizedAddress:updated', selectedShippingAddress.country, 'shipping'); + $rootScope.updateShippingCost($scope.order.billTo); }; var clearShipTo = function(){ @@ -270,15 +274,21 @@ angular.module('ds.checkout') if ($scope.order.billTo.country) { $scope.order.shipTo.country = $scope.order.billTo.country; } + //$scope.order.shipTo.zipCode = ''; + selectedShippingAddress = $scope.order.shipTo; + $scope.$emit('localizedAddress:updated', selectedShippingAddress.country, 'shipping'); $scope.shipToSameAsBillTo = false; }; $scope.toggleShipToSameAsBillTo = function(){ if($scope.shipToSameAsBillTo){ setShipToSameAsBillTo(); + $rootScope.shipActive = false; } else { clearShipTo(); + $rootScope.shipActive = true; } + $rootScope.closeCartOnCheckout(); }; /** Reset any error messaging related to the credit card expiration date.*/ @@ -417,7 +427,7 @@ angular.module('ds.checkout') setShipToSameAsBillTo(); } $scope.order.cart = $scope.cart; - + $scope.order.shipping = angular.fromJson($scope.shippingCost); CheckoutSvc.checkout($scope.order).then(checkoutSuccessHandler, checkoutErrorHandler); } else { @@ -430,12 +440,14 @@ angular.module('ds.checkout') }; $scope.selectAddress = function(address, target) { + $scope.displayCart = false; if (target === $scope.order.billTo) { selectedBillingAddress = address; $scope.$emit('localizedAddress:updated', address.country, 'billing'); } else if (target === $scope.order.shipTo) { selectedShippingAddress = address; + $rootScope.shipActive = true; $scope.$emit('localizedAddress:updated', address.country, 'shipping'); } addressModalInstance.close(); @@ -449,12 +461,15 @@ angular.module('ds.checkout') target.city = address.city; target.state = address.state; target.zip = address.zipCode; + target.zipCode = address.zipCode; target.contactPhone = address.contactPhone; if(target === $scope.order.billTo && ($scope.shipToSameAsBillTo === true || _.isEmpty($scope.order.shipTo))){ setShipToSameAsBillTo(); } $scope.shipToSameAsBillTo = _.isEqual($scope.order.billTo, $scope.order.shipTo); + var addressToShip = $rootScope.shipActive ? $scope.order.shipTo : $scope.order.billTo; + $rootScope.updateShippingCost(addressToShip); }; $scope.openAddressDialog = function(target) { @@ -506,5 +521,132 @@ angular.module('ds.checkout') } }; + $scope.isShipToCountry = function (countryID) { + return shippingCountries.indexOf(countryID) > -1; + }; + + $scope.ifShipAddressApplicable = function (addressCountry, address, target) { + var condition = $scope.isShipToCountry(addressCountry); + if (condition) { + return $scope.selectAddress(address, target); + } + }; + $scope.changeShippingCost = function () { + $scope.displayCart = false; + }; + + $rootScope.openCartOnCheckout = function () { + $scope.displayCart = true; + }; + + $rootScope.closeCartOnCheckout = function () { + $scope.displayCart = false; + }; + + $rootScope.$on('preview:order', function () { + $scope.previewOrder(true, true); + }); + + $scope.previewOrder = function (shipToFormValid, billToFormValid) { + if (shipToFormValid && billToFormValid && $scope.shippingCosts) { + var shippingCostObject = angular.fromJson($scope.shippingCost); + var items = []; + var addressToShip = $rootScope.shipActive ? $scope.order.shipTo : $scope.order.billTo; + for (var i = 0; i < $scope.cart.items.length; i++) { + var item = { + itemId: $scope.cart.items[i].id, + productId: $scope.cart.items[i].product.id, + quantity: $scope.cart.items[i].quantity, + unitPrice:{ + amount: $scope.cart.items[i].price.originalAmount, + currency: $scope.cart.items[i].price.currency + } + }; + items.push(item); + } + $scope.cart.shipping.fee.amount = shippingCostObject.fee.amount; + var data = { + cartId: $scope.cart.id, + siteCode: GlobalData.getSiteCode(), + currency: GlobalData.getCurrency(), + shipping: { + calculationType: 'QUOTATION', + methodId: shippingCostObject.id, + zoneId: shippingCostObject.zoneId + }, + items: items, + addresses: [ + { + type: 'SHIP_TO', + zipCode: addressToShip.zip ? addressToShip.zip : '123', + country: addressToShip.country + } + ] + }; + CartSvc.recalculateCart(data).then( + function (calculatedCart) { + $scope.cart.subTotalPrice.amount = calculatedCart.subTotalPrice.amount; + $scope.cart.totalPrice.amount = calculatedCart.totalPrice.amount; + if (calculatedCart.totalTax) { + $scope.cart.totalTax.amount = calculatedCart.totalTax.amount; + }else { + $scope.cart.totalTax = {amount: 0}; + } + $rootScope.$emit('order:previewed'); + $scope.displayCart = true; + $scope.showPristineErrors = false; + } + ); + } else { + $scope.showPristineErrors = true; + } + }; + + $rootScope.updateShippingCost = function (shipToAddress) { + var address = shipToAddress; + var cart = $scope.cart; + if ($scope.isShipToCountry(shipToAddress.country)) { + + var data = { + 'cartTotal': { + 'amount': cart.subTotalPrice.amount, + 'currency': GlobalData.getCurrency() + }, + 'shipToAddress': address + }; + + var costsPromise = ShippingSvc.getShippingCosts(data).then( + function (result) { + return result[0]; + } + ); + + var minCostPromise = ShippingSvc.getMinimumShippingCost(data).then( + function (result) { + return result; + } + ); + + $q.all([costsPromise, minCostPromise]).then(function(data){ + $scope.shippingCosts = data[0].methods; + var shippingCost = data[1]; + if($scope.isShipToCountry(shipToAddress.country)){ + for (var i = 0; i < $scope.shippingCosts.length; i++) { + $scope.shippingCosts[i].zoneId = data[0].zone.id; + if ($scope.shippingCosts[i].fee.amount === shippingCost.fee.amount) { + shippingCost.zoneId = $scope.shippingCosts[i].zoneId; + shippingCost.id = $scope.shippingCosts[i].id; + shippingCost.name = $scope.shippingCosts[i].name; + $scope.shippingCosts[i].preselect = true; + } + } + } else { + $scope.shippingCosts = []; + } + + $scope.shippingCost = shippingCost; + }); + } + }; - }]); + }]); \ No newline at end of file diff --git a/public/js/app/checkout/directives/mobile-checkout-wizard.js b/public/js/app/checkout/directives/mobile-checkout-wizard.js index 71e0b1ed8..dbc92494f 100644 --- a/public/js/app/checkout/directives/mobile-checkout-wizard.js +++ b/public/js/app/checkout/directives/mobile-checkout-wizard.js @@ -24,7 +24,7 @@ angular.module('ds.checkout') * the missing fields will be highlighted as errors, and the user cannot advance until the necessary information * has been provided. */ - .directive('mobileCheckoutWizard',['$location', '$anchorScroll', function($location, $anchorScroll){ + .directive('mobileCheckoutWizard',['$location', '$anchorScroll', '$rootScope', function($location, $anchorScroll, $rootScope){ return { restrict: 'A', link: function(scope) { @@ -78,6 +78,7 @@ angular.module('ds.checkout') if (paymentFormValid) { scope.wiz.step3Done = true; // guarantee correct scrolling for mobile + $rootScope.$emit('preview:order'); $location.hash('step4'); $anchorScroll(); } else { diff --git a/public/js/app/checkout/services/checkout-rest.js b/public/js/app/checkout/services/checkout-rest.js index 841543550..19a0da523 100644 --- a/public/js/app/checkout/services/checkout-rest.js +++ b/public/js/app/checkout/services/checkout-rest.js @@ -35,6 +35,19 @@ angular.module('ds.checkout') RestangularConfigurer.setBaseUrl(siteConfig.apis.shippingCosts.baseUrl); RestangularConfigurer.addFullRequestInterceptor(function(element, operation, route, url, headers, params, httpConfig) { + return { + element: element, + params: params, + headers: _.extend(headers, {'hybris-currency': GlobalData.getCurrencyId()}), + httpConfig: httpConfig + }; + }); + }), + + ShippingZones: Restangular.withConfig(function(RestangularConfigurer) { + RestangularConfigurer.setBaseUrl(siteConfig.apis.shippingZones.baseUrl); + RestangularConfigurer.addFullRequestInterceptor(function(element, operation, route, url, headers, params, httpConfig) { + return { element: element, params: params, @@ -43,6 +56,7 @@ angular.module('ds.checkout') }; }); }) + }; diff --git a/public/js/app/checkout/services/checkout-service.js b/public/js/app/checkout/services/checkout-service.js index 3fc90d6fa..5e7fd135e 100644 --- a/public/js/app/checkout/services/checkout-service.js +++ b/public/js/app/checkout/services/checkout-service.js @@ -137,7 +137,10 @@ angular.module('ds.checkout') newOrder.payment = order.payment; newOrder.payment.customAttributes.token = token; newOrder.currency = order.cart.currency; - newOrder.shippingCost = order.shippingCost; + newOrder.shipping = { + 'methodId': order.shipping.id, + 'amount': order.shipping.fee.amount + }; newOrder.totalPrice = order.cart.totalPrice.amount; newOrder.addresses = []; diff --git a/public/js/app/checkout/templates/checkout-cart.html b/public/js/app/checkout/templates/checkout-cart.html index 118fd58ee..d4b8d4e47 100644 --- a/public/js/app/checkout/templates/checkout-cart.html +++ b/public/js/app/checkout/templates/checkout-cart.html @@ -1,7 +1,7 @@

{{'ORDER_DETAILS' | translate}} - +

{{cart.totalUnitsCount}} {{'ITEMS' | translate}}
@@ -44,7 +44,7 @@

{{'ORDER_DETAILS' | translate}} {{'SHIPPING' | translate}} - {{ cart.shippingCost.amount | currency: currencySymbol }} + {{ cart.shipping.fee.amount | currency: currencySymbol }} {{taxLine.name}} diff --git a/public/js/app/checkout/templates/checkout-form.html b/public/js/app/checkout/templates/checkout-form.html index ef9d33169..1f567c301 100644 --- a/public/js/app/checkout/templates/checkout-form.html +++ b/public/js/app/checkout/templates/checkout-form.html @@ -101,12 +101,14 @@

{{'STEP_2_SHIPPING_INFORMATION' | translate}} {{'DELIVERY_METHOD' | translate}}

+
- - + +
@@ -117,7 +119,18 @@

{{'STEP_2_SHIPPING_INFORMATION' | translate}} - + + + + + + -->
{{'PAYMENT' | translate}} @@ -211,7 +224,7 @@

{{'STEP_3_PAYMENT' | translate}} +

{{'STEP_4_REVIEW_ORDER' | translate}}

@@ -222,7 +235,7 @@

{{'STEP_4_REVIEW_ORDER' | translate}}

- + diff --git a/public/js/app/checkout/templates/checkout-frame.html b/public/js/app/checkout/templates/checkout-frame.html index 8b28f4a56..1ed8d72ae 100644 --- a/public/js/app/checkout/templates/checkout-frame.html +++ b/public/js/app/checkout/templates/checkout-frame.html @@ -2,8 +2,9 @@
- + + -
+
\ No newline at end of file diff --git a/public/js/app/errors/backendStub.js b/public/js/app/errors/backendStub.js index c906d9397..b9f451939 100644 --- a/public/js/app/errors/backendStub.js +++ b/public/js/app/errors/backendStub.js @@ -277,7 +277,56 @@ 'currency' : 'USD' } ); //end mock. + + $httpBackend.expectGET('https://api.yaas.io/hybris/customer/v1/defaultproj/me/addresses/28e7d417bc').respond(500); + $httpBackend.whenPUT('https://api.yaas.io/hybris/customer/v1/defaultproj/me/addresses/28e7d417bc') + .respond( + //MOCK-ERROR-STATUS-CODE + //401 //404 //500 //uncomment integer to mock status code. Int will hit error handler and mock error. Also comment out mock data. + //MOCK-DATA-RESPONSE + 500 + ); + + $httpBackend.whenDELETE('https://api.yaas.io/hybris/customer/v1/defaultproj/me/addresses/28e7d417bc') + .respond(500); + + $httpBackend.whenDELETE('https://api.yaas.io/hybris/customer/v1/defaultproj/me/addresses/3af291947a') + .respond(500); + + $httpBackend.whenPUT('https://api.yaas.io/hybris/customer/v1/defaultproj/me/addresses/3af291947a') + .respond(500); + + $httpBackend.whenDELETE('https://api.yaas.io/hybris/customer/v1/defaultproj/me/addresses/1ef631bd25') + .respond(500); + + $httpBackend.whenPUT('https://api.yaas.io/hybris/customer/v1/defaultproj/me/addresses/1ef631bd25') + .respond(500); + + /*$httpBackend.whenGET('https://api.yaas.io/hybris/customer/b1/defaultproj/me') + .respond( + //MOCK-ERROR-STATUS-CODE + //401 //404 //500 //uncomment integer to mock status code. Int will hit error handler and mock error. Also comment out mock data. + //MOCK-DATA-RESPONSE + 500 + );*/ + + /*$httpBackend.whenGET('https://api.yaas.io/hybris/customer/b1/defaultproj/me/addresses?pageNumber=1&pageSize=6') + .respond( + //MOCK-ERROR-STATUS-CODE + //401 //404 //500 //uncomment integer to mock status code. Int will hit error handler and mock error. Also comment out mock data. + //MOCK-DATA-RESPONSE + 500 + );*/ + + + $httpBackend.whenGET('https://api.yaas.io/hybris/order/v1/defaultproj/orders?pageSize=10') + .respond( + //MOCK-ERROR-STATUS-CODE + //401 //404 //500 //uncomment integer to mock status code. Int will hit error handler and mock error. Also comment out mock data. + //MOCK-DATA-RESPONSE + 500 + ); /** MOCK-PASSTHROUGHS * - These are required for anything that is not mocked. The HTTPBackendProxy passes them through to the server. @@ -288,6 +337,14 @@ // various passthroughs. these allow existing services to work, while some are mocked. $httpBackend.whenGET('./js/app/auth/templates/signin.html').passThrough(); $httpBackend.whenGET('./js/app/auth/templates/signup.html').passThrough(); + $httpBackend.whenGET('./js/app/account/templates/addresses.html').passThrough(); + + $httpBackend.whenGET('./js/app/account/templates/address-form.html').passThrough(); + + $httpBackend.whenGET('./js/app/cart/templates/cart-costs.html').passThrough(); + $httpBackend.whenGET('./js/app/coupons/templates/coupon-apply.html').passThrough(); + + // dont mock everything else, specify pass through to avoid error. diff --git a/public/js/app/orders/services/order-list-service.js b/public/js/app/orders/services/order-list-service.js index 432856651..3a5488300 100644 --- a/public/js/app/orders/services/order-list-service.js +++ b/public/js/app/orders/services/order-list-service.js @@ -18,7 +18,9 @@ angular.module('ds.orders') var getOrders = function (parms) { var ordersPromise = OrdersREST.Orders.all('orders').getList(parms); ordersPromise.then(function(response) { - GlobalData.orders.meta.total = parseInt(response.headers[settings.headers.paging.total], 10) || 0; + if (response.headers) { + GlobalData.orders.meta.total = parseInt(response.headers[settings.headers.paging.total], 10) || 0; + } }); return ordersPromise; }; diff --git a/public/js/app/orders/services/orders-rest.js b/public/js/app/orders/services/orders-rest.js index 0a9f2b9fa..f1678fda6 100644 --- a/public/js/app/orders/services/orders-rest.js +++ b/public/js/app/orders/services/orders-rest.js @@ -22,7 +22,9 @@ angular.module('ds.orders') RestangularConfigurer.setResponseInterceptor(function (data, operation, what, url, response) { var headers = response.headers(); var result = response.data; - result.headers = headers; + if(result){ + result.headers = headers; + } return result; }); RestangularConfigurer.setBaseUrl(siteConfig.apis.orders.baseUrl); diff --git a/public/js/app/products/controllers/product-detail-ctrl.js b/public/js/app/products/controllers/product-detail-ctrl.js index 950977c28..256b60ab6 100644 --- a/public/js/app/products/controllers/product-detail-ctrl.js +++ b/public/js/app/products/controllers/product-detail-ctrl.js @@ -17,11 +17,13 @@ angular.module('ds.products') * Listens to the 'cart:updated' event. Once the item has been added to the cart, and the updated * cart information has been retrieved from the service, the 'cart' view will be shown. */ - .controller('ProductDetailCtrl', ['$scope', '$rootScope', 'CartSvc', 'product', 'lastCatId', 'settings', 'GlobalData', 'CategorySvc','$filter', 'ProductAttributeSvc', - function($scope, $rootScope, CartSvc, product, lastCatId, settings, GlobalData, CategorySvc, $filter, ProductAttributeSvc) { - + .controller('ProductDetailCtrl', ['$scope', '$rootScope', 'CartSvc', 'product', 'lastCatId', 'settings', 'GlobalData', 'CategorySvc','$filter', 'ProductAttributeSvc', '$modal', 'shippingZones', + function($scope, $rootScope, CartSvc, product, lastCatId, settings, GlobalData, CategorySvc, $filter, ProductAttributeSvc, $modal, shippingZones) { + var modalInstance; + $scope.product = product; - + $scope.shippingZones = shippingZones; + $scope.currencySymbol = GlobalData.getCurrencySymbol(); // used by breadcrumb directive $scope.category = product.categories; $scope.breadcrumbData = angular.copy($scope.category); @@ -71,6 +73,14 @@ angular.module('ds.products') //input default values must be defined in controller, not html, if tied to ng-model $scope.productDetailQty = 1; $scope.buyButtonEnabled = true; + + $scope.showShippingRates = function(){ + + modalInstance = $modal.open({ + templateUrl: 'js/app/shared/templates/shipping-dialog.html', + scope: $scope + }); + }; // scroll to top on load @@ -117,4 +127,4 @@ angular.module('ds.products') $scope.hasAnyOfAttributesSet = function(product){ return ProductAttributeSvc.hasAnyOfAttributesSet(product); }; -}]); \ No newline at end of file +}]); diff --git a/public/js/app/products/templates/product-detail.html b/public/js/app/products/templates/product-detail.html index 33f30ffa6..9cabd5210 100644 --- a/public/js/app/products/templates/product-detail.html +++ b/public/js/app/products/templates/product-detail.html @@ -64,6 +64,9 @@

+ diff --git a/public/js/app/products/templates/product-list.html b/public/js/app/products/templates/product-list.html index 8b0862c4d..d4f75cbd1 100644 --- a/public/js/app/products/templates/product-list.html +++ b/public/js/app/products/templates/product-list.html @@ -1,3 +1,4 @@ +
diff --git a/public/js/app/search/controllers/search-list-ctrl.js b/public/js/app/search/controllers/search-list-ctrl.js index 7f3df1fd6..a440504f4 100644 --- a/public/js/app/search/controllers/search-list-ctrl.js +++ b/public/js/app/search/controllers/search-list-ctrl.js @@ -144,6 +144,9 @@ angular.module('ds.searchlist') //Set page parameter $location.search('page', $scope.pageNumber).replace(); + + //Send event that search is done + $rootScope.$emit('search:performed', { searchTerm: $scope.searchString, numberOfResults: $scope.total }); } }, function () { $scope.requestInProgress = false; diff --git a/public/js/app/search/templates/search-list.html b/public/js/app/search/templates/search-list.html index 7f51ea510..164aee2a9 100644 --- a/public/js/app/search/templates/search-list.html +++ b/public/js/app/search/templates/search-list.html @@ -1,4 +1,4 @@ - +
@@ -15,7 +15,7 @@
-
+
diff --git a/public/js/app/shared/directives/force-scroll.js b/public/js/app/shared/directives/force-scroll.js new file mode 100644 index 000000000..285a10701 --- /dev/null +++ b/public/js/app/shared/directives/force-scroll.js @@ -0,0 +1,29 @@ +/** + * [y] hybris Platform + * + * Copyright (c) 2000-2015 hybris AG + * All rights reserved. + * + * This software is the confidential and proprietary information of hybris + * ("Confidential Information"). You shall not disclose such Confidential + * Information and shall use it only in accordance with the terms of the + * license agreement you entered into with hybris. + */ +(function () { + 'use strict'; + + angular.module('ds.shared') + .directive('forceScroll', [function () { + return { + restrict: 'M', + scope: false, + controller: ['$rootScope', '$scope', function ($rootScope, $scope) { + $rootScope.forceScroll = true; + + $scope.$on('$destroy', function () { + $rootScope.forceScroll = false; + }); + }] + }; + }]); +})(); \ No newline at end of file diff --git a/public/js/app/shared/controllers/site-selector-ctrl.js b/public/js/app/shared/directives/site-selector/site-selector-ctrl.js similarity index 90% rename from public/js/app/shared/controllers/site-selector-ctrl.js rename to public/js/app/shared/directives/site-selector/site-selector-ctrl.js index 7b729dcab..be20d3b40 100644 --- a/public/js/app/shared/controllers/site-selector-ctrl.js +++ b/public/js/app/shared/directives/site-selector/site-selector-ctrl.js @@ -13,8 +13,8 @@ 'use strict'; angular.module('ds.shared') - .controller('siteSelectorController', ['$rootScope', '$scope', 'GlobalData', 'SiteSelectorSvc', - function ($rootScope, $scope, GlobalData, SiteSelectorSvc) { + .controller('SiteSelectorController', ['$scope', 'GlobalData', 'SiteSelectorSvc', + function ($scope, GlobalData, SiteSelectorSvc) { $scope.sites = GlobalData.getSites(); $scope.selectedSite = GlobalData.getSite(); diff --git a/public/js/app/shared/directives/site-selector/site-selector-directive.js b/public/js/app/shared/directives/site-selector/site-selector-directive.js new file mode 100644 index 000000000..a854dad9a --- /dev/null +++ b/public/js/app/shared/directives/site-selector/site-selector-directive.js @@ -0,0 +1,26 @@ +/** + * [y] hybris Platform + * + * Copyright (c) 2000-2015 hybris AG + * All rights reserved. + * + * This software is the confidential and proprietary information of hybris + * ("Confidential Information"). You shall not disclose such Confidential + * Information and shall use it only in accordance with the terms of the + * license agreement you entered into with hybris. + */ + + +(function () { + 'use strict'; + + angular.module('ds.shared') + .directive('siteSelector', function () { + return { + restrict: 'E', + controller: 'SiteSelectorController', + templateUrl: 'js/app/shared/directives/site-selector/site-selector.html' + }; + }); + +})(); \ No newline at end of file diff --git a/public/js/app/shared/services/site-selector-service.js b/public/js/app/shared/directives/site-selector/site-selector-service.js similarity index 100% rename from public/js/app/shared/services/site-selector-service.js rename to public/js/app/shared/directives/site-selector/site-selector-service.js diff --git a/public/js/app/shared/directives/site-selector/site-selector.html b/public/js/app/shared/directives/site-selector/site-selector.html new file mode 100644 index 000000000..e55236bb8 --- /dev/null +++ b/public/js/app/shared/directives/site-selector/site-selector.html @@ -0,0 +1,31 @@ +
+
+ +
+
diff --git a/public/js/app/shared/directives/y-search.js b/public/js/app/shared/directives/y-search.js index 544f5261a..54020cf7c 100644 --- a/public/js/app/shared/directives/y-search.js +++ b/public/js/app/shared/directives/y-search.js @@ -28,7 +28,7 @@ angular.module('ds.ysearch', ['algoliasearch']) }); angular.module('ds.ysearch') - .controller('ysearchController', ['$scope', '$rootScope', 'ysearchSvc', function (scope, $rootScope, ysearchSvc) { + .controller('ysearchController', ['$scope', '$rootScope', '$state', 'ysearchSvc', function (scope, $rootScope, $state, ysearchSvc) { if (!scope.page) { scope.page = 0; @@ -105,15 +105,19 @@ angular.module('ds.ysearch') else { scope.search.zeroResults = false; } - - //Send event that search is done - $rootScope.$emit('search:performed', { searchTerm: scope.search.text, numberOfResults: scope.search.numberOfHits }); }, function () { //Show error that search didn't perform correctly. scope.search.searchError = true; }); } }; + + scope.goToResultsPage = function () { + if (scope.search && scope.search.text && scope.search.text.length) { + scope.hideSearchResults(); + $state.go('base.search', { searchString: scope.search.text }); + } + }; }]); diff --git a/public/js/app/shared/directives/y-tracking.js b/public/js/app/shared/directives/y-tracking.js index 0b87f86c5..23bc85a6f 100644 --- a/public/js/app/shared/directives/y-tracking.js +++ b/public/js/app/shared/directives/y-tracking.js @@ -88,20 +88,61 @@ angular.module('ds.ytracking', []) } }; }]) - .factory('ytrackingSvc', ['SiteConfigSvc', 'yTrackingLocalStorageKey', '$http', 'localStorage', '$window', '$timeout', 'GlobalData', - function (siteConfig, yTrackingLocalStorageKey, $http, localStorage, $window, $timeout, GlobalData) { + .factory('ytrackingSvc', ['yTrackingLocalStorageKey', '$http', 'localStorage', '$window', '$timeout', 'GlobalData', 'settings', 'appConfig', 'CookieSvc', + function (yTrackingLocalStorageKey, $http, localStorage, $window, $timeout, GlobalData, settings, appConfig, CookieSvc) { var internalCart = {}; /** - * Url for piwik service + * Url for piwik service. + * appConfig dependency should be refactored out maybe and tenant and domain + * should be provided for example as parameters to ytracking directive so this tracking + * can also work for any other storefront (not just this template) */ - var url = siteConfig.apis.tracking.baseUrl; + var apiPath = appConfig.dynamicDomain(); + var tenantId = appConfig.storeTenant(); + + var piwikUrl = 'https://' + apiPath + '/hybris/edge/b1/events'; + var consentUrl = 'https://' + apiPath + '/hybris/consent/b1/' + tenantId + '/consentReferences'; + + var getConsentReference = function () { + var consentReferenceCookie = CookieSvc.getConsentReferenceCookie(); + if (!!consentReferenceCookie) { + return consentReferenceCookie; + } else { + return ''; + } + }; + + // We could do this in ConfigSvc. This way, consent-reference will be fetched before piwik starts tracking and sending + // events. When done in ConfigSvc then the code should probably also detect if ytracking is enabled before attmepting + // to fetch the consent-reference. + var makeOptInRequest = function() { + var req = { + method: 'POST', + url: consentUrl, + headers: { + 'Content-Type': 'application/json', + 'Accept': 'application/json' + } + }; + + $http(req).success(function (response) { + if (!!response.id) { + CookieSvc.setConsentReferenceCookie(response.id); + } + }); + }; + + if (!getConsentReference()) { + //noinspection JSUnusedAssignment + makeOptInRequest(); + } /** * Create object from piwik GET request */ - var getQueryParameters = function (hash) { + var getPiwikQueryParameters = function (hash) { var split = hash.split('&'); var obj = {}; @@ -119,40 +160,48 @@ angular.module('ds.ytracking', []) /** * Function that process piwik requests */ - var processRequest = function (e) { + var processPiwikRequest = function (e) { //Get object from query parameters - var obj = getQueryParameters(e); + var obj = getPiwikQueryParameters(e); //Make post request to service - makeRequest(obj); + makePiwikRequest(obj); }; /** * Function that creates POST request to CDM endpoint */ - var makeRequest = function (obj) { + var makePiwikRequest = function (obj) { var req = { method: 'POST', - url: url, + url: piwikUrl, headers: { 'Content-Type': 'application/json', - 'Accept': 'application/json' + 'Accept': 'application/json', + 'consent-reference': getConsentReference() }, data: JSON.stringify(obj) }; + //pass 'piwik' as event type if the tracking endpoint is the edge endpoint + if (piwikUrl.indexOf('edge') >= 0) { + req.headers['event-type'] = 'piwik'; + req.headers[settings.headers.hybrisTenant] = appConfig.storeTenant(); + } + $http(req).success(function () { - //Get all items that failed before and resend them to PIWIK server - var items = localStorage.getAllItems(yTrackingLocalStorageKey); - for (var i = 0; i < items.length; i++) { - makeRequest(items[i]); - } - }).error(function () { - //Store request to localstorage so it can be sent again when possible - localStorage.addItemToArray(yTrackingLocalStorageKey, obj); - }); + //Get all items that failed before and resend them to PIWIK server + var items = localStorage.getAllItems(yTrackingLocalStorageKey); + for (var i = 0; i < items.length; i++) { + makePiwikRequest(items[i]); + } + }).error(function () { + //Store request to localstorage so it can be sent again when possible + localStorage.addItemToArray(yTrackingLocalStorageKey, obj); + }); + }; /** @@ -162,7 +211,7 @@ angular.module('ds.ytracking', []) $window._paq = $window._paq || []; //Make requests to service custom - $window._paq.push(['setCustomRequestProcessing', processRequest]); + $window._paq.push(['setCustomRequestProcessing', processPiwikRequest]); //Set document title $window._paq.push(['setDocumentTitle', 'PageViewEvent']); @@ -170,7 +219,7 @@ angular.module('ds.ytracking', []) //Set user id to equal the user token //$window._paq.push(['setUserId', TokenSvc.getToken().getAccessToken().toString()]); - $window._paq.push(['setTrackerUrl', url]); + $window._paq.push(['setTrackerUrl', piwikUrl]); //Add site code. It should be . $window._paq.push(['setSiteId', GlobalData.store.tenant + '.' + GlobalData.getSiteCode()]); diff --git a/public/js/app/shared/http-proxy.js b/public/js/app/shared/http-proxy.js index 9d8e12642..33216dc02 100644 --- a/public/js/app/shared/http-proxy.js +++ b/public/js/app/shared/http-proxy.js @@ -101,7 +101,17 @@ angular.module('ds.httpproxy', []) $injector.get('$state').go('errors', { errorId: '404' }); } else if (response.status === 500) { //show error view with default message. - $injector.get('$state').go('errors'); + if(response.config.url.indexOf('orders') < 0 && response.config.url.indexOf('me') < 0) { + $injector.get('$state').go('errors'); + }else { + if (response.config.url.indexOf('orders') > 0) { + return $q.when(response); + }else if (response.config.url.indexOf('me') > 0) { + return $q.reject(response); + } + } + + } } diff --git a/public/js/app/shared/i18n/lang/de.js b/public/js/app/shared/i18n/lang/de.js index f38aaa7a3..f124a8365 100644 --- a/public/js/app/shared/i18n/lang/de.js +++ b/public/js/app/shared/i18n/lang/de.js @@ -35,6 +35,8 @@ angular.module('ds.i18n') //XFLD: Est. is short for Estimated EST_ORDER_TOTAL:'Geschätzte Bestellsumme', //XFLD + "PREVIEW_ORDER": "Preview Order", + //XFLD FREE_SHIPPING:'Versand und Rücksendung in den USA kostenlos', //XFLD ITEM:'Position', @@ -54,6 +56,8 @@ angular.module('ds.i18n') APPLY:'Anwenden', //XMSG ESTIMATE_TAX_ERROR:'Felder "Postleitzahl" und "Ländercode" sind erforderlich', + //XMSG + ADDITIONAL_SHIPPING_OPTIONS: 'Additional shipping options are available in checkout.', //XFLD //------------------------------------------------- @@ -68,6 +72,8 @@ angular.module('ds.i18n') ADDRESS_LINE_2:'Adresszeile 2', //XGRP BILLING_ADDRESS:'Rechnungsadresse', + //XGRP + CANT_BE_SHIPPED: 'Items cannot be shipped to this location', //XFLD CITY:'Ort', //XFLD: Is part of the Canadian and German address forms @@ -278,7 +284,18 @@ angular.module('ds.i18n') // Product Detail Page //------------------------------------------------- + //XFLD + SHIPPING_INFORMATION: 'Versandinformationen', + //XFLD + SHIPPING_ZONE: 'Versandzone', + //XFLD + STANDARD_SHIPPING: 'Standardversand', + //XFLD + SHIPPING_RATE: 'Liefergeschwindigkeit', + //XFLD + ZONE: 'Zone', + BUY:'Kaufen', //XBUT ADD_TO_CART:'In den Warenkorb', @@ -292,6 +309,10 @@ angular.module('ds.i18n') QTY:'Menge', //XMSG ERROR_ADDING_TO_CART:'Hinzufügen zum Warenkorb war nicht erfolgreich. Versuchen Sie es noch einmal.', + //XMSG + INCLUDES: 'Includes', + //XMSG + NO_LIMIT: 'No Limit', //XLST //------------------------------------------------- @@ -346,6 +367,8 @@ angular.module('ds.i18n') ADDRESSBOOK:'Adressbuch', //XMSG NO_ADDRESSES:'Sie haben keine Adressen gespeichert.', + //XMSG + FAIL_ADDRESSES: 'Addresses not available. Try again later.', //XBUT ADD_ADDRESS:'Adresse hinzufügen', //XBUT @@ -359,6 +382,8 @@ angular.module('ds.i18n') //XFLD CONTACT_PHONE:'Telefon', //XFLD + FAIL_CUSTOMER_DETAILS: 'Customer details not available. Try again later.', + //XFLD DATE:'Datum', //XMSG NAME_REQUIRED:'Name erforderlich', @@ -374,7 +399,10 @@ angular.module('ds.i18n') ORDER_NUMBER:'Bestellnummer', //XFLD ORDER_STATUS: 'Bestellstatus', - + //XFLD + FAIL_ORDER: 'Orders not available. Try again later.', + //XFLD + NO_ORDERS: 'You have no orders stored.', //XSEL ORDER_ITEM_COUNT: '{{number}} Position', //XSEL @@ -404,6 +432,12 @@ angular.module('ds.i18n') SHOW_LESS:'Weniger anzeigen', //XFLD ITEMS_IN_ORDER: 'Menge Artikel', + //XMSG + SAVE_ADDRESS_ERROR: 'An error occured and updates not saved. Save updates.', + //XMSG + REMOVE_ADDRESS_ERROR: 'Deleting address failed. Please try again.', + //XMSG + UPDATE_DEFAULT_ADDRESS_ERROR: 'Updating default address failed. Please try again.', //XBUT //------------------------------------------------- diff --git a/public/js/app/shared/i18n/lang/en.js b/public/js/app/shared/i18n/lang/en.js index 6fe035556..a0c518504 100644 --- a/public/js/app/shared/i18n/lang/en.js +++ b/public/js/app/shared/i18n/lang/en.js @@ -12,16 +12,18 @@ 'use strict'; +/* jshint ignore:start */ + angular.module('ds.i18n') .constant('TranslationsEN', { //XFLD - en: 'English', + "en": "English", //XFLD - de: 'German', + "de": "German", //XFLD - fr: 'French', + "fr": "French", //XFLD - es: 'Spanish', + "es": "Spanish", //XFLD //------------------------------------------------- @@ -29,37 +31,41 @@ angular.module('ds.i18n') //------------------------------------------------- //XBUT - BACK_TO_CHECKOUT: 'Back to checkout', + "BACK_TO_CHECKOUT": "Back to checkout", //XBUT - CHECKOUT: 'Checkout', + "CHECKOUT": "Checkout", //XBUT - CONTINUE_SHOPPING: 'Continue shopping', + "CONTINUE_SHOPPING": "Continue shopping", //XBUT - SHOP: 'Shop', + "SHOP": "Shop", + //XFLD + "EST_ORDER_TOTAL": "Est. order total", //XFLD - EST_ORDER_TOTAL: 'Est. order total', + "PREVIEW_ORDER": "Preview Order", //XFLD - FREE_SHIPPING: 'Free Shipping and Returns in the US', + "FREE_SHIPPING": "Free Shipping and Returns in the US", //XFLD - ITEM: 'Item', + "ITEM": "Item", //XFLD - ITEM_PRICE: 'Item Price', + "ITEM_PRICE": "Item Price", //XFLD - TOTAL_PRICE: 'Total Price', + "TOTAL_PRICE": "Total Price", //XMSG - CART_UNAVAILABLE: 'The cart is currently unavailable. Please try again.', + "CART_UNAVAILABLE": "The cart is currently unavailable. Please try again.", //XMSG - CART_EMPTY: 'Your cart is empty', + "CART_EMPTY": "Your cart is empty", //XMSG - CART_ITEM_UPDATE_ERROR: 'The update was not successful. Please try again.', + "CART_ITEM_UPDATE_ERROR": "The update was not successful. Please try again.", //XFLD - ESTIMATE_TAX: 'Estimate Tax', + "ESTIMATE_TAX": "Estimate Tax", //XFLD - APPLY: 'Apply', + "APPLY": "Apply", //XFLD - ESTIMATE_TAX_ERROR: 'Zip/Postal Code and Country Code fields are required', + "ESTIMATE_TAX_ERROR": "Zip/Postal Code and Country Code fields are required", //XMSG - SELECT_A_COUNTRY: 'Select a country', + "ADDITIONAL_SHIPPING_OPTIONS": 'Additional shipping options are available in checkout.', + //XMSG + "SELECT_A_COUNTRY": "Select a country", //XFLD //------------------------------------------------- @@ -67,117 +73,119 @@ angular.module('ds.i18n') //------------------------------------------------- //XFLD - ADDRESS: 'Address', + "ADDRESS": "Address", //XFLD - ADDRESS_LINE_1: 'Address Line 1', + "ADDRESS_LINE_1": "Address Line 1", //XFLD - ADDRESS_LINE_2: 'Address Line 2', + "ADDRESS_LINE_2": "Address Line 2", + //XGRP + "CANT_BE_SHIPPED": 'Items cannot be shipped to this location', //XGRP - BILLING_ADDRESS: 'Billing Address', + "BILLING_ADDRESS": "Billing Address", //XFLD - CITY: 'City', + "CITY": "City", //XFLD - PROVINCE: 'Province', + "PROVINCE": "Province", //XBUT - CONTINUE: 'Continue', + "CONTINUE": "Continue", //XFLD - COUNTRY: 'Country', + "COUNTRY": "Country", //XFLD - CREDIT_CARD_NUMBER: 'Credit Card Number', + "CREDIT_CARD_NUMBER": "Credit Card Number", //XFLD - CVC_NUMBER: 'CVC Number', + "CVC_NUMBER": "CVC Number", //XFLD - DELIVERY_METHOD: 'Delivery Method', + "DELIVERY_METHOD": "Delivery Method", //XFLD - EMAIL: 'Email', + "EMAIL": "Email", //XBUT - EDIT: 'Edit', + "EDIT": "Edit", //XFLD - FIRST_NAME: 'First Name', + "FIRST_NAME": "First Name", //XLST - FREE_STANDARD_SHIPPING: 'Free Standard Shipping', + "FREE_STANDARD_SHIPPING": "Free Standard Shipping", //XLST - FLAT_RATE_SHPPING: 'Flat Rate', + "FLAT_RATE_SHPPING": "Flat Rate", //XMSG - INVALID_EXPIRATION_DATE: 'Invalid Expiration Date', + "INVALID_EXPIRATION_DATE": "Invalid Expiration Date", //XFLD - ITEMS: 'Items', + "ITEMS": "Items", //XFLD - LAST_NAME: 'Last Name', + "LAST_NAME": "Last Name", //XFLD - LAST_NAME_REQUIRED: 'Last Name Required', + "LAST_NAME_REQUIRED": "Last Name Required", //XFLD - METHOD: 'Method', + "METHOD": "Method", //XFLD - MIDDLE_NAME: 'Middle Name', + "MIDDLE_NAME": "Middle Name", //XFLD - MONTH: 'Month', + "MONTH": "Month", //XFLD - NAME: 'Name', + "NAME": "Name", //XMSG - NO_ITEMS_IN_CART: 'There are no items in your cart.', + "NO_ITEMS_IN_CART": "There are no items in your cart.", //XACT - OPTIONAL: 'Optional', + "OPTIONAL": "Optional", //XGRP - ORDER_DETAILS: 'Order Details', + "ORDER_DETAILS": "Order Details", //XFLD - ORDER_DATE: 'Order Date', + "ORDER_DATE": "Order Date", //XMSG - ORDER_PENDING: 'One moment... Placing your order', + "ORDER_PENDING": "One moment... Placing your order", //XFLD - ORDER_TOTAL: 'Order Total', + "ORDER_TOTAL": "Order Total", //XFLD - PAYMENT: 'Payment', + "PAYMENT": "Payment", //XMSG - PHONE_REQUIRED: 'Phone Required', + "PHONE_REQUIRED": "Phone Required", //XBUT - PLACE_ORDER: 'Place Order', + "PLACE_ORDER": "Place Order", //XFLD - PLACED_AT: 'Placed At', + "PLACED_AT": "Placed At", //XMSG - PLEASE_CORRECT_ERRORS: 'Please correct the errors above before placing your order.', + "PLEASE_CORRECT_ERRORS": "Please correct the errors above before placing your order.", //XMSG - PLEASE_ENTER_VALID_CC: 'Please enter a valid credit card number', + "PLEASE_ENTER_VALID_CC": "Please enter a valid credit card number", //XMSG - PLEASE_ENTER_VALID_CODE: 'Please enter a valid code', + "PLEASE_ENTER_VALID_CODE": "Please enter a valid code", //XMSG - PLEASE_ENTER_VALID_EMAIL: 'Please enter a valid email in the format name@example.com', + "PLEASE_ENTER_VALID_EMAIL": "Please enter a valid email in the format name@example.com", //XACT - REQUIRED: 'Required', + "REQUIRED": "Required", //XCKL - SAME_AS_BILLING_ADDRESS: 'Same As Billing Address', + "SAME_AS_BILLING_ADDRESS": "Same As Billing Address", //XTIT - SECURE_CHECKOUT: 'Secure Checkout', + "SECURE_CHECKOUT": "Secure Checkout", //XBUT - SELECT_FROM_ADDRESS_BOOK: 'Select from address book', + "SELECT_FROM_ADDRESS_BOOK": "Select from address book", //XFLD - SHIPPING: 'Shipping', + "SHIPPING": "Shipping", //XGRP - SHIPPING_ADDRESS: 'Shipping Address', + "SHIPPING_ADDRESS": "Shipping Address", //XGRP - SIMPLE_3_STEP_CHECKOUT: 'Simple 3 Step Checkout', + "SIMPLE_3_STEP_CHECKOUT": "Simple 3 Step Checkout", //XGRP - SIMPLE_4_STEP_CHECKOUT: 'Simple 4 Step Checkout', + "SIMPLE_4_STEP_CHECKOUT": "Simple 4 Step Checkout", //XFLD - STATE: 'State', + "STATE": "State", //XGRP - STEP_1_MY_DETAILS: 'Step 1. My Details', + "STEP_1_MY_DETAILS": "Step 1. My Details", //XGRP - STEP_2_SHIPPING_INFORMATION: 'Step 2. Shipping Information', + "STEP_2_SHIPPING_INFORMATION": "Step 2. Shipping Information", //XGRP - STEP_3_PAYMENT: 'Step 3. Payment', + "STEP_3_PAYMENT": "Step 3. Payment", //XGRP - STEP_4_REVIEW_ORDER: 'Step 4. Review Order', + "STEP_4_REVIEW_ORDER": "Step 4. Review Order", //XFLD - SUBTOTAL: 'Subtotal', + "SUBTOTAL": "Subtotal", //XFLD - DISCOUNT: 'Discount', + "DISCOUNT": "Discount", //XFLD - TAX: 'Tax', + "TAX": "Tax", //XFLD - TOTAL: 'Total', + "TOTAL": "Total", //XFLD - YEAR: 'Year', + "YEAR": "Year", //XFLD @@ -186,27 +194,27 @@ angular.module('ds.i18n') //------------------------------------------------- //XFLD - DEFAULT: 'Default', + "DEFAULT": "Default", //XFLD - DISTRICT: 'District', + "DISTRICT": "District", //XFLD - STREET_NAME: 'Street Name/ Number', + "STREET_NAME": "Street Name/ Number", //XFLD - BUILDING_NAME: 'Building Name/ Number', + "BUILDING_NAME": "Building Name/ Number", //XFLD - ROOM_NUMBER: 'Room Number', + "ROOM_NUMBER": "Room Number", //XFLD - PREFECTURE: 'Prefecture', + "PREFECTURE": "Prefecture", //XFLD - POSTAL_CODE: 'Postal Code', + "POSTAL_CODE": "Postal Code", //XFLD - ZIP: 'Zip/ Postal Code', + "ZIP": "Zip/ Postal Code", //XFLD - CITY_VILLAGE: 'City/ Village/ City Ward', + "CITY_VILLAGE": "City/ Village/ City Ward", //XFLD - SUBAREA: 'Subarea', + "SUBAREA": "Subarea", //XFLD - FURTHER_SUBAREA: 'Further Subarea, Block #/ House #', + "FURTHER_SUBAREA": "Further Subarea, Block #/ House #", //XFLD //------------------------------------------------- @@ -214,23 +222,23 @@ angular.module('ds.i18n') //------------------------------------------------- //XBUT - COUPON_APPLY: 'Apply', + "COUPON_APPLY": "Apply", //XFLD - COUPON_APPLIED: 'Applied', + "COUPON_APPLIED": "Applied", //XLNK - COUPON_CODE: 'Add Coupon Code', + "COUPON_CODE": "Add Coupon Code", //XMSG - COUPON_ERROR: 'Coupon not valid.', + "COUPON_ERROR": "Coupon not valid.", //XMSG - COUPON_ERR_CURRENCY: 'Currency invalid with coupon', + "COUPON_ERR_CURRENCY": "Currency invalid with coupon", //XMSG - COUPON_ERR_ANONYMOUS: 'Sign in to use coupon code', + "COUPON_ERR_ANONYMOUS": "Sign in to use coupon code", //XMSG - COUPON_ERR_UNAVAILABLE: 'Coupon no longer available', + "COUPON_ERR_UNAVAILABLE": "Coupon no longer available", //XMSG - COUPON_MINIMUM_NOT_MET: 'Current order total does not meet the required minimum for this coupon', + "COUPON_MINIMUM_NOT_MET": "Current order total does not meet the required minimum for this coupon", //XMSG - COUPON_NOT_VALID: 'Coupon Not Valid', + "COUPON_NOT_VALID": "Coupon Not Valid", //XFLD @@ -239,41 +247,41 @@ angular.module('ds.i18n') //------------------------------------------------- //XMSG - A_COPY_OF_YOUR_ORDER_DETAILS_HAS_BEEN_SENT_TO: '

A copy of your order details has been sent to {{emailAddress}}

', + "A_COPY_OF_YOUR_ORDER_DETAILS_HAS_BEEN_SENT_TO": "

A copy of your order details has been sent to {{emailAddress}}

", //XMSG - ENJOY_YOUR_ITEMS: 'Enjoy your items!', + "ENJOY_YOUR_ITEMS": "Enjoy your items!", //XMSG - FOR_YOUR_ORDER: 'for your order!', + "FOR_YOUR_ORDER": "for your order!", //XMSG - ITEM_IN_YOUR_ORDER: 'Item in your order', + "ITEM_IN_YOUR_ORDER": "Item in your order", //XMSG - ITEMS_IN_YOUR_ORDER: 'Items in your order', + "ITEMS_IN_YOUR_ORDER": "Items in your order", //XMSG - QUESTIONS: '

If you have any questions, contact us at {{contactInfo}}.

', + "QUESTIONS": "

If you have any questions, contact us at {{contactInfo}}.

", //XFLD - ORDER: 'Order', + "ORDER": "Order", //XBUT - RETURN_TO_SHOPPING: 'Return to shopping', + "RETURN_TO_SHOPPING": "Return to shopping", //XMSG - SUCCESS: 'Success!', + "SUCCESS": "Success!", //XMSG - ACCOUNT_SUCCESS: 'Your account was successfully created!', + "ACCOUNT_SUCCESS": "Your account was successfully created!", //XMSG - THANK_YOU: 'Thank you', + "THANK_YOU": "Thank you", //XMSG - THANK_YOU_FOR_YOUR_ORDER: 'Thank you
for your order!', + "THANK_YOU_FOR_YOUR_ORDER": "Thank you
for your order!", //XMSG - THE_SHIPMENT_IS_SCHEDULED_TO_ARRIVE_AT_THE_FOLLOWING_LOCATION: 'The order will be shipped to', + "THE_SHIPMENT_IS_SCHEDULED_TO_ARRIVE_AT_THE_FOLLOWING_LOCATION": "The order will be shipped to", //XMSG - YOUR_ORDER_IS: 'Your order # is ', + "YOUR_ORDER_IS": "Your order # is ", //XMSG - ONE_MORE_STEP: 'One More Step to Create an Account for a Fast Checkout and Easy Access to Previous Orders', + "ONE_MORE_STEP": "One More Step to Create an Account for a Fast Checkout and Easy Access to Previous Orders", //XFLD - SKU: 'SKU', + "SKU": "SKU", //XMSG - YOUR_CHECKOUT_HAS_BEEN_ACCEPTED_ORDER_NOT_CREATED: 'Your checkout has been accepted, but the order has not been created. For tracking purposes, please use the following checkout ID number: ', + "YOUR_CHECKOUT_HAS_BEEN_ACCEPTED_ORDER_NOT_CREATED": "Your checkout has been accepted, but the order has not been created. For tracking purposes, please use the following checkout ID number: ", //XMSG - YOUR_ORDER_WILL_BE_CREATED: 'Your order will be created as soon as possible.', + "YOUR_ORDER_WILL_BE_CREATED": "Your order will be created as soon as possible.", //XFLD @@ -282,11 +290,11 @@ angular.module('ds.i18n') //------------------------------------------------- //XFLD - PRODUCTS: 'Products', + "PRODUCTS": "Products", //XBUT - BACK_TO: 'Back To', + "BACK_TO": "Back To", //XFLD - REGION: 'Region', + "REGION": "Region", //XFLD @@ -294,21 +302,36 @@ angular.module('ds.i18n') // Product Detail Page //------------------------------------------------- + + //XFLD + SHIPPING_INFORMATION: 'Shipping information', + //XFLD + SHIPPING_ZONE: 'Shipping Zone', + + //XFLD + STANDARD_SHIPPING: 'Standard Shipping', + //XFLD + SHIPPING_RATE: 'Shipping Rate', + //XFLD + ZONE: 'Zone', //XBUT - BUY: 'Buy', + "BUY": "Buy", //XBUT - ADD_TO_CART:'Add to Cart', + "ADD_TO_CART":"Add to Cart", //XTIT - PRODUCT_DESCRIPTION: 'Product Description', + "PRODUCT_DESCRIPTION": "Product Description", //XTIT - PRODUCT_DETAILS: 'Product Details', + "PRODUCT_DETAILS": "Product Details", //XBUT - OUT_OF_STOCK: 'out of stock', + "OUT_OF_STOCK": "out of stock", //XFLD - QTY: 'Qty', + "QTY": "Qty", //XMSG - ERROR_ADDING_TO_CART: 'Add to Cart was not successful. Please try again.', - + "INCLUDES": 'Includes', + //XMSG + "NO_LIMIT": 'No Limit', + //XMSG + "ERROR_ADDING_TO_CART": "Add to Cart was not successful. Please try again.", //XFLD //------------------------------------------------- @@ -316,41 +339,41 @@ angular.module('ds.i18n') //------------------------------------------------- //XLST - NEWEST: 'newest', + "NEWEST": "newest", //XFLD - OF: 'of', + "OF": "of", //XLST - PRICE_HIGH_LOW: 'price high - low', + "PRICE_HIGH_LOW": "price high - low", //XLST - PRICE_LOW_HIGH: 'price low - high', + "PRICE_LOW_HIGH": "price low - high", //XFLD - SORT_BY: 'Sort by', + "SORT_BY": "Sort by", //XFLD - VIEWING: 'Viewing', + "VIEWING": "Viewing", //XFLD - PRODUCTS_FROM_TO: '
{{productsFrom}}-{{productsTo}} of {{total}}
', + "PRODUCTS_FROM_TO": "
{{productsFrom}}-{{productsTo}} of {{total}}
", //XFLD - ALL_PRODUCTS: 'All Products', + "ALL_PRODUCTS": "All Products", //XTIT - EMPTY_MSG: 'Demo Store - Coming Soon', + "EMPTY_MSG": "Demo Store - Coming Soon", //XFLD - LANGUAGES: 'Languages', + "LANGUAGES": "Languages", //XFLD - SELECT_LANGUAGE: 'Select a language', + "SELECT_LANGUAGE": "Select a language", //XBUT - SIGN_OUT: 'Sign Out', + "SIGN_OUT": "Sign Out", //XBUT - SIGN_IN: 'Sign In', + "SIGN_IN": "Sign In", //XBUT - SIGN_IN_WITH_FACEBOOK: 'Sign in with Facebook', + "SIGN_IN_WITH_FACEBOOK": "Sign in with Facebook", //XBUT - LOG_IN_WITH_GOOGLE_PLUS: 'Sign in with Google +', + "LOG_IN_WITH_GOOGLE_PLUS": "Sign in with Google +", //XBUT - MY_ACCOUNT: 'My Account', + "MY_ACCOUNT": "My Account", //XBUT - CREATE_ACCOUNT: 'Create Account', + "CREATE_ACCOUNT": "Create Account", //XBUT - CONTINUE_AS_GUEST: 'Continue as our guest', + "CONTINUE_AS_GUEST": "Continue as our guest", //XFLD @@ -359,75 +382,90 @@ angular.module('ds.i18n') //------------------------------------------------- //XFLD - ACCOUNT_DETAILS: 'Account details', + "ACCOUNT_DETAILS": "Account details", //XBUT - ADD: 'Add', - REGION_PREFERENCES: 'Region Preferences', - NEW_EMAIL: 'New Email', + "ADD": "Add", + //XFLD + "REGION_PREFERENCES": "Region Preferences", + //XFLD + "NEW_EMAIL": "New Email", //XGRP - ADDRESSBOOK: 'Addressbook', + "ADDRESSBOOK": "Addressbook", + //XMSG + "NO_ADDRESSES": "You have no addresses stored!", //XMSG - NO_ADDRESSES: 'You have no addresses stored!', + "FAIL_ADDRESSES": "Addresses not available. Try again later.", //XBUT - ADD_ADDRESS: 'Add Address', + "ADD_ADDRESS": "Add Address", //XBUT - CLOSE: 'Close', + "CLOSE": "Close", //XFLD - COMPANY_NAME: 'Company', + "COMPANY_NAME": "Company", //XMSG - CONFIRM_ADDRESS_REMOVAL: 'Are you sure you want to remove the address?', + "CONFIRM_ADDRESS_REMOVAL": "Are you sure you want to remove the address?", //XFLD - FULL_NAME: 'Full Name', + "FULL_NAME": "Full Name", //XFLD - CONTACT_PHONE: 'Phone', + "CONTACT_PHONE": "Phone", //XFLD - DATE: 'Date', + "FAIL_CUSTOMER_DETAILS": "Customer details not available. Try again later.", + //XFLD + "DATE": "Date", //XMSG - NAME_REQUIRED: 'Name Required', + "NAME_REQUIRED": "Name Required", //XFLD - STREET: 'Street', + "STREET": "Street", //XFLD - STREET_NUMBER: 'Street Number', + "STREET_NUMBER": "Street Number", //XTIT - WELCOME: 'Welcome', + "WELCOME": "Welcome", //XFLD - NOT_SET: 'Not Set', + "NOT_SET": "Not Set", //XGRP - ORDER_HISTORY: 'Order History', + "ORDER_HISTORY": "Order History", //XFLD - ORDER_NUMBER: 'Order Number', + "ORDER_NUMBER": "Order Number", //XFLD - ORDER_STATUS: 'Order Status', - + "ORDER_STATUS": "Order Status", + //XFLD + "FAIL_ORDER": "Orders not available. Try again later.", + //XFLD + "NO_ORDERS": "You have no orders stored", //XSEL - ORDER_ITEM_COUNT: '{{number}} Item', + "ORDER_ITEM_COUNT": "{{number}} Item", //XSEL - ORDER_ITEMS_COUNT: '{{number}} Items', + "ORDER_ITEMS_COUNT": "{{number}} Items", //XFLD - SHIPPING_DETAILS: 'SHIPPING DETAILS', + "SHIPPING_DETAILS": "SHIPPING DETAILS", //XBUT - SAVE: 'Save', + "SAVE": "Save", //XBUT - UPDATE_PASSWORD: 'Update password', + "UPDATE_PASSWORD": "Update password", //XBUT - CURRENT_PASSWORD: 'Current password', + "CURRENT_PASSWORD": "Current password", //XBUT - NEW_PASSWORD: 'New password', + "NEW_PASSWORD": "New password", //XMSG - CONFIRM_NEW_PASSWORD: 'Confirm new password', + "CONFIRM_NEW_PASSWORD": "Confirm new password", //XMSG - PASSWORDS_NO_MATCH: 'Passwords do not match', + "PASSWORDS_NO_MATCH": "Passwords do not match", //XMSG - WRONG_CURRENT_PASSWORD: 'Please provide correct current password!', + "WRONG_CURRENT_PASSWORD": "Please provide correct current password!", //XMSG - PASSWORD_TOO_SHORT: 'Password too short', + "PASSWORD_TOO_SHORT": "Password too short", //XFLD - SHOW_ALL: 'Show all', + "SHOW_ALL": "Show all", //XFLD - SHOW_LESS: 'Show less', + "SHOW_LESS": "Show less", //XFLD - ITEMS_IN_ORDER: 'Items in Order', + "ITEMS_IN_ORDER": "Items in Order", + //XMSG + "SAVE_ADDRESS_ERROR": "An error occured and updates not saved. Save updates.", + //XMSG + "REMOVE_ADDRESS_ERROR": "Deleting address failed. Please try again.", + //XMSG + "UPDATE_DEFAULT_ADDRESS_ERROR": "Updating default address failed. Please try again.", //XFLD @@ -436,75 +474,75 @@ angular.module('ds.i18n') //------------------------------------------------- //XBUT - FORGOT_PW: 'Forgot your password?', + "FORGOT_PW": "Forgot your password?", //XFLD - PASSWORD: 'Password', + "PASSWORD": "Password", //XACT - PASSWORD_MINCHAR: 'Min. 6 characters', + "PASSWORD_MINCHAR": "Min. 6 characters", //XBUT - CONFIRM_PASSWORD: 'Confirm Password', + "CONFIRM_PASSWORD": "Confirm Password", //XFLD - TOKEN: 'Token', + "TOKEN": "Token", //XBUT - RESET_PASSWORD: 'Reset Password', + "RESET_PASSWORD": "Reset Password", //XGRP - RESET_PW_TITLE: 'Reset Your Password', + "RESET_PW_TITLE": "Reset Your Password", //XMSG - RESET_PW_INSTRUCT: 'Please create a new password.', + "RESET_PW_INSTRUCT": "Please create a new password.", //XMSG - FORGOT_PW_INSTRUCT: 'Please enter your account email address below. An email will be sent to you with a link to reset your password.', + "FORGOT_PW_INSTRUCT": "Please enter your account email address below. An email will be sent to you with a link to reset your password.", //XMSG - REQUEST_PW_EXPIRED: 'Reset Password Request Expired', + "REQUEST_PW_EXPIRED": "Reset Password Request Expired", //XMSG - REQUEST_PW_EXPIRED_MSG: 'The request to reset your password has expired. Please enter your email to make a new request.', + "REQUEST_PW_EXPIRED_MSG": "The request to reset your password has expired. Please enter your email to make a new request.", //XMSG - CHECK_EMAIL:'Check Your Email', + "CHECK_EMAIL":"Check Your Email", //XMSG - CHECK_EMAIL_INSTRUCT: '...and follow the link to reset your password. The link will be valid for 24 hours.', + "CHECK_EMAIL_INSTRUCT": "...and follow the link to reset your password. The link will be valid for 24 hours.", //XMSG - PASSWORD_REQUIRED: 'Password with 6 character minimum required.', + "PASSWORD_REQUIRED": "Password with 6 character minimum required.", //XMSG - PASSWORDS_MUST_MATCH: 'Passwords must match.', + "PASSWORDS_MUST_MATCH": "Passwords must match.", //XMSG - PW_SUCCESS: 'Success', + "PW_SUCCESS": "Success", //XMSG - PW_CHANGED_MSG: 'Your password has been reset. You can now sign into your account.', + "PW_CHANGED_MSG": "Your password has been reset. You can now sign into your account.", //XMSG - INVALID_TOKEN: 'This reset-password link is no longer valid. Please request a new one.', + "INVALID_TOKEN": "This reset-password link is no longer valid. Please request a new one.", //XMSG - PW_CHANGE_FAILED: 'Update of password failed.', + "PW_CHANGE_FAILED": "Update of password failed.", //XMSG - RESET_PW_REPEAT: 'Request another reset-password link.', + "RESET_PW_REPEAT": "Request another reset-password link.", //XACT - FIELD_REQUIRED: 'Field is required!', + "FIELD_REQUIRED": "Field is required!", //XACT - FIELD_TOO_SHORT: 'Field too short!', + "FIELD_TOO_SHORT": "Field too short!", //XACT - FIELDS_NOT_MATCHING: 'Fields not matching!', + "FIELDS_NOT_MATCHING": "Fields not matching!", //XMSG - SERVER_UNAVAILABLE: 'Server is unavailable, please try again later.', + "SERVER_UNAVAILABLE": "Server is unavailable, please try again later.", //XMSG - INVALID_CREDENTIALS: 'You entered an invalid email or password.', + "INVALID_CREDENTIALS": "You entered an invalid email or password.", //XMSG - PASSWORD_INVALID: 'Password invalid - minimum of 6 characters required.', + "PASSWORD_INVALID": "Password invalid - minimum of 6 characters required.", //XMSG - ACCOUNT_LOCKED: 'Account has been locked due to excessive number of invalid login attempts. Please wait 5 minutes and try again.', + "ACCOUNT_LOCKED": "Account has been locked due to excessive number of invalid login attempts. Please wait 5 minutes and try again.", //XMSG - ACCOUNT_ALREADY_EXISTS: 'Email address already in use for existing account.', + "ACCOUNT_ALREADY_EXISTS": "Email address already in use for existing account.", //XFLD - FORGOT_PASSWORD: 'Forgot password?', + "FORGOT_PASSWORD": "Forgot password?", //XMSG - EMAIL_NOT_FOUND: 'There is no account associated with that email address.', + "EMAIL_NOT_FOUND": "There is no account associated with that email address.", //XACT - ENTER_EMAIL: 'Enter Email', + "ENTER_EMAIL": "Enter Email", //XMSG - ENTER_EXISTING_EMAIL: 'Enter the email address of an existing account', + "ENTER_EXISTING_EMAIL": "Enter the email address of an existing account", //XMSG - LOGIN_FAILED: 'Login failed', + "LOGIN_FAILED": "Login failed", //XFLD - ACCOUNT_EMAIL: 'Account Email', + "ACCOUNT_EMAIL": "Account Email", //XFLD @@ -513,21 +551,21 @@ angular.module('ds.i18n') //------------------------------------------------- //XMSG - ERROR_TITLE: 'Internal Error', + "ERROR_TITLE": "Internal Error", //XMSG - ERROR_MESSAGE: 'Oops! There\'s a problem.', + "ERROR_MESSAGE": "Oops! There's a problem.", //XMSG - ERROR_TITLE_401: 'Unauthorized', + "ERROR_TITLE_401": "Unauthorized", //XMSG - ERROR_MESSAGE_401: 'Oops! There\'s a problem. Your login credentials don\'t allow access to this page.', + "ERROR_MESSAGE_401": "Oops! There's a problem. Your login credentials don't allow access to this page.", //XMSG - ERROR_TITLE_404: 'Page not found', + "ERROR_TITLE_404": "Page not found", //XMSG - ERROR_MESSAGE_404: 'Oops! There\'s a problem. This page doesn\'t exist.', + "ERROR_MESSAGE_404": "Oops! There's a problem. This page doesn't exist.", //XMSG - ERROR_REDIRECT: 'Here is a page to help you get back on track.', + "ERROR_REDIRECT": "Here is a page to help you get back on track.", //XBUT - ERROR_BUTTON_TEXT: 'HOMEPAGE', + "ERROR_BUTTON_TEXT": "HOMEPAGE", //XFLD @@ -536,15 +574,15 @@ angular.module('ds.i18n') //------------------------------------------------- //XACT - DR: 'Dr.', + "DR": "Dr.", //XACT - MR: 'Mr.', + "MR": "Mr.", //XACT - MRS: 'Mrs.', + "MRS": "Mrs.", //XACT - MS: 'Ms.', + "MS": "Ms.", //XACT - TITLE: 'Title', + "TITLE": "Title", //XFLD @@ -553,15 +591,15 @@ angular.module('ds.i18n') //------------------------------------------------- //XSEL - COMPLETED: 'Completed', + "COMPLETED": "Completed", //XSEL - CONFIRMED: 'Confirmed', + "CONFIRMED": "Confirmed", //XSEL - CREATED: 'Created', + "CREATED": "Created", //XSEL - DECLINED: 'Declined', + "DECLINED": "Declined", //XSEL - SHIPPED: 'Shipped', + "SHIPPED": "Shipped", //XFLD @@ -570,15 +608,15 @@ angular.module('ds.i18n') //------------------------------------------------- //XFLD - CREDIT_CARD: 'Credit Card', + "CREDIT_CARD": "Credit Card", //XFLD - ON: 'on', + "ON": "on", //XFLD - QUANTITY: 'Quantity', + "QUANTITY": "Quantity", //XFLD - SHIPPED_BY_ON: 'Shipped by: {{carrier}} on {{shippedDate}}', + "SHIPPED_BY_ON": "Shipped by: {{carrier}} on {{shippedDate}}", //XFLD - TRACKING_NUMBER: 'Tracking Number: {{trackingNumber}}', + "TRACKING_NUMBER": "Tracking Number: {{trackingNumber}}", //XFLD @@ -587,32 +625,34 @@ angular.module('ds.i18n') //------------------------------------------------- //XFLD - FOUND_FOR: '{{total}} found for {{searchString}}', + "FOUND_FOR": "{{total}} found for {{searchString}}", //XACT - SEARCH: 'Search', + "SEARCH": "Search", //XFLD - SEARCH_RESULTS: 'Search results', + "SEARCH_RESULTS": "Search results", //XFLD - MOST_RELEVANT: 'Most Relevant', + "MOST_RELEVANT": "Most Relevant", //XGRP - RESULTS: 'Results', + "RESULTS": "Results", //XLNK - SEE_ALL: 'See All', + "SEE_ALL": "See All", //XMSG - SEARCH_UNAVAILABLE: 'Search is currently unavailable.', + "SEARCH_UNAVAILABLE": "Search is currently unavailable.", //XMSG - NO_RESULTS_FOUND:'No results found.', - + "NO_RESULTS_FOUND":"No results found.", + //XFLD //------------------------------------------------- // FOOTER //------------------------------------------------- //XFLD - TERMS_AND_CONDITIONS: 'Terms & Conditions', + "TERMS_AND_CONDITIONS": "Terms & Conditions", //XFLD - CONTACT_US: 'Contact Us', + "CONTACT_US": "Contact Us", //XFLD - SITE_MAP: 'Site Map', + "SITE_MAP": "Site Map" }); + +/* jshint ignore:end */ \ No newline at end of file diff --git a/public/js/app/shared/router.js b/public/js/app/shared/router.js index 8b56d9228..e27e58bd7 100644 --- a/public/js/app/shared/router.js +++ b/public/js/app/shared/router.js @@ -151,7 +151,13 @@ angular.module('ds.router', []) else{ return null; } - } + }, + + shippingZones: ['ShippingSvc', 'initialized', 'GlobalData', function (ShippingSvc, initialized, GlobalData) { + if(initialized){ + return ShippingSvc.getSiteShippingZones(GlobalData.getSiteCode()); + } + }] } }) @@ -170,9 +176,14 @@ angular.module('ds.router', []) order: ['CheckoutSvc', function (CheckoutSvc) { return CheckoutSvc.getDefaultOrder(); }], - shippingCost: ['CheckoutSvc', 'initialized', function (CheckoutSvc, initialized) { + shippingZones: ['ShippingSvc', 'initialized', 'GlobalData', function (ShippingSvc, initialized, GlobalData) { + if (initialized) { // parent resolve - if-check to make usage explicit + return ShippingSvc.getSiteShippingZones(GlobalData.getSiteCode()); + } + }], + shippingCountries: ['ShippingSvc', 'initialized', function (ShippingSvc, initialized) { if (initialized) { // parent resolve - if-check to make usage explicit - return CheckoutSvc.getShippingCost(); + return ShippingSvc.getShipToCountries(); } }] } @@ -181,7 +192,7 @@ angular.module('ds.router', []) .state('base.checkout.details', { url: '/checkout/', views: { - 'checkoutcart': { + 'checkoutcart@base.checkout.details': { templateUrl: 'js/app/checkout/templates/checkout-cart.html', controller: 'CheckoutCartCtrl' }, @@ -230,13 +241,27 @@ angular.module('ds.router', []) pageNumber: 1, pageSize: siteConfig.apis.account.addresses.initialPageSize }; - return AccountSvc.getAddresses(query); + return AccountSvc.getAddresses(query).then( + function (response) { + return response; + }, + function () { + return []; + } + ); }], orders: ['OrderListSvc', function(OrderListSvc) { var parms = { pageSize: 10 }; - return OrderListSvc.query(parms); + return OrderListSvc.query(parms).then( + function (response) { + return response; + }, + function () { + return []; + } + ); }] }, data: { diff --git a/public/js/app/shared/services/configuration-service.js b/public/js/app/shared/services/configuration-service.js index c6fac60e0..e7eaf76fe 100644 --- a/public/js/app/shared/services/configuration-service.js +++ b/public/js/app/shared/services/configuration-service.js @@ -133,7 +133,9 @@ angular.module('ds.shared') return account; }).then(function (account) { - CartSvc.refreshCartAfterLogin(account.id); + if(account) { + CartSvc.refreshCartAfterLogin(account.id); + } }); } else { CategorySvc.getCategories().then(function () { diff --git a/public/js/app/shared/services/cookie-svc.js b/public/js/app/shared/services/cookie-svc.js index e0511aae7..cdc8f221f 100644 --- a/public/js/app/shared/services/cookie-svc.js +++ b/public/js/app/shared/services/cookie-svc.js @@ -34,6 +34,13 @@ angular.module('ds.shared') }; }; + var ConsentReferenceCookie = function(consentReference) { + this.consentReference = consentReference; + this.getConsentReference = function () { + return this.consentReference; + }; + }; + var CookieSvc = { setLanguageCookie: function (languageCode, expiresIn) { @@ -59,6 +66,20 @@ angular.module('ds.shared') return siteCookie.site; } return siteCookie; + }, + + setConsentReferenceCookie: function(consentReference, expiresIn) { + ipCookie.remove(settings.consentReferenceCookie); + var consentReferenceCookie = new ConsentReferenceCookie(consentReference); + ipCookie(settings.consentReferenceCookie, JSON.stringify(consentReferenceCookie), { expirationUnit: 'seconds', expires: expiresIn ? expiresIn : defaultExpirySeconds }); + }, + + getConsentReferenceCookie: function() { + var consentReferenceCookie = ipCookie(settings.consentReferenceCookie); + if (consentReferenceCookie) { + return consentReferenceCookie.consentReference; + } + return consentReferenceCookie; } }; diff --git a/public/js/app/shared/services/global-data.js b/public/js/app/shared/services/global-data.js index 7e60709b8..cadcc85de 100644 --- a/public/js/app/shared/services/global-data.js +++ b/public/js/app/shared/services/global-data.js @@ -117,7 +117,8 @@ angular.module('ds.shared') clientId: appConfig.clientId(), redirectURI: appConfig.redirectURI(), name: '', - logo: null + logo: null, + icon: null }, user: { @@ -280,7 +281,8 @@ angular.module('ds.shared') } //Set main image - if (!!site.mixins && !!site.mixins.storeLogoImageKey && !!site.mixins.storeLogoImageKey.value) { + if (!!site.mixins && !!site.mixins.storeLogoImageKey && + !!site.mixins.storeLogoImageKey.value) { this.store.logo = site.mixins.storeLogoImageKey.value; } else { @@ -288,6 +290,16 @@ angular.module('ds.shared') delete this.store.logo; } + //Set site icon + if (!!site.mixins && !!site.mixins.storeIconImageKey && + !!site.mixins.storeIconImageKey.value) { + this.store.icon = site.mixins.storeIconImageKey.value; + } + else { + //Delete this property and make store fallback to default + delete this.store.icon; + } + //Create array if (site.currency) { if (site.currency !== this.getCurrencyId()) { diff --git a/public/js/app/shared/settings.js b/public/js/app/shared/settings.js index c98928747..8728fc503 100644 --- a/public/js/app/shared/settings.js +++ b/public/js/app/shared/settings.js @@ -29,6 +29,7 @@ angular.module('ds.shared') accessCookie: 'auth.user', languageCookie: 'languageCookie', siteCookie: 'siteCookie', + consentReferenceCookie: 'consentReferenceCookie', // header keys headers: { diff --git a/public/js/app/shared/site-config.js b/public/js/app/shared/site-config.js index 617f025e4..8553ce831 100644 --- a/public/js/app/shared/site-config.js +++ b/public/js/app/shared/site-config.js @@ -37,63 +37,67 @@ angular.module('ds.shared') this.apis = { account: { - baseUrl: 'https://' + apiPath + '/hybris/account/b1', + baseUrl: 'https://' + apiPath + '/hybris/account/v1', addresses: { initialPageSize: 6 } }, cart: { - baseUrl: 'https://' + apiPath + '/hybris/cart/b1/' + tenantId + baseUrl: 'https://' + apiPath + '/hybris/cart/v1/' + tenantId + }, + + cartcalculation: { + baseUrl: 'https://' + apiPath + '/hybris/cartcalculation/v1/' + tenantId }, categories: { - baseUrl: 'https://' + apiPath + '/hybris/category/b1/' + tenantId + baseUrl: 'https://' + apiPath + '/hybris/category/v1/' + tenantId }, checkout: { - baseUrl: 'https://' + apiPath + '/hybris/checkout/b1/' + tenantId + baseUrl: 'https://' + apiPath + '/hybris/checkout/v1/' + tenantId }, coupon: { - baseUrl: 'https://' + apiPath + '/hybris/coupon/b1/' + tenantId + baseUrl: 'https://' + apiPath + '/hybris/coupon/v1/' + tenantId }, customers: { - baseUrl: 'https://' + apiPath + '/hybris/customer/b1/' + tenantId + baseUrl: 'https://' + apiPath + '/hybris/customer/v1/' + tenantId }, orders: { - baseUrl: 'https://' + apiPath + '/hybris/order/b1/' + tenantId + baseUrl: 'https://' + apiPath + '/hybris/order/v1/' + tenantId }, prices: { - baseUrl: 'https://' + apiPath + '/hybris/price/b1/' + tenantId + baseUrl: 'https://' + apiPath + '/hybris/price/v1/' + tenantId }, products: { - baseUrl: 'https://' + apiPath + '/hybris/product/b1/' + tenantId, + baseUrl: 'https://' + apiPath + '/hybris/product/v1/' + tenantId, pageSize: 10 }, productDetails: { - baseUrl: 'https://' + apiPath + '/hybris/productdetails/b1/' + tenantId + baseUrl: 'https://' + apiPath + '/hybris/productdetails/v1/' + tenantId }, shippingCosts: { - baseUrl: 'https://' + apiPath + '/hybris/shippingcost/b1/' + tenantId + baseUrl: 'https://' + apiPath + '/hybris/shippingcost/v1/' + tenantId }, - siteSettings: { - baseUrl: 'https://' + apiPath + '/hybris/site/b1/' + tenantId + shippingZones: { + baseUrl: 'https://' + apiPath + '/hybris/shipping/v1/' + tenantId }, - tracking: { - baseUrl: 'https://' + apiPath + '/hybris/piwik/b1/' + tenantId + '/events' + siteSettings: { + baseUrl: 'https://' + apiPath + '/hybris/site/v1/' + tenantId }, indexing: { - baseUrl: 'https://' + apiPath + '/hybris/search-algolia/b1/' + tenantId + baseUrl: 'https://' + apiPath + '/hybris/search-algolia/v1/' + tenantId } }; diff --git a/public/js/app/shared/templates/footer.html b/public/js/app/shared/templates/footer.html index c98096ccc..54c9a7ed4 100644 --- a/public/js/app/shared/templates/footer.html +++ b/public/js/app/shared/templates/footer.html @@ -1,49 +1,22 @@