- aggiungo campo "sfuso"
- aggiunto totale al carrello
This commit is contained in:
@@ -54,6 +54,9 @@ const orderSchema = new Schema({
|
||||
type: Number,
|
||||
default: 0,
|
||||
},
|
||||
TotalPriceProductstr: {
|
||||
type: String,
|
||||
},
|
||||
TotalPriceProductCalc: {
|
||||
type: Number,
|
||||
default: 0,
|
||||
@@ -362,6 +365,7 @@ module.exports.updateTotals = function (order) {
|
||||
|
||||
order.TotalPriceProductCalc += mypricecalc;
|
||||
order.TotalPriceProduct += mypricecalc;
|
||||
order.TotalPriceProductstr = parseFloat(order.TotalPriceProduct.toFixed(2));
|
||||
|
||||
return order;
|
||||
|
||||
|
||||
@@ -919,10 +919,12 @@ module.exports.getmsgorderTelegram = async function (ordersCart) {
|
||||
if (ord.order.quantitypreordered > 0)
|
||||
qtynum += ord.order.quantitypreordered;
|
||||
|
||||
// if (ord.order.product.productInfo.weight)
|
||||
// qtynum *= ord.order.product.productInfo.weight;
|
||||
if (ord.order.product.productInfo.sfuso && ord.order.product.productInfo.weight)
|
||||
qtyrisult = qtynum * ord.order.product.productInfo.weight;
|
||||
else
|
||||
qtyrisult = qtynum + ' x ' + ord.order.product.productInfo.weight;
|
||||
|
||||
qtystr += qtynum + ' ' + tools.getUnitsMeasure(ord.order.product.productInfo.unit, true);
|
||||
qtystr += qtyrisult + ' ' + tools.getUnitsMeasure(ord.order.product.productInfo.unit, true);
|
||||
|
||||
if (ord.order.quantitypreordered > 0)
|
||||
qtystr += ' Pre-Ordinati';
|
||||
|
||||
@@ -58,6 +58,9 @@ const productInfoSchema = new Schema({
|
||||
type: Number,
|
||||
default: 0,
|
||||
},
|
||||
sfuso: { // serve se moltiplicare le qta (es: 12 kg) oppure fare (2 x 20 ml)
|
||||
type: Boolean
|
||||
},
|
||||
vegan: {
|
||||
type: Boolean
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user