@infrab4a/connect-angular 5.0.0-beta.62 → 5.0.0-beta.63
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/esm2022/angular-connect.module.mjs +1 -1
- package/esm2022/angular-elastic-search.module.mjs +1 -1
- package/esm2022/angular-firebase-auth.module.mjs +1 -1
- package/esm2022/angular-firestore.module.mjs +1 -1
- package/esm2022/angular-hasura-graphql.module.mjs +1 -1
- package/esm2022/angular-vertex-search.module.mjs +1 -1
- package/esm2022/consts/category-structure.mjs +1 -1
- package/esm2022/consts/default-shop.const.mjs +1 -1
- package/esm2022/consts/es-config.const.mjs +1 -1
- package/esm2022/consts/firebase-const.mjs +1 -1
- package/esm2022/consts/hasura-options.const.mjs +1 -1
- package/esm2022/consts/index.mjs +1 -1
- package/esm2022/consts/persistence.const.mjs +1 -1
- package/esm2022/consts/storage-base-url.const.mjs +1 -1
- package/esm2022/consts/vertex-config.const.mjs +1 -1
- package/esm2022/helpers/index.mjs +1 -1
- package/esm2022/helpers/mobile-operation-system-checker.helper.mjs +1 -1
- package/esm2022/index.mjs +1 -1
- package/esm2022/persistence/cookie-data-persistence.mjs +1 -1
- package/esm2022/persistence/data-persistence.mjs +1 -1
- package/esm2022/persistence/index.mjs +1 -1
- package/esm2022/services/auth.service.mjs +1 -1
- package/esm2022/services/cart.service.mjs +12 -8
- package/esm2022/services/catalog/adapters/category-structure.adapter.mjs +1 -1
- package/esm2022/services/catalog/adapters/index.mjs +1 -1
- package/esm2022/services/catalog/adapters/new-category-structure.adapter.mjs +1 -1
- package/esm2022/services/catalog/adapters/old-category-structure.adapter.mjs +1 -1
- package/esm2022/services/catalog/catalog.service.mjs +1 -1
- package/esm2022/services/catalog/category.service.mjs +1 -1
- package/esm2022/services/catalog/enums/index.mjs +1 -1
- package/esm2022/services/catalog/enums/product-sorts.enum.mjs +1 -1
- package/esm2022/services/catalog/index.mjs +1 -1
- package/esm2022/services/catalog/models/category-with-tree.model.mjs +1 -1
- package/esm2022/services/catalog/models/index.mjs +1 -1
- package/esm2022/services/catalog/types/index.mjs +1 -1
- package/esm2022/services/catalog/types/product-sort.type.mjs +1 -1
- package/esm2022/services/catalog/wishlist.service.mjs +1 -1
- package/esm2022/services/checkout-subscription.service.mjs +1 -1
- package/esm2022/services/checkout.service.mjs +1 -1
- package/esm2022/services/coupon.service.mjs +1 -1
- package/esm2022/services/helpers/index.mjs +1 -1
- package/esm2022/services/helpers/util.helper.mjs +1 -1
- package/esm2022/services/home-shop.service.mjs +1 -1
- package/esm2022/services/index.mjs +1 -1
- package/esm2022/services/order.service.mjs +1 -1
- package/esm2022/services/shipping.service.mjs +1 -1
- package/esm2022/services/types/index.mjs +1 -1
- package/esm2022/services/types/required-checkout-data.type.mjs +1 -1
- package/esm2022/services/types/required-checkout-subscription-data.type.mjs +1 -1
- package/esm2022/services/types/shipping-methods.type.mjs +1 -1
- package/esm2022/types/firebase-app-config.type.mjs +1 -1
- package/esm2022/types/index.mjs +1 -1
- package/fesm2022/infrab4a-connect-angular.mjs +11 -7
- package/fesm2022/infrab4a-connect-angular.mjs.map +1 -1
- package/package.json +2 -2
|
@@ -1544,7 +1544,6 @@ class CartService {
|
|
|
1544
1544
|
const notGiftItems = checkout.lineItems ? checkout.lineItems.filter((item) => !item.isGift) : [];
|
|
1545
1545
|
if (!notGiftItems.length)
|
|
1546
1546
|
return { ...checkout, lineItems: [] };
|
|
1547
|
-
const cartTotal = notGiftItems.reduce((a, b) => a + b.pricePaid * b.quantity, 0);
|
|
1548
1547
|
const campaigns = await this.buy2WinRepository
|
|
1549
1548
|
.find({
|
|
1550
1549
|
filters: {
|
|
@@ -1574,16 +1573,21 @@ class CartService {
|
|
|
1574
1573
|
return l.categories.some((c) => categoriesCampaingTree.some((cat) => cat == c));
|
|
1575
1574
|
});
|
|
1576
1575
|
if (filterProductsCategories.length) {
|
|
1577
|
-
const
|
|
1578
|
-
|
|
1576
|
+
const cartValuelWithCategories = filterProductsCategories.reduce((a, b) => a + b.pricePaid * b.quantity, 0);
|
|
1577
|
+
const cartItensQuantityWithCategories = filterProductsCategories.reduce((a, b) => a + b.quantity, 0);
|
|
1578
|
+
const hasMinValue = cartValuelWithCategories >= campaign.cartValueMin;
|
|
1579
|
+
const hasMinQuantity = campaign.cartItensQuantityMin && cartItensQuantityWithCategories >= campaign.cartItensQuantityMin;
|
|
1580
|
+
if (hasMinQuantity || hasMinValue)
|
|
1579
1581
|
elegibleCampaigns.push(campaign);
|
|
1580
1582
|
}
|
|
1581
1583
|
}
|
|
1582
1584
|
else {
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1585
|
+
const cartTotal = notGiftItems.reduce((a, b) => a + b.pricePaid * b.quantity, 0);
|
|
1586
|
+
const cartItensQuantity = notGiftItems.reduce((a, b) => a + b.quantity, 0);
|
|
1587
|
+
const hasMinValue = campaign.cartValue && campaign.cartValue > 0 && campaign.cartValue <= cartTotal;
|
|
1588
|
+
const hasMinQuantity = campaign.cartItensQuantityMin && cartItensQuantity >= campaign.cartItensQuantityMin;
|
|
1589
|
+
if (hasMinQuantity || hasMinValue)
|
|
1590
|
+
elegibleCampaigns.push(campaign);
|
|
1587
1591
|
}
|
|
1588
1592
|
}
|
|
1589
1593
|
if (!elegibleCampaigns.length)
|