Skip to content

Commit

Permalink
fix soft delveiry
Browse files Browse the repository at this point in the history
  • Loading branch information
Xziy committed Aug 25, 2024
1 parent 9191848 commit ac0b81a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 37 deletions.
21 changes: 5 additions & 16 deletions models/Order.js
Original file line number Diff line number Diff line change
Expand Up @@ -1340,24 +1340,13 @@ let Model = {
}
emitter.emit("core:order-after-check-delivery", order);
}
/**
* delivery: {
deliveryTimeMinutes: 0,
allowed: false,
cost: null,
item: undefined,
message: 'Shipping cost will be calculated'
},
*
*/
if ((!delivery || delivery.allowed === false) && softDeliveryCalculation) {
delivery.allowed = true;
delivery.cost = null;
delivery.message = "Shipping cost cannot be calculated";
}
order.delivery = delivery;
}
sails.log.debug(order);
if ((!order.delivery || delivery.allowed === false) && softDeliveryCalculation) {
delivery.allowed = true;
delivery.cost = null;
delivery.message = "Shipping cost cannot be calculated";
}
if (order.delivery && isValidDelivery(order.delivery, softDeliveryCalculation)) {
if (!order.delivery.item) {
order.deliveryCost = order.delivery.cost;
Expand Down
26 changes: 5 additions & 21 deletions models/Order.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1607,30 +1607,14 @@ let Model = {
}
emitter.emit("core:order-after-check-delivery", order);
}


/**
* delivery: {
deliveryTimeMinutes: 0,
allowed: false,
cost: null,
item: undefined,
message: 'Shipping cost will be calculated'
},
*
*/

if((!delivery || delivery.allowed === false) && softDeliveryCalculation) {
delivery.allowed = true;
delivery.cost = null
delivery.message = "Shipping cost cannot be calculated"
}

order.delivery = delivery
}


sails.log.debug(order)
if((!order.delivery || delivery.allowed === false) && softDeliveryCalculation) {
delivery.allowed = true;
delivery.cost = null
delivery.message = "Shipping cost cannot be calculated"
}

if (order.delivery && isValidDelivery(order.delivery, softDeliveryCalculation)) {
if (!order.delivery.item) {
Expand Down

0 comments on commit ac0b81a

Please sign in to comment.