@infrab4a/connect-angular 2.0.9 → 2.0.10-beta.2
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 +4 -14
- package/bundles/infrab4a-connect-angular.umd.js.map +1 -1
- package/esm2015/services/cart.service.js +6 -16
- package/fesm2015/infrab4a-connect-angular.js +4 -14
- package/fesm2015/infrab4a-connect-angular.js.map +1 -1
- package/package.json +2 -2
- package/services/cart.service.d.ts +1 -2
|
@@ -894,8 +894,8 @@
|
|
|
894
894
|
});
|
|
895
895
|
};
|
|
896
896
|
this.getProductPrice = function (_h) {
|
|
897
|
-
var product = _h.product,
|
|
898
|
-
var info = product.
|
|
897
|
+
var product = _h.product, isSubscriber = _h.isSubscriber;
|
|
898
|
+
var info = product.price;
|
|
899
899
|
if (product.isGift)
|
|
900
900
|
return 0;
|
|
901
901
|
return isSubscriber && info.subscriberPrice > 0 ? info.subscriberPrice : info.price;
|
|
@@ -938,8 +938,8 @@
|
|
|
938
938
|
/**
|
|
939
939
|
* @deprecated The method should not be used
|
|
940
940
|
*/
|
|
941
|
-
CartService.prototype.getVariantPriceDiscount = function (item
|
|
942
|
-
return this.authService.getUser().pipe(operators.concatMap(function (user) { return rxjs.iif(function () { return user.isSubscriber && !!item.
|
|
941
|
+
CartService.prototype.getVariantPriceDiscount = function (item) {
|
|
942
|
+
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); }));
|
|
943
943
|
};
|
|
944
944
|
CartService.prototype.removeItem = function (item) {
|
|
945
945
|
var _this = this;
|
|
@@ -992,16 +992,6 @@
|
|
|
992
992
|
var _this = this;
|
|
993
993
|
return this.checkoutService.getCheckout(checkoutData).pipe(operators.map(function (checkout) { return checkout.lineItems; }), operators.concatMap(function (lineItems) { return rxjs.of(_this.generateCartObject(lineItems)); }));
|
|
994
994
|
};
|
|
995
|
-
CartService.prototype.getSubTotalDiscount = function (coupon) {
|
|
996
|
-
return function (subTotalPrice) {
|
|
997
|
-
switch (coupon.type) {
|
|
998
|
-
case i2.CouponTypes.ABSOLUTE:
|
|
999
|
-
return subTotalPrice - coupon.discount;
|
|
1000
|
-
case i2.CouponTypes.PERCENTAGE:
|
|
1001
|
-
return subTotalPrice * (1 - coupon.discount / 100);
|
|
1002
|
-
}
|
|
1003
|
-
};
|
|
1004
|
-
};
|
|
1005
995
|
return CartService;
|
|
1006
996
|
}());
|
|
1007
997
|
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 });
|