diff --git a/static/components/order-list/order-list.html b/static/components/order-list/order-list.html index 8be42e5..d3c7705 100644 --- a/static/components/order-list/order-list.html +++ b/static/components/order-list/order-list.html @@ -69,14 +69,14 @@ -
+
Products:
-
Quantity
+
Quantity
-
Name
-
Price
+
Name
+
Price
@@ -96,6 +96,15 @@
+
+
+
+
Shipping Cost
+
+ {{props.row.extra.shipping_cost}} {{props.row.extra.currency}} +
+
+
diff --git a/static/components/order-list/order-list.js b/static/components/order-list/order-list.js index 849ebb1..8a1cca9 100644 --- a/static/components/order-list/order-list.js +++ b/static/components/order-list/order-list.js @@ -145,10 +145,11 @@ async function orderList(path) { return '' }, orderTotal: function (order) { - return order.items.reduce((t, item) => { + const productCost = order.items.reduce((t, item) => { product = order.extra.products.find(p => p.id === item.product_id) return t + item.quantity * product.price }, 0) + return productCost + order.extra.shipping_cost }, getOrders: async function () { try { diff --git a/static/js/index.js b/static/js/index.js index 11eeffd..6d2a6cb 100644 --- a/static/js/index.js +++ b/static/js/index.js @@ -182,7 +182,6 @@ const merchant = async () => { } if (data.type === 'dm:2') { const orderStatus = JSON.parse(data.dm.message) - console.log('### orderStatus', orderStatus) this.$q.notify({ timeout: 5000, type: 'positive',