-
-
Save jasongorman/554434655755905266d885a87075c742 to your computer and use it in GitHub Desktop.
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
function postage(order) { | |
if(order.location === 'UK') { | |
if (totalPrice(order) >= 100) { | |
return 0; | |
} | |
if (totalWeight(order) < 1) { | |
return 2.99; | |
} | |
if (totalWeight(order) >= 1 && totalWeight(order) < 3) { | |
return 4.99; | |
} | |
if (totalWeight(order) >= 3) { | |
return 6.99 | |
} | |
} | |
if(order.location === 'EU') { | |
if (totalWeight(order) < 1) { | |
return 4.99; | |
} | |
if (totalWeight(order) >= 1 && totalWeight(order) < 3) { | |
return 6.99; | |
} | |
if (totalWeight(order) >= 3) { | |
return 8.99 | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment