fix(medusa): Legacy total service to accept custom items (#3027)
This commit is contained in:
committed by
GitHub
parent
27a29ef24e
commit
8c08d00319
5
.changeset/early-cherries-care.md
Normal file
5
.changeset/early-cherries-care.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@medusajs/medusa": patch
|
||||
---
|
||||
|
||||
fix(medusa): Legacy total service should accept custom items
|
||||
@@ -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"
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user