From 61650b09921ddf98224249a456f170493616cdac Mon Sep 17 00:00:00 2001 From: Fidelis Ojeah Date: Fri, 10 Nov 2017 14:49:33 +0100 Subject: [PATCH] bug-fix(Order): shippment status now canceled (#27) - If an order has been canceled, it's shipment status would change to canceled as against (not yet shipped or shipped) [fixes #152682337] --- .../core/orders/client/templates/list/ordersList.html | 2 +- imports/plugins/core/orders/client/templates/orders.js | 8 ++++++++ .../orders/client/templates/workflow/shippingSummary.js | 9 +++++++++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/imports/plugins/core/orders/client/templates/list/ordersList.html b/imports/plugins/core/orders/client/templates/list/ordersList.html index de22b717..7fdab252 100644 --- a/imports/plugins/core/orders/client/templates/list/ordersList.html +++ b/imports/plugins/core/orders/client/templates/list/ordersList.html @@ -23,7 +23,7 @@

Completed {{else}} {{#if orderCancelled}} - Cancelled + Cancelled {{else}} Processing {{/if}} {{/if}} diff --git a/imports/plugins/core/orders/client/templates/orders.js b/imports/plugins/core/orders/client/templates/orders.js index e4259ec4..1c58109b 100644 --- a/imports/plugins/core/orders/client/templates/orders.js +++ b/imports/plugins/core/orders/client/templates/orders.js @@ -309,6 +309,14 @@ Template.orderStatusDetail.helpers({ shipmentStatus() { const self = this; + if (this.workflow.status === "canceled" || + this.workflow.status === "refunded") { + return { + shipped: false, + status: "danger", + label: i18next.t("order.filter.canceled") + }; + } const shipment = this.shipping[0]; const shipped = _.every(shipment.items, (shipmentItem) => { for (const fullItem of self.items) { diff --git a/imports/plugins/core/orders/client/templates/workflow/shippingSummary.js b/imports/plugins/core/orders/client/templates/workflow/shippingSummary.js index de1c7443..00983665 100644 --- a/imports/plugins/core/orders/client/templates/workflow/shippingSummary.js +++ b/imports/plugins/core/orders/client/templates/workflow/shippingSummary.js @@ -78,6 +78,15 @@ Template.coreOrderShippingSummary.helpers({ }, shipmentStatus() { const order = Template.instance().order; + + if (order.workflow.status === "canceled" || + order.workflow.status === "refunded") { + return { + shipped: false, + status: "danger", + label: i18next.t("order.filter.canceled") + }; + } const shipment = Template.instance().order.shipping[0]; const shipped = _.every(shipment.items, (shipmentItem) => { for (const fullItem of order.items) {