@infrab4a/connect-angular 4.13.2-beta.1 → 4.13.2-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.
|
@@ -1384,7 +1384,7 @@ class CartService {
|
|
|
1384
1384
|
this.updateLineItemInCart = (lineItem, quantity, checkout) => (isNil(checkout) ? this.checkoutService.getCheckout() : of(checkout)).pipe(concatMap((checkoutLoaded) => {
|
|
1385
1385
|
const items = [];
|
|
1386
1386
|
const index = checkoutLoaded.lineItems?.map((checkoutItem) => checkoutItem.id).indexOf(lineItem.id);
|
|
1387
|
-
const isGift = checkoutLoaded.lineItems[index]
|
|
1387
|
+
const isGift = checkoutLoaded.lineItems?.[index]?.isGift;
|
|
1388
1388
|
if (index > -1) {
|
|
1389
1389
|
checkoutLoaded.lineItems[index].quantity += quantity;
|
|
1390
1390
|
checkoutLoaded.lineItems[index].pricePaid = isGift ? 0 : lineItem.pricePaid;
|
|
@@ -1410,7 +1410,7 @@ class CartService {
|
|
|
1410
1410
|
throw new Error('Desculpe! Temos apenas ' + product.stock?.quantity + ' em estoque.');
|
|
1411
1411
|
const image = item.image || item.images?.shift();
|
|
1412
1412
|
const { id, name, EAN, slug, weight, sku, type } = item;
|
|
1413
|
-
const isGift = item
|
|
1413
|
+
const isGift = item?.isGift || null;
|
|
1414
1414
|
const pricePaid = isGift
|
|
1415
1415
|
? 0
|
|
1416
1416
|
: this.getProductPrice({
|