Skip to content

Commit

Permalink
fix: correct calculations of subtotal for shipping option requirements (
Browse files Browse the repository at this point in the history
#7089)

* fix: correct calculations of subtotal for shipping option requirements

* Add changeset
  • Loading branch information
kevinfurmanski committed Apr 29, 2024
1 parent d2393f0 commit 82cb6cf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/lemon-forks-collect.md
@@ -0,0 +1,5 @@
---
"@medusajs/medusa": patch
---

fix: correct calculations of subtotal for shipping option requirements
2 changes: 1 addition & 1 deletion packages/medusa/src/services/shipping-option.ts
Expand Up @@ -398,7 +398,7 @@ class ShippingOptionService extends TransactionBaseService {
)
}

const amount = option.includes_tax ? cart.total! : cart.subtotal!
const amount = option.includes_tax ? (cart.subtotal! + cart.item_tax_total!) : cart.subtotal!

const requirementResults: boolean[] = option.requirements.map(
(requirement) => {
Expand Down

0 comments on commit 82cb6cf

Please sign in to comment.