expressCart/lib/modules/shipping-basic.js

18 lines
359 B
JavaScript
Raw Normal View History

2020-01-03 18:21:24 +10:00
const shippingAmount = 10;
const freeThreshold = 100;
const calculateShipping = (amount, config) => {
// When set to instore shipping is not applicable.
if(config.paymentGateway === 'instore'){
return 0;
}
2020-01-03 18:21:24 +10:00
if(amount >= freeThreshold){
return 0;
}
return shippingAmount;
};
module.exports = {
calculateShipping
};