@infrab4a/connect-angular 3.9.3 → 3.9.4-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.
@@ -846,7 +846,7 @@
846
846
  shop: checkout.shop || this.defaultShop,
847
847
  isSubscriber: (_e = checkout.user) === null || _e === void 0 ? void 0 : _e.isSubscriber,
848
848
  });
849
- i3.roundProductPrices(item);
849
+ i3.RoundProductPricesHelper.roundProductPrices(item);
850
850
  return [2 /*return*/, {
851
851
  checkout: checkout,
852
852
  lineItem: i3.LineItem.toInstance({
@@ -857,7 +857,7 @@
857
857
  slug: slug !== null && slug !== void 0 ? slug : product.slug,
858
858
  sku: sku !== null && sku !== void 0 ? sku : product.sku,
859
859
  stock: stock,
860
- price: price,
860
+ price: this.roundPrice(price),
861
861
  image: image,
862
862
  weight: weight !== null && weight !== void 0 ? weight : product.weight,
863
863
  quantity: (item.quantity || 0) + (quantity || 0),
@@ -877,7 +877,9 @@
877
877
  var info = product.price;
878
878
  if (product.isGift)
879
879
  return 0;
880
- return isSubscriber && info.subscriberPrice > 0 ? Number(info.subscriberPrice) : Number(info.price);
880
+ return isSubscriber && info.subscriberPrice > 0
881
+ ? Number(info.subscriberPrice.toFixed(2))
882
+ : Number(info.price.toFixed(2));
881
883
  };
882
884
  this.checkMaxStock = function (item, quantity) {
883
885
  var _a;
@@ -973,6 +975,10 @@
973
975
  var _this = this;
974
976
  return this.checkoutService.getCheckout(checkoutData).pipe(operators.map(function (checkout) { return checkout.lineItems; }), operators.concatMap(function (lineItems) { return rxjs.of(_this.generateCartObject(lineItems)); }));
975
977
  };
978
+ CartService.prototype.roundPrice = function (productPrice) {
979
+ var price = productPrice.price, fullPrice = productPrice.fullPrice, subscriberPrice = productPrice.subscriberPrice;
980
+ return Object.assign(Object.assign(Object.assign({}, productPrice), { price: Number(price.toFixed(2)), fullPrice: Number(fullPrice.toFixed(2)) }), (subscriberPrice && { subscriberPrice: Number(subscriberPrice.toFixed(2)) }));
981
+ };
976
982
  CartService.prototype.getProductData = function (productId) {
977
983
  return __awaiter(this, void 0, void 0, function () {
978
984
  var product, variant, error_1;