From 1b770c6a036370e1d42b7e519b2cdc0695c3d377 Mon Sep 17 00:00:00 2001 From: Erik Kieckhafer Date: Mon, 30 Jan 2017 16:11:21 -0800 Subject: [PATCH 1/2] add shipping info to new and shipped email templates --- private/email/templates/orders/new.html | 16 ++++++++-------- private/email/templates/orders/refunded.html | 12 ++++++------ private/email/templates/orders/shipped.html | 20 ++++++++++++-------- server/methods/core/orders.js | 2 ++ 4 files changed, 28 insertions(+), 22 deletions(-) diff --git a/private/email/templates/orders/new.html b/private/email/templates/orders/new.html index 337c55c4eaf..c6d351c46f5 100644 --- a/private/email/templates/orders/new.html +++ b/private/email/templates/orders/new.html @@ -159,9 +159,9 @@   - Your Order - Order Date -   + Your Order + Order Date + Status @@ -184,18 +184,18 @@ {{order._id}} {{orderDate}} -   + Not shipped -   +   -   +   @@ -232,10 +232,10 @@ {{billing.paymentMethod}} -   +   - Item(s) + Item(s) diff --git a/private/email/templates/orders/refunded.html b/private/email/templates/orders/refunded.html index 5613389151b..5b72a989c70 100644 --- a/private/email/templates/orders/refunded.html +++ b/private/email/templates/orders/refunded.html @@ -159,8 +159,8 @@   - Your Order - Order Date + Your Order + Order Date   @@ -191,11 +191,11 @@ -   +   -   +   @@ -232,10 +232,10 @@ {{billing.paymentMethod}} -   +   - Item(s) + Item(s) diff --git a/private/email/templates/orders/shipped.html b/private/email/templates/orders/shipped.html index 3259754d643..5d75d85976b 100644 --- a/private/email/templates/orders/shipped.html +++ b/private/email/templates/orders/shipped.html @@ -159,9 +159,9 @@   - Your Order - Order Date -   + Your Order + Order Date + Tracking Number @@ -184,18 +184,22 @@ {{order._id}} {{orderDate}} -   + {{#if shipping.tracking}} + {{shipping.carrier}}
{{shipping.tracking}} + {{else}} + Tracking not available + {{/if}} -   +   -   +   @@ -232,10 +236,10 @@ {{billing.paymentMethod}} -   +   - Item(s) + Item(s) diff --git a/server/methods/core/orders.js b/server/methods/core/orders.js index 129fd9b973f..0a95a0958f0 100644 --- a/server/methods/core/orders.js +++ b/server/methods/core/orders.js @@ -467,6 +467,8 @@ export const methods = { orderDate: moment(order.createdAt).format("MM/DD/YYYY"), orderUrl: getSlug(shop.name) + "/cart/completed?_id=" + order.cartId, shipping: { + tracking: order.shipping[0].tracking, + carrier: order.shipping[0].shipmentMethod.carrier, address: { address: order.shipping[0].address.address1, city: order.shipping[0].address.city, From 1f381062b6c8a5623ca00ccf2b9f6e5063071e54 Mon Sep 17 00:00:00 2001 From: Erik Kieckhafer Date: Mon, 30 Jan 2017 16:11:31 -0800 Subject: [PATCH 2/2] fix error on dashboard orders --- imports/plugins/core/orders/client/templates/orders.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/imports/plugins/core/orders/client/templates/orders.js b/imports/plugins/core/orders/client/templates/orders.js index c3b6f0a183d..6c0ffb59547 100644 --- a/imports/plugins/core/orders/client/templates/orders.js +++ b/imports/plugins/core/orders/client/templates/orders.js @@ -90,7 +90,7 @@ Template.orders.onCreated(function () { // fetch available orders this.autorun(() => { this.subscribe("Orders"); - const filter = this.data && this.data.filter.name || Reaction.Router.getQueryParam("filter"); + const filter = this.data && this.data.filter && this.data.filter.name || Reaction.Router.getQueryParam("filter"); const query = OrderHelper.makeQuery(filter); const orders = Orders.find(query).fetch();