Skip to content

Commit

Permalink
fix(medusa): Legacy total service to accept custom items
Browse files Browse the repository at this point in the history
  • Loading branch information
adrien2p committed Jan 13, 2023
1 parent 9dbccd9 commit 0487a16
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/medusa/src/services/totals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -840,7 +840,7 @@ class TotalsService extends TransactionBaseService {
* items we have to get the line items from the tax provider.
*/
if (options.use_tax_lines || isOrder(cartOrOrder)) {
if (typeof lineItem.tax_lines === "undefined") {
if (!isDefined(lineItem.tax_lines) && lineItem.variant_id) {
throw new MedusaError(
MedusaError.Types.UNEXPECTED_STATE,
"Tax Lines must be joined on items to calculate taxes"
Expand All @@ -850,7 +850,7 @@ class TotalsService extends TransactionBaseService {
taxLines = lineItem.tax_lines
} else {
if (lineItem.is_return) {
if (typeof lineItem.tax_lines === "undefined") {
if (!isDefined(lineItem.tax_lines) && lineItem.variant_id) {
throw new MedusaError(
MedusaError.Types.UNEXPECTED_STATE,
"Return Line Items must join tax lines"
Expand Down

0 comments on commit 0487a16

Please sign in to comment.