@unchainedshop/plugins
Version:
Because of a Typescript issue with upstream "postfinancecheckout", the Postfinance plugin has been disabled from transpilation, import the source ts files from src and enable node_module tsc or copy over the src/payment/postfinance-checkout to your projec
37 lines (31 loc) • 847 B
text/typescript
import {
DeliveryPricingAdapter,
DeliveryPricingDirector,
IDeliveryPricingAdapter,
} from '@unchainedshop/core';
export const DeliveryFreePrice: IDeliveryPricingAdapter = {
...DeliveryPricingAdapter,
key: 'shop.unchained.pricing.delivery-free',
label: 'Free Delivery',
version: '1.0.0',
orderIndex: 0,
isActivatedFor: () => {
return true;
},
actions: (params) => {
const pricingAdapter = DeliveryPricingAdapter.actions(params);
return {
...pricingAdapter,
calculate: async () => {
pricingAdapter.resultSheet().addFee({
amount: 0,
isTaxable: false,
isNetPrice: false,
meta: { adapter: DeliveryFreePrice.key },
});
return pricingAdapter.calculate();
},
};
},
};
DeliveryPricingDirector.registerAdapter(DeliveryFreePrice);