Skip to main content

ShippingEligibilityChecker

ShippingEligibilityChecker

The ShippingEligibilityChecker class is used to check whether an order qualifies for a given ShippingMethod.

Example

const minOrderTotalEligibilityChecker = new ShippingEligibilityChecker({
code: 'min-order-total-eligibility-checker',
description: [{ languageCode: LanguageCode.en, value: 'Checks that the order total is above some minimum value' }],
args: {
orderMinimum: { type: 'int', ui: { component: 'currency-form-input' } },
},
check: (ctx, order, args) => {
return order.totalWithTax >= args.orderMinimum;
},
});
Signature
class ShippingEligibilityChecker<T extends ConfigArgs = ConfigArgs> extends ConfigurableOperationDef<T> {
constructor(config: ShippingEligibilityCheckerConfig<T>)
init(injector: Injector) => ;
}

constructor

method
(config: ShippingEligibilityCheckerConfig<T>) => ShippingEligibilityChecker

init

method
(injector: Injector) =>