@infrab4a/connect-angular 2.0.3 → 2.0.5-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/infrab4a-connect-angular.umd.js +7 -14
- package/bundles/infrab4a-connect-angular.umd.js.map +1 -1
- package/esm2015/services/cart.service.js +6 -16
- package/esm2015/services/home-shop.service.js +4 -1
- package/fesm2015/infrab4a-connect-angular.js +7 -14
- package/fesm2015/infrab4a-connect-angular.js.map +1 -1
- package/package.json +2 -2
- package/services/cart.service.d.ts +1 -2
- package/services/home-shop.service.d.ts +1 -0
|
@@ -828,8 +828,8 @@
|
|
|
828
828
|
});
|
|
829
829
|
};
|
|
830
830
|
this.getProductPrice = function (_h) {
|
|
831
|
-
var product = _h.product,
|
|
832
|
-
var info = product.
|
|
831
|
+
var product = _h.product, isSubscriber = _h.isSubscriber;
|
|
832
|
+
var info = product.price;
|
|
833
833
|
if (product.isGift)
|
|
834
834
|
return 0;
|
|
835
835
|
return isSubscriber && info.subscriberPrice > 0 ? info.subscriberPrice : info.price;
|
|
@@ -872,8 +872,8 @@
|
|
|
872
872
|
/**
|
|
873
873
|
* @deprecated The method should not be used
|
|
874
874
|
*/
|
|
875
|
-
CartService.prototype.getVariantPriceDiscount = function (item
|
|
876
|
-
return this.authService.getUser().pipe(operators.concatMap(function (user) { return rxjs.iif(function () { return user.isSubscriber && !!item.
|
|
875
|
+
CartService.prototype.getVariantPriceDiscount = function (item) {
|
|
876
|
+
return this.authService.getUser().pipe(operators.concatMap(function (user) { return rxjs.iif(function () { return user.isSubscriber && !!item.price.subscriberPrice; }, rxjs.of(item.price.subscriberPrice), rxjs.of(item.price.price)); }), operators.catchError(function () { return rxjs.of(item.price.price); }));
|
|
877
877
|
};
|
|
878
878
|
CartService.prototype.removeItem = function (item) {
|
|
879
879
|
var _this = this;
|
|
@@ -907,16 +907,6 @@
|
|
|
907
907
|
var _this = this;
|
|
908
908
|
return this.checkoutService.getCheckout(checkoutData).pipe(operators.map(function (checkout) { return checkout.lineItems; }), operators.concatMap(function (lineItems) { return rxjs.of(_this.generateCartObject(lineItems)); }));
|
|
909
909
|
};
|
|
910
|
-
CartService.prototype.getSubTotalDiscount = function (coupon) {
|
|
911
|
-
return function (subTotalPrice) {
|
|
912
|
-
switch (coupon.type) {
|
|
913
|
-
case i2.CouponTypes.ABSOLUTE:
|
|
914
|
-
return subTotalPrice - coupon.discount;
|
|
915
|
-
case i2.CouponTypes.PERCENTAGE:
|
|
916
|
-
return subTotalPrice * (1 - coupon.discount / 100);
|
|
917
|
-
}
|
|
918
|
-
};
|
|
919
|
-
};
|
|
920
910
|
return CartService;
|
|
921
911
|
}());
|
|
922
912
|
CartService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: CartService, deps: [{ token: AuthService }, { token: CheckoutService }, { token: DEFAULT_SHOP }, { token: 'ProductRepository' }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
@@ -1076,6 +1066,9 @@
|
|
|
1076
1066
|
return [home.blogBanner];
|
|
1077
1067
|
}));
|
|
1078
1068
|
};
|
|
1069
|
+
HomeShopService.prototype.getMinValueForFreeShipping = function () {
|
|
1070
|
+
return this.getHomeConfiguration().pipe(operators.map(function (home) { return home.minValueForFreeShipping; }));
|
|
1071
|
+
};
|
|
1079
1072
|
HomeShopService.prototype.getDiscoverProducts = function () {
|
|
1080
1073
|
var _this = this;
|
|
1081
1074
|
return this.getHomeConfiguration().pipe(operators.concatMap(function (home) { return rxjs.from(_this.categoryRepository.getCategoriesForHome(home.discoverCategories)).pipe(operators.map(function (groups) { return groups.map(_this.buildCategoryGroupWithRequiredData); })); }));
|