-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(core): Clear shippingLines if no eligible ShippingMethods exist
Closes #1195
- Loading branch information
1 parent
da9e2ce
commit f9bc532
Showing
6 changed files
with
192 additions
and
28 deletions.
There are no files selected for viewing
15 changes: 15 additions & 0 deletions
15
packages/core/e2e/fixtures/test-shipping-eligibility-checkers.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { LanguageCode } from '@vendure/common/lib/generated-types'; | ||
import { ShippingEligibilityChecker } from '@vendure/core'; | ||
|
||
export const countryCodeShippingEligibilityChecker = new ShippingEligibilityChecker({ | ||
code: 'country-code-shipping-eligibility-checker', | ||
description: [{ languageCode: LanguageCode.en, value: 'Country Shipping Eligibility Checker' }], | ||
args: { | ||
countryCode: { | ||
type: 'string', | ||
}, | ||
}, | ||
check: (ctx, order, args) => { | ||
return order.shippingAddress?.countryCode === args.countryCode; | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters