Skip to content

Commit

Permalink
chore: use final weight
Browse files Browse the repository at this point in the history
  • Loading branch information
matheusgnreis committed Oct 27, 2023
1 parent d9f02cb commit 2884267
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion functions/routes/ecom/modules/calculate-shipping.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ exports.post = ({ appSdk }, req, res) => {
const { sku, quantity, weight } = item
cartSubtotal += (quantity * ecomUtils.price(item))
// parse cart items to frete barato schema
let kgWeight = 0
if (weight && weight.value) {
switch (weight.unit) {
case 'kg':
Expand All @@ -122,7 +123,7 @@ exports.post = ({ appSdk }, req, res) => {
default:
kgWeight = weight.value
}
finalWeight += finalWeight
finalWeight += kgWeight
}
items.push({
sku,
Expand Down

0 comments on commit 2884267

Please sign in to comment.