Carrello con scontistica aggiornata

This commit is contained in:
Surya Paolo
2023-12-18 12:11:12 +01:00
parent 56b5bac5f0
commit 7628fb97fc
7 changed files with 154 additions and 66 deletions

View File

@@ -22,6 +22,7 @@ const OrdersCartSchema = new Schema({
numord_pers: { type: Number },
userId: { type: Schema.Types.ObjectId, ref: 'User' },
totalQty: { type: Number, default: 0 },
TotalPriceProduct: { type: Number, default: 0 },
totalPrice: { type: Number, default: 0 },
department: {
type: String, ref: 'Department'
@@ -265,9 +266,6 @@ module.exports.getOrdersCartByUserId = async function (uid, idapp, numorder) {
myorderscart = await OrdersCart.getOrdersCartByQuery(query);
if (myorderscart)
console.log('*** Num myorderscart ', myorderscart.length);
/*transform: function(doc, populated) {
// Rinomina 'idProduct' a 'product' nei risultati della popolazione
@@ -302,6 +300,7 @@ module.exports.updateOrdersCartById = function (id, newOrdersCart, callback) {
items: newOrdersCart.items,
totalQty: newOrdersCart.totalQty,
totalPrice: newOrdersCart.totalPrice,
totalPriceProduct: newOrdersCart.totalPriceProduct,
userId: userId,
status: newOrdersCart.status,
numorder: newOrdersCart.numorder,