Skip to content

Commit

Permalink
fix quantity
Browse files Browse the repository at this point in the history
  • Loading branch information
ArnisLielturks committed Apr 25, 2024
1 parent c9c405e commit e17e05e
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion data/emails/order.cancelled/html.pug
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ block description
td
img(src=item.thumbnail)
td
p #{item.unit_price / 100} #{order.currency_code === 'usd' ? '$' : order.currency_code}
p #{item.unit_price / 100} #{order.currency_code === 'usd' ? '$' : order.currency_code} x#{item.quantity}
tr
td(colspan="2")
p(class="align-right bold") Total
Expand Down
2 changes: 1 addition & 1 deletion data/emails/order.placed/html.pug
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ block description
td
img(src=item.thumbnail)
td
p #{item.unit_price / 100} #{order.currency_code === 'usd' ? '$' : order.currency_code}
p #{item.unit_price / 100} #{order.currency_code === 'usd' ? '$' : order.currency_code} x#{item.quantity}
tr
td(colspan="2")
p(class="align-right bold") Total
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@rootxpdev/medusa-email-plugin",
"version": "0.4.0",
"version": "0.4.1",
"description": "Send emails when certain actions happens in medusa store",
"main": "index.js",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion src/services/emails.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class EmailsService extends AbstractNotificationService {
cart: await this.cartService.retrieve(order.cart_id || ''),
id: data.id,
total_value: (order.items.reduce((value, item) => {
return value + item.unit_price;
return value + item.unit_price * item.quantity;
}, 0) / 100).toFixed(2),
})

Expand Down

0 comments on commit e17e05e

Please sign in to comment.