possibilità di modificare un ordine, e anche i totali
This commit is contained in:
@@ -101,7 +101,7 @@ router.post('/:userId', authenticate, async function (req, res, next) {
|
||||
return res.send({ code: server_constants.RIS_CODE_ERR, cart: null, myord: null, msgerr: 'Non è possibile acquistare nello stesso ordine, su negozi differenti!' });
|
||||
}
|
||||
} else {
|
||||
await newCart.updatetotals();
|
||||
await newCart.updatecarttotals(true);
|
||||
const arrord = await Order.getTotalOrderById(order._id);
|
||||
myord = arrord ? arrord[0] : null;
|
||||
}
|
||||
@@ -270,6 +270,7 @@ router.post('/:userId/createorderscart', authenticate, async function (req, res,
|
||||
items: mycart.items,
|
||||
totalQty: mycart.totalQty,
|
||||
totalPrice: mycart.totalPrice,
|
||||
totalPriceCalc: mycart.totalPriceCalc,
|
||||
userId,
|
||||
status,
|
||||
note,
|
||||
@@ -324,14 +325,6 @@ router.post('/:userId/createorderscart', authenticate, async function (req, res,
|
||||
})
|
||||
}
|
||||
})
|
||||
} else if (status < shared_consts.OrderStatus.CHECKOUT_SENT) {
|
||||
// Aggiorna il carrello !
|
||||
|
||||
/*const cartpao = await Cart.getCartByUserId(userId, idapp);
|
||||
let newCart = CartClass.constructByCart(cartpao);
|
||||
if (newCart)
|
||||
await newCart.updatetotals();
|
||||
newCart;*/
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user