@infrab4a/connect-angular 3.9.2 → 3.9.3
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 +3 -8
- package/bundles/infrab4a-connect-angular.umd.js.map +1 -1
- package/esm2015/services/cart.service.js +5 -10
- package/fesm2015/infrab4a-connect-angular.js +4 -9
- package/fesm2015/infrab4a-connect-angular.js.map +1 -1
- package/package.json +1 -1
- package/services/cart.service.d.ts +0 -1
|
@@ -846,6 +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
850
|
return [2 /*return*/, {
|
|
850
851
|
checkout: checkout,
|
|
851
852
|
lineItem: i3.LineItem.toInstance({
|
|
@@ -856,7 +857,7 @@
|
|
|
856
857
|
slug: slug !== null && slug !== void 0 ? slug : product.slug,
|
|
857
858
|
sku: sku !== null && sku !== void 0 ? sku : product.sku,
|
|
858
859
|
stock: stock,
|
|
859
|
-
price:
|
|
860
|
+
price: price,
|
|
860
861
|
image: image,
|
|
861
862
|
weight: weight !== null && weight !== void 0 ? weight : product.weight,
|
|
862
863
|
quantity: (item.quantity || 0) + (quantity || 0),
|
|
@@ -876,9 +877,7 @@
|
|
|
876
877
|
var info = product.price;
|
|
877
878
|
if (product.isGift)
|
|
878
879
|
return 0;
|
|
879
|
-
return isSubscriber && info.subscriberPrice > 0
|
|
880
|
-
? Number(info.subscriberPrice.toFixed(2))
|
|
881
|
-
: Number(info.price.toFixed(2));
|
|
880
|
+
return isSubscriber && info.subscriberPrice > 0 ? Number(info.subscriberPrice) : Number(info.price);
|
|
882
881
|
};
|
|
883
882
|
this.checkMaxStock = function (item, quantity) {
|
|
884
883
|
var _a;
|
|
@@ -974,10 +973,6 @@
|
|
|
974
973
|
var _this = this;
|
|
975
974
|
return this.checkoutService.getCheckout(checkoutData).pipe(operators.map(function (checkout) { return checkout.lineItems; }), operators.concatMap(function (lineItems) { return rxjs.of(_this.generateCartObject(lineItems)); }));
|
|
976
975
|
};
|
|
977
|
-
CartService.prototype.roundPrice = function (productPrice) {
|
|
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)) }));
|
|
980
|
-
};
|
|
981
976
|
CartService.prototype.getProductData = function (productId) {
|
|
982
977
|
return __awaiter(this, void 0, void 0, function () {
|
|
983
978
|
var product, variant, error_1;
|