fixed carrello che scompariva...
This commit is contained in:
@@ -75,6 +75,7 @@ html
|
||||
|
||||
- var qty = rec.order.quantity
|
||||
- var qtypreordered = rec.order.quantitypreordered
|
||||
- var unit = rec.order.product.productInfo.unitstr
|
||||
- index = index + 1
|
||||
|
||||
table(cellpadding="0", cellspacing="0", width="100%", summary="", border="0", align="center")
|
||||
@@ -103,10 +104,10 @@ html
|
||||
p Prezzo: #{price} € #{after_price}
|
||||
if (qty > 0)
|
||||
td(class="sectionContent", valign="top")
|
||||
p Quantità: #{qty}
|
||||
p Quantità: #{qty} #{unit}
|
||||
if (qtypreordered > 0)
|
||||
td(class="sectionContent", valign="top")
|
||||
p Quantità Prenotata: #{qtypreordered}
|
||||
p Quantità Prenotata: #{qtypreordered} #{unit}
|
||||
tr
|
||||
td(class="sectionContent", valign="top")
|
||||
p Totale: #{TotalPriceProduct} €
|
||||
|
||||
@@ -71,6 +71,7 @@ html
|
||||
- var gasordine = ''
|
||||
- var qty = rec.order.product.quantity
|
||||
- var qtypreordered = rec.order.quantitypreordered
|
||||
- var unit = rec.order.product.productInfo.unitstr
|
||||
- var TotalPriceProduct = rec.order.TotalPriceProduct
|
||||
- index = index + 1
|
||||
|
||||
@@ -101,11 +102,11 @@ html
|
||||
if (qty > 0)
|
||||
tr
|
||||
td(class="sectionContent", valign="top")
|
||||
p Quantità: #{qty}
|
||||
p Quantità: #{qty} #{unit}
|
||||
if (qtypreordered > 0)
|
||||
tr
|
||||
td(class="sectionContent", valign="top")
|
||||
p Quantità Prenotata: #{qtypreordered}
|
||||
p Quantità Prenotata: #{qtypreordered} #{unit}
|
||||
tr
|
||||
td(class="sectionContent", valign="top")
|
||||
p Totale: #{TotalPriceProduct} €
|
||||
|
||||
@@ -70,6 +70,7 @@ html
|
||||
- var gasordine = ''
|
||||
- var qty = rec.order.product.quantity
|
||||
- var qtypreordered = rec.order.quantitypreordered
|
||||
- var unit = rec.order.product.productInfo.unitstr
|
||||
- var TotalPriceProduct = rec.order.TotalPriceProduct
|
||||
- index = index + 1
|
||||
|
||||
@@ -100,11 +101,11 @@ html
|
||||
if (qty > 0)
|
||||
tr
|
||||
td(class="sectionContent", valign="top")
|
||||
p Quantità: #{qty}
|
||||
p Quantità: #{qty} #{unit}
|
||||
if (qtypreordered > 0)
|
||||
tr
|
||||
td(class="sectionContent", valign="top")
|
||||
p Quantità Prenotata: #{qtypreordered}
|
||||
p Quantità Prenotata: #{qtypreordered} #{unit}
|
||||
tr
|
||||
td(class="sectionContent", valign="top")
|
||||
p Totale: #{TotalPriceProduct} €
|
||||
|
||||
@@ -53,7 +53,7 @@ module.exports.getCartByUserId = async function (uid, idapp) {
|
||||
if (!!mycart) {
|
||||
for (const idkey in mycart.items) {
|
||||
try {
|
||||
// idorder = mycart.items[idkey]._id.toString();
|
||||
let idorder = mycart.items[idkey]._id.toString();
|
||||
let myorder = mycart.items[idkey].order;
|
||||
if (!!myorder) {
|
||||
idorder = mycart.items[idkey].order._id.toString();
|
||||
@@ -71,7 +71,7 @@ module.exports.getCartByUserId = async function (uid, idapp) {
|
||||
|
||||
mycart.newitems = []
|
||||
for (let item of mycart.items) {
|
||||
if (item.order && item.order.hasOwnProperty('idapp'))
|
||||
if (item.order && item.order.hasOwnProperty('idapp') && (item.order.quantity > 0 || item.order.quantitypreordered > 0))
|
||||
mycart.newitems.push(item)
|
||||
}
|
||||
mycart.items = [...mycart.newitems]
|
||||
|
||||
@@ -270,6 +270,7 @@ module.exports.getOrdersCartByQuery = async function (query) {
|
||||
try {
|
||||
if (item.order.idProduct) {
|
||||
item.order.idProduct.productInfo = item.order.idProduct.productInfo ? item.order.idProduct.productInfo : { ...item.order.idProduct.idProductInfo };
|
||||
item.order.idProduct.productInfo.unitstr = tools.getUnitsMeasure(item.order.idProduct.productInfo.unit, true);
|
||||
item.order.idProduct.idProductInfo = item.order.idProduct.productInfo ? item.order.idProduct.productInfo._id : '';
|
||||
}
|
||||
item.order.product = { ...item.order.idProduct };
|
||||
@@ -918,6 +919,9 @@ 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;
|
||||
|
||||
qtystr += qtynum + ' ' + tools.getUnitsMeasure(ord.order.product.productInfo.unit, true);
|
||||
|
||||
if (ord.order.quantitypreordered > 0)
|
||||
|
||||
@@ -83,6 +83,7 @@ router.post('/:userId', authenticate, async function (req, res, next) {
|
||||
nuovo = true;
|
||||
}
|
||||
|
||||
|
||||
let newCart = CartClass.constructByCart(mycart);
|
||||
// order = await Product.updateProductInOrder(order);
|
||||
if (!nuovo) {
|
||||
|
||||
Reference in New Issue
Block a user