ShippingEligibilityChecker

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', config: { inputType: 'money' } },
    },
    check: (order, args) => {
        return order.total >= args.orderMinimum;
    },
});

Signature

class ShippingEligibilityChecker<T extends ConfigArgs = ConfigArgs> extends ConfigurableOperationDef<
    T
> {
  constructor(config: ShippingEligibilityCheckerConfig<T>)
}

Extends

Members

constructor

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