@infrab4a/connect-angular 4.14.0-beta.4 → 4.14.0-beta.5
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.
|
@@ -1568,7 +1568,7 @@ class CartService {
|
|
|
1568
1568
|
categoriesCampaingFullTree.push(id, ...children.map((c) => c.id.toString()));
|
|
1569
1569
|
}
|
|
1570
1570
|
const categoriesCampaingTree = [...new Set(categoriesCampaingFullTree)];
|
|
1571
|
-
const filterProductsCategories =
|
|
1571
|
+
const filterProductsCategories = notGiftItems.filter((l) => {
|
|
1572
1572
|
if (!l.categories || !l.categories?.length)
|
|
1573
1573
|
return true;
|
|
1574
1574
|
return l.categories.some((c) => categoriesCampaingTree.some((cat) => cat == c));
|
|
@@ -1578,8 +1578,9 @@ class CartService {
|
|
|
1578
1578
|
const cartItensQuantityWithCategories = filterProductsCategories.reduce((a, b) => a + b.quantity, 0);
|
|
1579
1579
|
const hasMinValue = cartValuelWithCategories >= campaign.cartValueMin;
|
|
1580
1580
|
const hasMinQuantity = campaign.cartItensQuantityMin && cartItensQuantityWithCategories >= campaign.cartItensQuantityMin;
|
|
1581
|
+
console.log('------------------------------');
|
|
1581
1582
|
console.log('campaing WITH categories', campaign.name, campaign.cartValueMin, campaign.cartItensQuantityMin);
|
|
1582
|
-
console.log('cartValuelWithCategories', cartValuelWithCategories, 'cartItensQuantityWithCategories', cartItensQuantityWithCategories, hasMinValue, hasMinQuantity);
|
|
1583
|
+
console.log('cartValuelWithCategories', cartValuelWithCategories, 'cartItensQuantityWithCategories', cartItensQuantityWithCategories, 'hasMinValue', hasMinValue, 'hasMinQuantity', hasMinQuantity);
|
|
1583
1584
|
if (hasMinQuantity || hasMinValue)
|
|
1584
1585
|
elegibleCampaigns.push(campaign);
|
|
1585
1586
|
}
|
|
@@ -1589,8 +1590,9 @@ class CartService {
|
|
|
1589
1590
|
const cartItensQuantity = notGiftItems.reduce((a, b) => a + b.quantity, 0);
|
|
1590
1591
|
const hasMinValue = campaign.cartValue && campaign.cartValue > 0 && campaign.cartValue <= cartTotal;
|
|
1591
1592
|
const hasMinQuantity = campaign.cartItensQuantityMin && cartItensQuantity >= campaign.cartItensQuantityMin;
|
|
1593
|
+
console.log('------------------------------');
|
|
1592
1594
|
console.log('campaing WITHOUT categories', campaign.name, campaign.cartValue, campaign.cartItensQuantityMin);
|
|
1593
|
-
console.log('cartTotal', cartTotal, 'cartItensQuantity', cartItensQuantity, hasMinValue, hasMinQuantity);
|
|
1595
|
+
console.log('cartTotal', cartTotal, 'cartItensQuantity', cartItensQuantity, 'hasMinValue', hasMinValue, 'hasMinQuantity', hasMinQuantity);
|
|
1594
1596
|
if (hasMinQuantity || hasMinValue)
|
|
1595
1597
|
elegibleCampaigns.push(campaign);
|
|
1596
1598
|
}
|