@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.
@@ -894,8 +894,8 @@
894
894
  });
895
895
  };
896
896
  this.getProductPrice = function (_h) {
897
- var product = _h.product, shop = _h.shop, isSubscriber = _h.isSubscriber;
898
- var info = product.getInfoByShop(shop);
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, shop) {
942
- return this.authService.getUser().pipe(operators.concatMap(function (user) { return rxjs.iif(function () { return user.isSubscriber && !!item.getInfoByShop(shop).subscriberPrice; }, rxjs.of(item.getInfoByShop(shop).subscriberPrice), rxjs.of(item.getInfoByShop(shop).price)); }), operators.catchError(function () { return rxjs.of(item.getInfoByShop(shop).price); }));
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 });