Skip to content

Instantly share code, notes, and snippets.

@jasongorman
Created April 6, 2020 11:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jasongorman/554434655755905266d885a87075c742 to your computer and use it in GitHub Desktop.
Save jasongorman/554434655755905266d885a87075c742 to your computer and use it in GitHub Desktop.
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