Skip to content

Commit

Permalink
fix(getDataForOrderEmail): fixes #5182 - add subtotal display amount …
Browse files Browse the repository at this point in the history
…to data for order email

Signed-off-by: Machiko Yasuda <machiko@reactioncommerce.com>
  • Loading branch information
Machiko Yasuda committed May 20, 2019
1 parent 74f8945 commit 145dfc0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Expand Up @@ -106,6 +106,11 @@ export default async function getDataForOrderEmail(context, { order }) {
// Add displayAmount to match user currency settings
displayAmount: formatMoney(item.price.amount * userCurrencyExchangeRate, userCurrency)
},
subtotal: {
...item.subtotal,
// Add displayAmount to match user currency settings
displayAmount: formatMoney(item.subtotal.amount * userCurrencyExchangeRate, userCurrency)
},
// These next two are for backward compatibility with existing email templates.
// New templates should use `imageURLs` instead.
productImage: item.imageURLs && item.imageURLs.large,
Expand Down
Expand Up @@ -108,7 +108,8 @@ test("returns expected data structure", async () => {
variantImage: "large.jpg",
subtotal: {
amount: jasmine.any(Number),
currencyCode: "mockCurrencyCode"
currencyCode: "mockCurrencyCode",
displayAmount: jasmine.any(String)
}
}
],
Expand Down

0 comments on commit 145dfc0

Please sign in to comment.