Skip to content

Commit 5e491aa

Browse files
committed
fix: fix setting product quantity with multi-cd
1 parent 624c2d1 commit 5e491aa

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

functions/lib/integration/imports/products-to-ecom.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,9 @@ module.exports = async ({ appSdk, storeId, auth }, productHorus, opts) => {
117117
quantity = 0
118118
res.data.produtos.itensEstoque.forEach(({ codigoestoque, saldo }) => {
119119
const qnt = parseInt(saldo, 10)
120-
quantity += qnt
120+
if (qnt > quantity) {
121+
quantity = qnt
122+
}
121123
inventory[`${codigoestoque}`] = qnt
122124
})
123125
}

0 commit comments

Comments
 (0)