foodbot-cart-calculations 1.0.60 → 1.0.61

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.
@@ -147,7 +147,9 @@ function getCategorySpeificOffer(carts, offer) {
147
147
  if(!res.purchase_points){
148
148
  let itemId = res.item_id?.toString().length > 10 ? res.item_id : parseInt(res.item_id);
149
149
  if (!res.event && (offer.offer_discount_type == 'manual' || (offer.offer_products.offer_discount_products.includes(itemId) && res.isPackage == 0) || (offer.offer_products.package_items.includes(itemId) && res.isPackage == 1))) {
150
- foundItemsSum = foundItemsSum + res.item_price_with_modifier * res.quantity
150
+ // let ItemPriceWithMod = res.item_price_with_modifier ? res.item_price_with_modifier : (res.item_price || res.item_cost)
151
+ let ItemPriceWithMod = res.item_price_with_modifier ?? res.item_price ?? res.item_cost;
152
+ foundItemsSum = foundItemsSum + ItemPriceWithMod * res.quantity
151
153
  return foundItemsSum
152
154
  }
153
155
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "foodbot-cart-calculations",
3
- "version": "1.0.60",
3
+ "version": "1.0.61",
4
4
  "description": "Package for cart calculations in which it performs discount distribution and tax distribution on order",
5
5
  "main": "index.js",
6
6
  "scripts": {