Skip to content

Commit da4fd6d

Browse files
committed
fix: fix checking rules max weight
1 parent 3ad7e5f commit da4fd6d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

functions/routes/ecom/modules/calculate-shipping.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ const applyShippingDiscount = ({
5656
checkZipCode(destinationZip, rule) &&
5757
(rule.service === 'Todos' || rule.service === mandaeShipping.name) &&
5858
(!rule.min_amount || itemsSubtotal >= rule.min_amount) &&
59-
(!rule.max_kg_weight || itemsKgWeight >= rule.max_kg_weight)
59+
(!rule.max_kg_weight || itemsKgWeight <= rule.max_kg_weight)
6060
) {
6161
if (rule.free_shipping) {
6262
value = 0
@@ -207,7 +207,7 @@ exports.post = ({ appSdk }, req, res) => {
207207
const declaredValue = ecomUtils.price(item)
208208
itemsSubtotal += (declaredValue * item.quantity)
209209
const weight = getKgWeight(item)
210-
itemsKgWeight += item.quantity * weight
210+
itemsKgWeight += (item.quantity * weight)
211211
const mandaeItem = {
212212
declaredValue,
213213
weight,

0 commit comments

Comments
 (0)