foodbot-cart-calculations 1.0.20 → 1.0.22
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/calculations.js
CHANGED
|
@@ -86,6 +86,11 @@ function applyDistribution(body) {
|
|
|
86
86
|
|
|
87
87
|
mainCart.discount = mainCart.order_items.discount;
|
|
88
88
|
mainCart.order_items.total=parseFloat(mainCart.order_items.total).toFixed(2)
|
|
89
|
+
|
|
90
|
+
let delivery_cost = body.delivery_cost?body.delivery_cost:0;
|
|
91
|
+
let service_amount = body.service_amount?body.service_amount:0;
|
|
92
|
+
mainCart.final_amount = parseFloat(mainCart.final_amount) + parseFloat(delivery_cost) + parseFloat(service_amount);
|
|
93
|
+
mainCart.cash_expected = parseFloat(mainCart.cash_expected) + parseFloat(delivery_cost) + parseFloat(service_amount);
|
|
89
94
|
resolve(mainCart);
|
|
90
95
|
}).catch(err => {
|
|
91
96
|
reject(err);
|
|
@@ -504,6 +504,7 @@ function getBuyxGetYOnCondition(descending, cartData, offer,total,buyItemAmount,
|
|
|
504
504
|
|
|
505
505
|
if (offer.oo_offer_type === "percentage") {
|
|
506
506
|
let itemTotalDiscount = 0;
|
|
507
|
+
|
|
507
508
|
itemAmount = (parseFloat(desc[i].item.item_price) * parseFloat(offer.oo_offer_value)) / 100;
|
|
508
509
|
buyItemAmount = itemAmount
|
|
509
510
|
itemTotalDiscount += itemAmount;
|
package/package.json
CHANGED