@infrab4a/connect-angular 3.9.2-beta1 → 3.9.2-beta3

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.
@@ -856,7 +856,7 @@
856
856
  slug: slug !== null && slug !== void 0 ? slug : product.slug,
857
857
  sku: sku !== null && sku !== void 0 ? sku : product.sku,
858
858
  stock: stock,
859
- price: price,
859
+ price: this.roundPrice(price),
860
860
  image: image,
861
861
  weight: weight !== null && weight !== void 0 ? weight : product.weight,
862
862
  quantity: (item.quantity || 0) + (quantity || 0),
@@ -975,9 +975,8 @@
975
975
  return this.checkoutService.getCheckout(checkoutData).pipe(operators.map(function (checkout) { return checkout.lineItems; }), operators.concatMap(function (lineItems) { return rxjs.of(_this.generateCartObject(lineItems)); }));
976
976
  };
977
977
  CartService.prototype.roundPrice = function (productPrice) {
978
- var price = productPrice.price, fullPrice = productPrice.fullPrice;
979
- var round = function (value) { return Math.round((value + Number.EPSILON) * 100) / 100; };
980
- return Object.assign(Object.assign(Object.assign({}, productPrice), { price: Number(price.toFixed(2)), fullPrice: Number(price.toFixed(2)) }), (productPrice.subscriberPrice && { subscriberPrice: Number(productPrice.subscriberPrice.toFixed(2)) }));
978
+ var price = productPrice.price, fullPrice = productPrice.fullPrice, subscriberPrice = productPrice.subscriberPrice;
979
+ 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
980
  };
982
981
  CartService.prototype.getProductData = function (productId) {
983
982
  return __awaiter(this, void 0, void 0, function () {