Four Courts Press logo
Search
Custom Flat Rate Shipping Modification code for Foxycart 2.0 to allow for custom postal rates

To be pasted into the FOOTER of the 'Cart Include' Template script in FourCourts Foxycart account settings

BETWEEN THE CUSTOM SHIPPING LOGIC COMMENTS AS SHOWN BELOW


NOTE: The NI code [if (address.postal_code.indexOf("BT")] needs to be moved and pasted into the "GB" section
- see my sample file javascript/foxycart-shipping-adjust.js


/* BEGIN CUSTOM SHIPPING LOGIC *****************************************************/


else if (address.country == "AE") {
FC.customFlatRates.add(54, 5, 'Irish Post', 'to United Arab Emirates');
if (FC.json.total_weight > 0.25) { FC.customFlatRates.update(54, 6); }
if (FC.json.total_weight > 0.5) { FC.customFlatRates.update(54, 20); }
if (FC.json.total_weight > 1) { FC.customFlatRates.update(54, 25); }
if (FC.json.total_weight > 2) { FC.customFlatRates.update(54, 30); }
if (FC.json.total_weight > 3) { FC.customFlatRates.update(54, 35); }
if (FC.json.total_weight > 4) { FC.customFlatRates.update(54, 40); }
if (FC.json.total_weight > 5) { FC.customFlatRates.update(54, 45); }
if (FC.json.total_weight > 6) { FC.customFlatRates.update(54, 50); }
if (FC.json.total_weight > 7) { FC.customFlatRates.update(54, 55); }
if (FC.json.total_weight > 8) { FC.customFlatRates.update(54, 60); }
if (FC.json.total_weight > 9) { FC.customFlatRates.update(54, 65); }
if (FC.json.total_weight > 10) { FC.customFlatRates.update(54, 70); }
if (FC.json.total_weight > 11) { FC.customFlatRates.update(54, 75); }
if (FC.json.total_weight > 12) { FC.customFlatRates.update(54, 80); }
}
else if (address.country == "AT") {
FC.customFlatRates.add(9, 5, 'Irish Post', 'to Austria');
if (FC.json.total_weight > 0.25) { FC.customFlatRates.update(9, 6); }
if (FC.json.total_weight > 0.5) { FC.customFlatRates.update(9, 9.5); }
if (FC.json.total_weight > 1) { FC.customFlatRates.update(9, 13); }
if (FC.json.total_weight > 2) { FC.customFlatRates.update(9, 16.5); }
if (FC.json.total_weight > 3) { FC.customFlatRates.update(9, 19.5); }
if (FC.json.total_weight > 4) { FC.customFlatRates.update(9, 23); }
if (FC.json.total_weight > 5) { FC.customFlatRates.update(9, 26.5); }
if (FC.json.total_weight > 6) { FC.customFlatRates.update(9, 30); }
if (FC.json.total_weight > 7) { FC.customFlatRates.update(9, 33.5); }
if (FC.json.total_weight > 8) { FC.customFlatRates.update(9, 37); }
if (FC.json.total_weight > 9) { FC.customFlatRates.update(9, 40.5); }
if (FC.json.total_weight > 10) { FC.customFlatRates.update(9, 44); }
if (FC.json.total_weight > 11) { FC.customFlatRates.update(9, 47.5); }
if (FC.json.total_weight > 12) { FC.customFlatRates.update(9, 50); }
}
else if (address.country == "AU") {
FC.customFlatRates.add(44, 5, 'Irish Post', 'to Australia');
if (FC.json.total_weight > 0.25) { FC.customFlatRates.update(44, 6); }
if (FC.json.total_weight > 0.5) { FC.customFlatRates.update(44, 25); }
if (FC.json.total_weight > 1) { FC.customFlatRates.update(44, 38.5); }
if (FC.json.total_weight > 2) { FC.customFlatRates.update(44, 52); }
if (FC.json.total_weight > 3) { FC.customFlatRates.update(44, 65.5); }
if (FC.json.total_weight > 4) { FC.customFlatRates.update(44, 79); }
if (FC.json.total_weight > 5) { FC.customFlatRates.update(44, 92.5); }
if (FC.json.total_weight > 6) { FC.customFlatRates.update(44, 106); }
if (FC.json.total_weight > 7) { FC.customFlatRates.update(44, 119.5); }
if (FC.json.total_weight > 8) { FC.customFlatRates.update(44, 133); }
if (FC.json.total_weight > 9) { FC.customFlatRates.update(44, 146.5); }
if (FC.json.total_weight > 10) { FC.customFlatRates.update(44, 160); }
if (FC.json.total_weight > 11) { FC.customFlatRates.update(44, 175); }
if (FC.json.total_weight > 12) { FC.customFlatRates.update(44, 188.5); }
}
else if (address.country == "BA") {
FC.customFlatRates.add(12, 5, 'Irish Post', 'to Bosnia & Herzegovina');
if (FC.json.total_weight > 0.25) { FC.customFlatRates.update(12, 6); }
if (FC.json.total_weight > 0.5) { FC.customFlatRates.update(12, 19.5); }
if (FC.json.total_weight > 1) { FC.customFlatRates.update(12, 27); }
if (FC.json.total_weight > 2) { FC.customFlatRates.update(12, 34.5); }
if (FC.json.total_weight > 3) { FC.customFlatRates.update(12, 42); }
if (FC.json.total_weight > 4) { FC.customFlatRates.update(12, 49.5); }
if (FC.json.total_weight > 5) { FC.customFlatRates.update(12, 57); }
if (FC.json.total_weight > 6) { FC.customFlatRates.update(12, 64.5); }
if (FC.json.total_weight > 7) { FC.customFlatRates.update(12, 72); }
if (FC.json.total_weight > 8) { FC.customFlatRates.update(12, 79.5); }
if (FC.json.total_weight > 9) { FC.customFlatRates.update(12, 87); }
if (FC.json.total_weight > 10) { FC.customFlatRates.update(12, 94.5); }
if (FC.json.total_weight > 11) { FC.customFlatRates.update(12, 102); }
if (FC.json.total_weight > 12) { FC.customFlatRates.update(12, 109.5); }
}
else if (address.country == "BE") {
FC.customFlatRates.add(11, 5, 'Irish Post', 'to Belgium');
if (FC.json.total_weight > 0.25) { FC.customFlatRates.update(11, 6); }
if (FC.json.total_weight > 0.5) { FC.customFlatRates.update(11, 8.5); }
if (FC.json.total_weight > 1) { FC.customFlatRates.update(11, 10); }
if (FC.json.total_weight > 2) { FC.customFlatRates.update(11, 11.5); }
if (FC.json.total_weight > 3) { FC.customFlatRates.update(11, 13); }
if (FC.json.total_weight > 4) { FC.customFlatRates.update(11, 14.5); }
if (FC.json.total_weight > 5) { FC.customFlatRates.update(11, 16); }
if (FC.json.total_weight > 6) { FC.customFlatRates.update(11, 17.5); }
if (FC.json.total_weight > 7) { FC.customFlatRates.update(11, 19); }
if (FC.json.total_weight > 8) { FC.customFlatRates.update(11, 20.5); }
if (FC.json.total_weight > 9) { FC.customFlatRates.update(11, 22); }
if (FC.json.total_weight > 10) { FC.customFlatRates.update(11, 23.5); }
if (FC.json.total_weight > 11) { FC.customFlatRates.update(11, 25); }
if (FC.json.total_weight > 12) { FC.customFlatRates.update(11, 26.5); }
}
else if (address.country == "BG") {
FC.customFlatRates.add(13, 5, 'Irish Post', 'to Bulgaria');
if (FC.json.total_weight > 0.25) { FC.customFlatRates.update(13, 6); }
if (FC.json.total_weight > 0.5) { FC.customFlatRates.update(13, 15); }
if (FC.json.total_weight > 1) { FC.customFlatRates.update(13, 17.5); }
if (FC.json.total_weight > 2) { FC.customFlatRates.update(13, 20); }
if (FC.json.total_weight > 3) { FC.customFlatRates.update(13, 22.5); }
if (FC.json.total_weight > 4) { FC.customFlatRates.update(13, 25); }
if (FC.json.total_weight > 5) { FC.customFlatRates.update(13, 27.5); }
if (FC.json.total_weight > 6) { FC.customFlatRates.update(13, 30); }
if (FC.json.total_weight > 7) { FC.customFlatRates.update(13, 32.5); }
if (FC.json.total_weight > 8) { FC.customFlatRates.update(13, 35); }
if (FC.json.total_weight > 9) { FC.customFlatRates.update(13, 37.5); }
if (FC.json.total_weight > 10) { FC.customFlatRates.update(13, 40); }
if (FC.json.total_weight > 11) { FC.customFlatRates.update(13, 42.5); }
if (FC.json.total_weight > 12) { FC.customFlatRates.update(13, 45); }
}
else if (address.country == "BR") {
FC.customFlatRates.add(45, 5, 'Irish Post', 'to Brazil');
if (FC.json.total_weight > 0.25) { FC.customFlatRates.update(45, 6); }
if (FC.json.total_weight > 0.5) { FC.customFlatRates.update(45, 30.5); }
if (FC.json.total_weight > 1) { FC.customFlatRates.update(45, 44); }
if (FC.json.total_weight > 2) { FC.customFlatRates.update(45, 57.5); }
if (FC.json.total_weight > 3) { FC.customFlatRates.update(45, 71); }
if (FC.json.total_weight > 4) { FC.customFlatRates.update(45, 84.5); }
if (FC.json.total_weight > 5) { FC.customFlatRates.update(45, 98); }
if (FC.json.total_weight > 6) { FC.customFlatRates.update(45, 111.5); }
if (FC.json.total_weight > 7) { FC.customFlatRates.update(45, 125); }
if (FC.json.total_weight > 8) { FC.customFlatRates.update(45, 138.5); }
if (FC.json.total_weight > 9) { FC.customFlatRates.update(45, 152); }
if (FC.json.total_weight > 10) { FC.customFlatRates.update(45, 165.5); }
if (FC.json.total_weight > 11) { FC.customFlatRates.update(45, 179); }
if (FC.json.total_weight > 12) { FC.customFlatRates.update(45, 193); }
}
else if (address.country == "CA") {
FC.customFlatRates.add(55, 9.4, 'Irish Post', 'to Canada');
if (FC.json.total_weight > 0.25) { FC.customFlatRates.update(55, 9.4); }
if (FC.json.total_weight > 0.5) { FC.customFlatRates.update(55, 12.5); }
if (FC.json.total_weight > 1) { FC.customFlatRates.update(55, 17.5); }
if (FC.json.total_weight > 2) { FC.customFlatRates.update(55, 22.5); }
if (FC.json.total_weight > 3) { FC.customFlatRates.update(55, 27.5); }
if (FC.json.total_weight > 4) { FC.customFlatRates.update(55, 32.5); }
if (FC.json.total_weight > 5) { FC.customFlatRates.update(55, 37.5); }
if (FC.json.total_weight > 6) { FC.customFlatRates.update(55, 42.5); }
if (FC.json.total_weight > 7) { FC.customFlatRates.update(55, 47.5); }
if (FC.json.total_weight > 8) { FC.customFlatRates.update(55, 52.5); }
if (FC.json.total_weight > 9) { FC.customFlatRates.update(55, 57.5); }
if (FC.json.total_weight > 10) { FC.customFlatRates.update(55, 62.5); }
if (FC.json.total_weight > 11) { FC.customFlatRates.update(55, 67.5); }
if (FC.json.total_weight > 12) { FC.customFlatRates.update(55, 72.5); }
}
else if (address.country == "CH") {
FC.customFlatRates.add(41, 5, 'Irish Post', 'to Switzerland');
if (FC.json.total_weight > 0.25) { FC.customFlatRates.update(41, 6); }
if (FC.json.total_weight > 0.5) { FC.customFlatRates.update(41, 12.5); }
if (FC.json.total_weight > 1) { FC.customFlatRates.update(41, 15.5); }
if (FC.json.total_weight > 2) { FC.customFlatRates.update(41, 18.5); }
if (FC.json.total_weight > 3) { FC.customFlatRates.update(41, 21.5); }
if (FC.json.total_weight > 4) { FC.customFlatRates.update(41, 24.5); }
if (FC.json.total_weight > 5) { FC.customFlatRates.update(41, 27.5); }
if (FC.json.total_weight > 6) { FC.customFlatRates.update(41, 30.5); }
if (FC.json.total_weight > 7) { FC.customFlatRates.update(41, 33.5); }
if (FC.json.total_weight > 8) { FC.customFlatRates.update(41, 36.5); }
if (FC.json.total_weight > 9) { FC.customFlatRates.update(41, 39.5); }
if (FC.json.total_weight > 10) { FC.customFlatRates.update(41, 42.5); }
if (FC.json.total_weight > 11) { FC.customFlatRates.update(41, 45.5); }
if (FC.json.total_weight > 12) { FC.customFlatRates.update(41, 48.5); }
}
else if (address.country == "CN") {
FC.customFlatRates.add(46, 5, 'Irish Post', 'to China');
if (FC.json.total_weight > 0.25) { FC.customFlatRates.update(46, 6); }
if (FC.json.total_weight > 0.5) { FC.customFlatRates.update(46, 17.5); }
if (FC.json.total_weight > 1) { FC.customFlatRates.update(46, 30); }
if (FC.json.total_weight > 2) { FC.customFlatRates.update(46, 42.5); }
if (FC.json.total_weight > 3) { FC.customFlatRates.update(46, 55); }
if (FC.json.total_weight > 4) { FC.customFlatRates.update(46, 67.5); }
if (FC.json.total_weight > 5) { FC.customFlatRates.update(46, 80); }
if (FC.json.total_weight > 6) { FC.customFlatRates.update(46, 92.5); }
if (FC.json.total_weight > 7) { FC.customFlatRates.update(46, 105); }
if (FC.json.total_weight > 8) { FC.customFlatRates.update(46, 117.5); }
if (FC.json.total_weight > 9) { FC.customFlatRates.update(46, 130); }
if (FC.json.total_weight > 10) { FC.customFlatRates.update(46, 142.5); }
if (FC.json.total_weight > 11) { FC.customFlatRates.update(46, 155); }
if (FC.json.total_weight > 12) { FC.customFlatRates.update(46, 167.5); }
}
else if (address.country == "CY") {
FC.customFlatRates.add(15, 5, 'Irish Post', 'to Cyprus');
if (FC.json.total_weight > 0.25) { FC.customFlatRates.update(15, 6); }
if (FC.json.total_weight > 0.5) { FC.customFlatRates.update(15, 20); }
if (FC.json.total_weight > 1) { FC.customFlatRates.update(15, 26.5); }
if (FC.json.total_weight > 2) { FC.customFlatRates.update(15, 33); }
if (FC.json.total_weight > 3) { FC.customFlatRates.update(15, 39.5); }
if (FC.json.total_weight > 4) { FC.customFlatRates.update(15, 46); }
if (FC.json.total_weight > 5) { FC.customFlatRates.update(15, 52.5); }
if (FC.json.total_weight > 6) { FC.customFlatRates.update(15, 59); }
if (FC.json.total_weight > 7) { FC.customFlatRates.update(15, 65.5); }
if (FC.json.total_weight > 8) { FC.customFlatRates.update(15, 72.5); }
if (FC.json.total_weight > 9) { FC.customFlatRates.update(15, 79); }
if (FC.json.total_weight > 10) { FC.customFlatRates.update(15, 85.5); }
if (FC.json.total_weight > 11) { FC.customFlatRates.update(15, 91); }
if (FC.json.total_weight > 12) { FC.customFlatRates.update(15, 97.5); }
}
else if (address.country == "CZ") {
FC.customFlatRates.add(16, 5, 'Irish Post', 'to Czech Republic');
if (FC.json.total_weight > 0.25) { FC.customFlatRates.update(16, 6); }
if (FC.json.total_weight > 0.5) { FC.customFlatRates.update(16, 10); }
if (FC.json.total_weight > 1) { FC.customFlatRates.update(16, 13.5); }
if (FC.json.total_weight > 2) { FC.customFlatRates.update(16, 17); }
if (FC.json.total_weight > 3) { FC.customFlatRates.update(16, 20.5); }
if (FC.json.total_weight > 4) { FC.customFlatRates.update(16, 24); }
if (FC.json.total_weight > 5) { FC.customFlatRates.update(16, 27.5); }
if (FC.json.total_weight > 6) { FC.customFlatRates.update(16, 31); }
if (FC.json.total_weight > 7) { FC.customFlatRates.update(16, 34.5); }
if (FC.json.total_weight > 8) { FC.customFlatRates.update(16, 38); }
if (FC.json.total_weight > 9) { FC.customFlatRates.update(16, 41.5); }
if (FC.json.total_weight > 10) { FC.customFlatRates.update(16, 45); }
if (FC.json.total_weight > 11) { FC.customFlatRates.update(16, 48.5); }
if (FC.json.total_weight > 12) { FC.customFlatRates.update(16, 52); }
}
else if (address.country == "DE") {
FC.customFlatRates.add(21, 5, 'Irish Post', 'to Germany');
if (FC.json.total_weight > 0.25) { FC.customFlatRates.update(21, 6); }
if (FC.json.total_weight > 0.5) { FC.customFlatRates.update(21, 8.5); }
if (FC.json.total_weight > 1) { FC.customFlatRates.update(21, 10); }
if (FC.json.total_weight > 2) { FC.customFlatRates.update(21, 11.5); }
if (FC.json.total_weight > 3) { FC.customFlatRates.update(21, 13); }
if (FC.json.total_weight > 4) { FC.customFlatRates.update(21, 14.5); }
if (FC.json.total_weight > 5) { FC.customFlatRates.update(21, 16); }
if (FC.json.total_weight > 6) { FC.customFlatRates.update(21, 17.5); }
if (FC.json.total_weight > 7) { FC.customFlatRates.update(21, 19); }
if (FC.json.total_weight > 8) { FC.customFlatRates.update(21, 20.5); }
if (FC.json.total_weight > 9) { FC.customFlatRates.update(21, 22); }
if (FC.json.total_weight > 10) { FC.customFlatRates.update(21, 23.5); }
if (FC.json.total_weight > 11) { FC.customFlatRates.update(21, 25); }
if (FC.json.total_weight > 12) { FC.customFlatRates.update(21, 26.5); }
}
else if (address.country == "DK") {
FC.customFlatRates.add(17, 5, 'Irish Post', 'to Denmark');
if (FC.json.total_weight > 0.25) { FC.customFlatRates.update(17, 6); }
if (FC.json.total_weight > 0.5) { FC.customFlatRates.update(17, 12.5); }
if (FC.json.total_weight > 1) { FC.customFlatRates.update(17, 15.5); }
if (FC.json.total_weight > 2) { FC.customFlatRates.update(17, 18.5); }
if (FC.json.total_weight > 3) { FC.customFlatRates.update(17, 21.5); }
if (FC.json.total_weight > 4) { FC.customFlatRates.update(17, 24.5); }
if (FC.json.total_weight > 5) { FC.customFlatRates.update(17, 27.5); }
if (FC.json.total_weight > 6) { FC.customFlatRates.update(17, 30.5); }
if (FC.json.total_weight > 7) { FC.customFlatRates.update(17, 33.5); }
if (FC.json.total_weight > 8) { FC.customFlatRates.update(17, 36.5); }
if (FC.json.total_weight > 9) { FC.customFlatRates.update(17, 39.5); }
if (FC.json.total_weight > 10) { FC.customFlatRates.update(17, 42.5); }
if (FC.json.total_weight > 11) { FC.customFlatRates.update(17, 45.5); }
if (FC.json.total_weight > 12) { FC.customFlatRates.update(17, 48.5); }
}
else if (address.country == "EE") {
FC.customFlatRates.add(18, 5, 'Irish Post', 'to Estonia');
if (FC.json.total_weight > 0.25) { FC.customFlatRates.update(18, 6); }
if (FC.json.total_weight > 0.5) { FC.customFlatRates.update(18, 8.5); }
if (FC.json.total_weight > 1) { FC.customFlatRates.update(18, 14); }
if (FC.json.total_weight > 2) { FC.customFlatRates.update(18, 16.5); }
if (FC.json.total_weight > 3) { FC.customFlatRates.update(18, 20); }
if (FC.json.total_weight > 4) { FC.customFlatRates.update(18, 24.5); }
if (FC.json.total_weight > 5) { FC.customFlatRates.update(18, 29); }
if (FC.json.total_weight > 6) { FC.customFlatRates.update(18, 33.5); }
if (FC.json.total_weight > 7) { FC.customFlatRates.update(18, 38); }
if (FC.json.total_weight > 8) { FC.customFlatRates.update(18, 42.5); }
if (FC.json.total_weight > 9) { FC.customFlatRates.update(18, 47); }
if (FC.json.total_weight > 10) { FC.customFlatRates.update(18, 50); }
if (FC.json.total_weight > 11) { FC.customFlatRates.update(18, 55); }
if (FC.json.total_weight > 12) { FC.customFlatRates.update(18, 60); }
}
else if (address.country == "ES") {
FC.customFlatRates.add(39, 5, 'Irish Post', 'to Spain');
if (FC.json.total_weight > 0.25) { FC.customFlatRates.update(39, 6); }
if (FC.json.total_weight > 0.5) { FC.customFlatRates.update(39, 10.5); }
if (FC.json.total_weight > 1) { FC.customFlatRates.update(39, 13.5); }
if (FC.json.total_weight > 2) { FC.customFlatRates.update(39, 16.5); }
if (FC.json.total_weight > 3) { FC.customFlatRates.update(39, 19.5); }
if (FC.json.total_weight > 4) { FC.customFlatRates.update(39, 22.5); }
if (FC.json.total_weight > 5) { FC.customFlatRates.update(39, 25.5); }
if (FC.json.total_weight > 6) { FC.customFlatRates.update(39, 28.5); }
if (FC.json.total_weight > 7) { FC.customFlatRates.update(39, 31.5); }
if (FC.json.total_weight > 8) { FC.customFlatRates.update(39, 34.5); }
if (FC.json.total_weight > 9) { FC.customFlatRates.update(39, 37.5); }
if (FC.json.total_weight > 10) { FC.customFlatRates.update(39, 40.5); }
if (FC.json.total_weight > 11) { FC.customFlatRates.update(39, 43.5); }
if (FC.json.total_weight > 12) { FC.customFlatRates.update(39, 46.5); }
}
else if (address.country == "FI") {
FC.customFlatRates.add(19, 5, 'Irish Post', 'to Finland');
if (FC.json.total_weight > 0.25) { FC.customFlatRates.update(19, 6); }
if (FC.json.total_weight > 0.5) { FC.customFlatRates.update(19, 14.5); }
if (FC.json.total_weight > 1) { FC.customFlatRates.update(19, 17.5); }
if (FC.json.total_weight > 2) { FC.customFlatRates.update(19, 20); }
if (FC.json.total_weight > 3) { FC.customFlatRates.update(19, 23.5); }
if (FC.json.total_weight > 4) { FC.customFlatRates.update(19, 27); }
if (FC.json.total_weight > 5) { FC.customFlatRates.update(19, 30.5); }
if (FC.json.total_weight > 6) { FC.customFlatRates.update(19, 34); }
if (FC.json.total_weight > 7) { FC.customFlatRates.update(19, 37.5); }
if (FC.json.total_weight > 8) { FC.customFlatRates.update(19, 41); }
if (FC.json.total_weight > 9) { FC.customFlatRates.update(19, 44.5); }
if (FC.json.total_weight > 10) { FC.customFlatRates.update(19, 47.5); }
if (FC.json.total_weight > 11) { FC.customFlatRates.update(19, 51); }
if (FC.json.total_weight > 12) { FC.customFlatRates.update(19, 54.5); }
}
else if (address.country == "FR") {
FC.customFlatRates.add(20, 5, 'Irish Post', 'to France');
if (FC.json.total_weight > 0.25) { FC.customFlatRates.update(20, 6); }
if (FC.json.total_weight > 0.5) { FC.customFlatRates.update(20, 10.5); }
if (FC.json.total_weight > 1) { FC.customFlatRates.update(20, 12.5); }
if (FC.json.total_weight > 2) { FC.customFlatRates.update(20, 15.5); }
if (FC.json.total_weight > 3) { FC.customFlatRates.update(20, 18.5); }
if (FC.json.total_weight > 4) { FC.customFlatRates.update(20, 21.5); }
if (FC.json.total_weight > 5) { FC.customFlatRates.update(20, 24.5); }
if (FC.json.total_weight > 6) { FC.customFlatRates.update(20, 27.5); }
if (FC.json.total_weight > 7) { FC.customFlatRates.update(20, 30.5); }
if (FC.json.total_weight > 8) { FC.customFlatRates.update(20, 33.5); }
if (FC.json.total_weight > 9) { FC.customFlatRates.update(20, 36.5); }
if (FC.json.total_weight > 10) { FC.customFlatRates.update(20, 39.5); }
if (FC.json.total_weight > 11) { FC.customFlatRates.update(20, 42.5); }
if (FC.json.total_weight > 12) { FC.customFlatRates.update(20, 45.5); }
}
else if (address.country == "GB") {
FC.customFlatRates.add(5, 5, 'Irish Post', 'to UK');
if (FC.json.total_weight > 0.25) { FC.customFlatRates.update(5, 6); }
if (FC.json.total_weight > 0.5) { FC.customFlatRates.update(5, 8.5); }
if (FC.json.total_weight > 1) { FC.customFlatRates.update(5, 8.5); }
if (FC.json.total_weight > 2) { FC.customFlatRates.update(5, 8.5); }
if (FC.json.total_weight > 3) { FC.customFlatRates.update(5, 8.5); }
if (FC.json.total_weight > 4) { FC.customFlatRates.update(5, 8.5); }
if (FC.json.total_weight > 5) { FC.customFlatRates.update(5, 15); }
if (FC.json.total_weight > 6) { FC.customFlatRates.update(5, 15); }
if (FC.json.total_weight > 7) { FC.customFlatRates.update(5, 15); }
if (FC.json.total_weight > 8) { FC.customFlatRates.update(5, 15); }
if (FC.json.total_weight > 9) { FC.customFlatRates.update(5, 15); }
if (FC.json.total_weight > 10) { FC.customFlatRates.update(5, 20); }
if (FC.json.total_weight > 11) { FC.customFlatRates.update(5, 25); }
if (FC.json.total_weight > 12) { FC.customFlatRates.update(5, 25); }
}
else if (address.country == "GR") {
FC.customFlatRates.add(22, 5, 'Irish Post', 'to Greece');
if (FC.json.total_weight > 0.25) { FC.customFlatRates.update(22, 6); }
if (FC.json.total_weight > 0.5) { FC.customFlatRates.update(22, 12.5); }
if (FC.json.total_weight > 1) { FC.customFlatRates.update(22, 17.5); }
if (FC.json.total_weight > 2) { FC.customFlatRates.update(22, 22.5); }
if (FC.json.total_weight > 3) { FC.customFlatRates.update(22, 27.5); }
if (FC.json.total_weight > 4) { FC.customFlatRates.update(22, 32.5); }
if (FC.json.total_weight > 5) { FC.customFlatRates.update(22, 37.5); }
if (FC.json.total_weight > 6) { FC.customFlatRates.update(22, 42.5); }
if (FC.json.total_weight > 7) { FC.customFlatRates.update(22, 47.5); }
if (FC.json.total_weight > 8) { FC.customFlatRates.update(22, 52.5); }
if (FC.json.total_weight > 9) { FC.customFlatRates.update(22, 57.5); }
if (FC.json.total_weight > 10) { FC.customFlatRates.update(22, 62.5); }
if (FC.json.total_weight > 11) { FC.customFlatRates.update(22, 67.5); }
if (FC.json.total_weight > 12) { FC.customFlatRates.update(22, 72.5); }
}
else if (address.country == "HK") {
FC.customFlatRates.add(48, 5, 'Irish Post', 'to Hong Kong');
if (FC.json.total_weight > 0.25) { FC.customFlatRates.update(48, 6); }
if (FC.json.total_weight > 0.5) { FC.customFlatRates.update(48, 25); }
if (FC.json.total_weight > 1) { FC.customFlatRates.update(48, 30); }
if (FC.json.total_weight > 2) { FC.customFlatRates.update(48, 35); }
if (FC.json.total_weight > 3) { FC.customFlatRates.update(48, 40); }
if (FC.json.total_weight > 4) { FC.customFlatRates.update(48, 45); }
if (FC.json.total_weight > 5) { FC.customFlatRates.update(48, 50); }
if (FC.json.total_weight > 6) { FC.customFlatRates.update(48, 55); }
if (FC.json.total_weight > 7) { FC.customFlatRates.update(48, 60); }
if (FC.json.total_weight > 8) { FC.customFlatRates.update(48, 65); }
if (FC.json.total_weight > 9) { FC.customFlatRates.update(48, 70); }
if (FC.json.total_weight > 10) { FC.customFlatRates.update(48, 75); }
if (FC.json.total_weight > 11) { FC.customFlatRates.update(48, 80); }
if (FC.json.total_weight > 12) { FC.customFlatRates.update(48, 85); }
}
else if (address.country == "HR") {
FC.customFlatRates.add(14, 5, 'Irish Post', 'to Croatia');
if (FC.json.total_weight > 0.25) { FC.customFlatRates.update(14, 6); }
if (FC.json.total_weight > 0.5) { FC.customFlatRates.update(14, 10); }
if (FC.json.total_weight > 1) { FC.customFlatRates.update(14, 12.5); }
if (FC.json.total_weight > 2) { FC.customFlatRates.update(14, 15.5); }
if (FC.json.total_weight > 3) { FC.customFlatRates.update(14, 18.5); }
if (FC.json.total_weight > 4) { FC.customFlatRates.update(14, 21.5); }
if (FC.json.total_weight > 5) { FC.customFlatRates.update(14, 24.5); }
if (FC.json.total_weight > 6) { FC.customFlatRates.update(14, 27.5); }
if (FC.json.total_weight > 7) { FC.customFlatRates.update(14, 30.5); }
if (FC.json.total_weight > 8) { FC.customFlatRates.update(14, 33.5); }
if (FC.json.total_weight > 9) { FC.customFlatRates.update(14, 36.5); }
if (FC.json.total_weight > 10) { FC.customFlatRates.update(14, 39.5); }
if (FC.json.total_weight > 11) { FC.customFlatRates.update(14, 42.5); }
if (FC.json.total_weight > 12) { FC.customFlatRates.update(14, 45.5); }
}
else if (address.country == "HU") {
FC.customFlatRates.add(23, 5, 'Irish Post', 'to Hungary');
if (FC.json.total_weight > 0.25) { FC.customFlatRates.update(23, 6); }
if (FC.json.total_weight > 0.5) { FC.customFlatRates.update(23, 10); }
if (FC.json.total_weight > 1) { FC.customFlatRates.update(23, 15); }
if (FC.json.total_weight > 2) { FC.customFlatRates.update(23, 18.5); }
if (FC.json.total_weight > 3) { FC.customFlatRates.update(23, 22); }
if (FC.json.total_weight > 4) { FC.customFlatRates.update(23, 25.5); }
if (FC.json.total_weight > 5) { FC.customFlatRates.update(23, 29); }
if (FC.json.total_weight > 6) { FC.customFlatRates.update(23, 32.5); }
if (FC.json.total_weight > 7) { FC.customFlatRates.update(23, 36); }
if (FC.json.total_weight > 8) { FC.customFlatRates.update(23, 39.5); }
if (FC.json.total_weight > 9) { FC.customFlatRates.update(23, 43); }
if (FC.json.total_weight > 10) { FC.customFlatRates.update(23, 46.5); }
if (FC.json.total_weight > 11) { FC.customFlatRates.update(23, 50); }
if (FC.json.total_weight > 12) { FC.customFlatRates.update(23, 53.5); }
}
else if (address.country == "IE") {
FC.customFlatRates.add(4, 2.5, 'Irish Post', 'to Ireland');
if (FC.json.total_weight > 0.25) { FC.customFlatRates.update(4, 4.5); }
if (FC.json.total_weight > 0.5) { FC.customFlatRates.update(4, 6.5); }
if (FC.json.total_weight > 1) { FC.customFlatRates.update(4, 6.5); }
if (FC.json.total_weight > 2) { FC.customFlatRates.update(4, 6.5); }
if (FC.json.total_weight > 3) { FC.customFlatRates.update(4, 6.5); }
if (FC.json.total_weight > 4) { FC.customFlatRates.update(4, 10); }
if (FC.json.total_weight > 5) { FC.customFlatRates.update(4, 15); }
if (FC.json.total_weight > 6) { FC.customFlatRates.update(4, 15); }
if (FC.json.total_weight > 7) { FC.customFlatRates.update(4, 15); }
if (FC.json.total_weight > 8) { FC.customFlatRates.update(4, 15); }
if (FC.json.total_weight > 9) { FC.customFlatRates.update(4, 15); }
if (FC.json.total_weight > 10) { FC.customFlatRates.update(4, 15); }
if (FC.json.total_weight > 11) { FC.customFlatRates.update(4, 15); }
if (FC.json.total_weight > 12) { FC.customFlatRates.update(4, 15); }
}
else if (address.country == "IN") {
FC.customFlatRates.add(47, 5, 'Irish Post', 'to India');
if (FC.json.total_weight > 0.25) { FC.customFlatRates.update(47, 6); }
if (FC.json.total_weight > 0.5) { FC.customFlatRates.update(47, 17.5); }
if (FC.json.total_weight > 1) { FC.customFlatRates.update(47, 23); }
if (FC.json.total_weight > 2) { FC.customFlatRates.update(47, 28.5); }
if (FC.json.total_weight > 3) { FC.customFlatRates.update(47, 34); }
if (FC.json.total_weight > 4) { FC.customFlatRates.update(47, 39.5); }
if (FC.json.total_weight > 5) { FC.customFlatRates.update(47, 45); }
if (FC.json.total_weight > 6) { FC.customFlatRates.update(47, 50.5); }
if (FC.json.total_weight > 7) { FC.customFlatRates.update(47, 56); }
if (FC.json.total_weight > 8) { FC.customFlatRates.update(47, 61.5); }
if (FC.json.total_weight > 9) { FC.customFlatRates.update(47, 67); }
if (FC.json.total_weight > 10) { FC.customFlatRates.update(47, 72.5); }
if (FC.json.total_weight > 11) { FC.customFlatRates.update(47, 78); }
if (FC.json.total_weight > 12) { FC.customFlatRates.update(47, 83.5); }
}
else if (address.country == "IS") {
FC.customFlatRates.add(24, 5, 'Irish Post', 'to Iceland');
if (FC.json.total_weight > 0.25) { FC.customFlatRates.update(24, 6); }
if (FC.json.total_weight > 0.5) { FC.customFlatRates.update(24, 25); }
if (FC.json.total_weight > 1) { FC.customFlatRates.update(24, 29.5); }
if (FC.json.total_weight > 2) { FC.customFlatRates.update(24, 34); }
if (FC.json.total_weight > 3) { FC.customFlatRates.update(24, 38.5); }
if (FC.json.total_weight > 4) { FC.customFlatRates.update(24, 43); }
if (FC.json.total_weight > 5) { FC.customFlatRates.update(24, 47.5); }
if (FC.json.total_weight > 6) { FC.customFlatRates.update(24, 52); }
if (FC.json.total_weight > 7) { FC.customFlatRates.update(24, 56.5); }
if (FC.json.total_weight > 8) { FC.customFlatRates.update(24, 61); }
if (FC.json.total_weight > 9) { FC.customFlatRates.update(24, 65.5); }
if (FC.json.total_weight > 10) { FC.customFlatRates.update(24, 70); }
if (FC.json.total_weight > 11) { FC.customFlatRates.update(24, 74.5); }
if (FC.json.total_weight > 12) { FC.customFlatRates.update(24, 79); }
}
else if (address.country == "IT") {
FC.customFlatRates.add(25, 5, 'Irish Post', 'to Italy');
if (FC.json.total_weight > 0.25) { FC.customFlatRates.update(25, 6); }
if (FC.json.total_weight > 0.5) { FC.customFlatRates.update(25, 13.5); }
if (FC.json.total_weight > 1) { FC.customFlatRates.update(25, 18); }
if (FC.json.total_weight > 2) { FC.customFlatRates.update(25, 22.5); }
if (FC.json.total_weight > 3) { FC.customFlatRates.update(25, 27.5); }
if (FC.json.total_weight > 4) { FC.customFlatRates.update(25, 32); }
if (FC.json.total_weight > 5) { FC.customFlatRates.update(25, 36.5); }
if (FC.json.total_weight > 6) { FC.customFlatRates.update(25, 41); }
if (FC.json.total_weight > 7) { FC.customFlatRates.update(25, 45.5); }
if (FC.json.total_weight > 8) { FC.customFlatRates.update(25, 49.5); }
if (FC.json.total_weight > 9) { FC.customFlatRates.update(25, 54); }
if (FC.json.total_weight > 10) { FC.customFlatRates.update(25, 58.5); }
if (FC.json.total_weight > 11) { FC.customFlatRates.update(25, 63); }
if (FC.json.total_weight > 12) { FC.customFlatRates.update(25, 67.5); }
}
else if (address.country == "JP") {
FC.customFlatRates.add(49, 5, 'Irish Post', 'to Japan');
if (FC.json.total_weight > 0.25) { FC.customFlatRates.update(49, 6); }
if (FC.json.total_weight > 0.5) { FC.customFlatRates.update(49, 30); }
if (FC.json.total_weight > 1) { FC.customFlatRates.update(49, 39.5); }
if (FC.json.total_weight > 2) { FC.customFlatRates.update(49, 49); }
if (FC.json.total_weight > 3) { FC.customFlatRates.update(49, 58.5); }
if (FC.json.total_weight > 4) { FC.customFlatRates.update(49, 68); }
if (FC.json.total_weight > 5) { FC.customFlatRates.update(49, 77.5); }
if (FC.json.total_weight > 6) { FC.customFlatRates.update(49, 87); }
if (FC.json.total_weight > 7) { FC.customFlatRates.update(49, 96.5); }
if (FC.json.total_weight > 8) { FC.customFlatRates.update(49, 106); }
if (FC.json.total_weight > 9) { FC.customFlatRates.update(49, 115.5); }
if (FC.json.total_weight > 10) { FC.customFlatRates.update(49, 125); }
if (FC.json.total_weight > 11) { FC.customFlatRates.update(49, 134.5); }
if (FC.json.total_weight > 12) { FC.customFlatRates.update(49, 144); }
}
else if (address.country == "LT") {
FC.customFlatRates.add(27, 5, 'Irish Post', 'to Lithuania');
if (FC.json.total_weight > 0.25) { FC.customFlatRates.update(27, 6); }
if (FC.json.total_weight > 0.5) { FC.customFlatRates.update(27, 10); }
if (FC.json.total_weight > 1) { FC.customFlatRates.update(27, 16.5); }
if (FC.json.total_weight > 2) { FC.customFlatRates.update(27, 20); }
if (FC.json.total_weight > 3) { FC.customFlatRates.update(27, 24.5); }
if (FC.json.total_weight > 4) { FC.customFlatRates.update(27, 29); }
if (FC.json.total_weight > 5) { FC.customFlatRates.update(27, 33.5); }
if (FC.json.total_weight > 6) { FC.customFlatRates.update(27, 38); }
if (FC.json.total_weight > 7) { FC.customFlatRates.update(27, 42.5); }
if (FC.json.total_weight > 8) { FC.customFlatRates.update(27, 47); }
if (FC.json.total_weight > 9) { FC.customFlatRates.update(27, 51.5); }
if (FC.json.total_weight > 10) { FC.customFlatRates.update(27, 56); }
if (FC.json.total_weight > 11) { FC.customFlatRates.update(27, 60.5); }
if (FC.json.total_weight > 12) { FC.customFlatRates.update(27, 65); }
}
else if (address.country == "LU") {
FC.customFlatRates.add(28, 5, 'Irish Post', 'to Luxembourg');
if (FC.json.total_weight > 0.25) { FC.customFlatRates.update(28, 6); }
if (FC.json.total_weight > 0.5) { FC.customFlatRates.update(28, 8.5); }
if (FC.json.total_weight > 1) { FC.customFlatRates.update(28, 15); }
if (FC.json.total_weight > 2) { FC.customFlatRates.update(28, 17.5); }
if (FC.json.total_weight > 3) { FC.customFlatRates.update(28, 22.5); }
if (FC.json.total_weight > 4) { FC.customFlatRates.update(28, 25); }
if (FC.json.total_weight > 5) { FC.customFlatRates.update(28, 27.5); }
if (FC.json.total_weight > 6) { FC.customFlatRates.update(28, 30); }
if (FC.json.total_weight > 7) { FC.customFlatRates.update(28, 32.5); }
if (FC.json.total_weight > 8) { FC.customFlatRates.update(28, 35); }
if (FC.json.total_weight > 9) { FC.customFlatRates.update(28, 37.5); }
if (FC.json.total_weight > 10) { FC.customFlatRates.update(28, 40); }
if (FC.json.total_weight > 11) { FC.customFlatRates.update(28, 40); }
if (FC.json.total_weight > 12) { FC.customFlatRates.update(28, 40); }
}
else if (address.country == "LV") {
FC.customFlatRates.add(26, 5, 'Irish Post', 'to Latvia');
if (FC.json.total_weight > 0.25) { FC.customFlatRates.update(26, 6); }
if (FC.json.total_weight > 0.5) { FC.customFlatRates.update(26, 8.5); }
if (FC.json.total_weight > 1) { FC.customFlatRates.update(26, 14.5); }
if (FC.json.total_weight > 2) { FC.customFlatRates.update(26, 18); }
if (FC.json.total_weight > 3) { FC.customFlatRates.update(26, 21.5); }
if (FC.json.total_weight > 4) { FC.customFlatRates.update(26, 25); }
if (FC.json.total_weight > 5) { FC.customFlatRates.update(26, 28.5); }
if (FC.json.total_weight > 6) { FC.customFlatRates.update(26, 32); }
if (FC.json.total_weight > 7) { FC.customFlatRates.update(26, 35.5); }
if (FC.json.total_weight > 8) { FC.customFlatRates.update(26, 39); }
if (FC.json.total_weight > 9) { FC.customFlatRates.update(26, 40); }
if (FC.json.total_weight > 10) { FC.customFlatRates.update(26, 40); }
if (FC.json.total_weight > 11) { FC.customFlatRates.update(26, 40); }
if (FC.json.total_weight > 12) { FC.customFlatRates.update(26, 40); }
}
else if (address.country == "MK") {
FC.customFlatRates.add(29, 5, 'Irish Post', 'to Macedonia');
if (FC.json.total_weight > 0.25) { FC.customFlatRates.update(29, 6); }
if (FC.json.total_weight > 0.5) { FC.customFlatRates.update(29, 19.5); }
if (FC.json.total_weight > 1) { FC.customFlatRates.update(29, 25); }
if (FC.json.total_weight > 2) { FC.customFlatRates.update(29, 30); }
if (FC.json.total_weight > 3) { FC.customFlatRates.update(29, 36.5); }
if (FC.json.total_weight > 4) { FC.customFlatRates.update(29, 43); }
if (FC.json.total_weight > 5) { FC.customFlatRates.update(29, 49.5); }
if (FC.json.total_weight > 6) { FC.customFlatRates.update(29, 55); }
if (FC.json.total_weight > 7) { FC.customFlatRates.update(29, 61.5); }
if (FC.json.total_weight > 8) { FC.customFlatRates.update(29, 68); }
if (FC.json.total_weight > 9) { FC.customFlatRates.update(29, 74.5); }
if (FC.json.total_weight > 10) { FC.customFlatRates.update(29, 81); }
if (FC.json.total_weight > 11) { FC.customFlatRates.update(29, 87.5); }
if (FC.json.total_weight > 12) { FC.customFlatRates.update(29, 95); }
}
else if (address.country == "MT") {
FC.customFlatRates.add(30, 5, 'Irish Post', 'to Malta');
if (FC.json.total_weight > 0.25) { FC.customFlatRates.update(30, 6); }
if (FC.json.total_weight > 0.5) { FC.customFlatRates.update(30, 12.5); }
if (FC.json.total_weight > 1) { FC.customFlatRates.update(30, 15.5); }
if (FC.json.total_weight > 2) { FC.customFlatRates.update(30, 18.5); }
if (FC.json.total_weight > 3) { FC.customFlatRates.update(30, 24); }
if (FC.json.total_weight > 4) { FC.customFlatRates.update(30, 29.5); }
if (FC.json.total_weight > 5) { FC.customFlatRates.update(30, 35); }
if (FC.json.total_weight > 6) { FC.customFlatRates.update(30, 40.5); }
if (FC.json.total_weight > 7) { FC.customFlatRates.update(30, 46); }
if (FC.json.total_weight > 8) { FC.customFlatRates.update(30, 51.5); }
if (FC.json.total_weight > 9) { FC.customFlatRates.update(30, 57); }
if (FC.json.total_weight > 10) { FC.customFlatRates.update(30, 62.5); }
if (FC.json.total_weight > 11) { FC.customFlatRates.update(30, 68); }
if (FC.json.total_weight > 12) { FC.customFlatRates.update(30, 73.5); }
}
else if (address.country == "NG") {
FC.customFlatRates.add(51, 5, 'Irish Post', 'to Nigeria');
if (FC.json.total_weight > 0.25) { FC.customFlatRates.update(51, 6); }
if (FC.json.total_weight > 0.5) { FC.customFlatRates.update(51, 20); }
if (FC.json.total_weight > 1) { FC.customFlatRates.update(51, 25); }
if (FC.json.total_weight > 2) { FC.customFlatRates.update(51, 30); }
if (FC.json.total_weight > 3) { FC.customFlatRates.update(51, 35); }
if (FC.json.total_weight > 4) { FC.customFlatRates.update(51, 40); }
if (FC.json.total_weight > 5) { FC.customFlatRates.update(51, 45); }
if (FC.json.total_weight > 6) { FC.customFlatRates.update(51, 50); }
if (FC.json.total_weight > 7) { FC.customFlatRates.update(51, 55); }
if (FC.json.total_weight > 8) { FC.customFlatRates.update(51, 60); }
if (FC.json.total_weight > 9) { FC.customFlatRates.update(51, 65); }
if (FC.json.total_weight > 10) { FC.customFlatRates.update(51, 70); }
if (FC.json.total_weight > 11) { FC.customFlatRates.update(51, 75); }
if (FC.json.total_weight > 12) { FC.customFlatRates.update(51, 80); }
}
if (address.postal_code.indexOf("BT") === 0) {
FC.customFlatRates.add(58, 2.5, 'Irish Post', 'to Northern Ireland');
if (FC.json.total_weight > 0.25) { FC.customFlatRates.update(58, 4.5); }
if (FC.json.total_weight > 0.5) { FC.customFlatRates.update(58, 7.5); }
if (FC.json.total_weight > 1) { FC.customFlatRates.update(58, 7.5); }
if (FC.json.total_weight > 2) { FC.customFlatRates.update(58, 7.5); }
if (FC.json.total_weight > 3) { FC.customFlatRates.update(58, 7.5); }
if (FC.json.total_weight > 4) { FC.customFlatRates.update(58, 7.5); }
if (FC.json.total_weight > 5) { FC.customFlatRates.update(58, 8.5); }
if (FC.json.total_weight > 6) { FC.customFlatRates.update(58, 8.5); }
if (FC.json.total_weight > 7) { FC.customFlatRates.update(58, 8.5); }
if (FC.json.total_weight > 8) { FC.customFlatRates.update(58, 8.5); }
if (FC.json.total_weight > 9) { FC.customFlatRates.update(58, 8.5); }
if (FC.json.total_weight > 10) { FC.customFlatRates.update(58, 12.5); }
if (FC.json.total_weight > 11) { FC.customFlatRates.update(58, 12.5); }
if (FC.json.total_weight > 12) { FC.customFlatRates.update(58, 15); }
}
else if (address.country == "NL") {
FC.customFlatRates.add(43, 5, 'Irish Post', 'to The Netherlands');
if (FC.json.total_weight > 0.25) { FC.customFlatRates.update(43, 6); }
if (FC.json.total_weight > 0.5) { FC.customFlatRates.update(43, 8.5); }
if (FC.json.total_weight > 1) { FC.customFlatRates.update(43, 11.5); }
if (FC.json.total_weight > 2) { FC.customFlatRates.update(43, 14); }
if (FC.json.total_weight > 3) { FC.customFlatRates.update(43, 16.5); }
if (FC.json.total_weight > 4) { FC.customFlatRates.update(43, 19); }
if (FC.json.total_weight > 5) { FC.customFlatRates.update(43, 21.5); }
if (FC.json.total_weight > 6) { FC.customFlatRates.update(43, 24); }
if (FC.json.total_weight > 7) { FC.customFlatRates.update(43, 26.5); }
if (FC.json.total_weight > 8) { FC.customFlatRates.update(43, 29); }
if (FC.json.total_weight > 9) { FC.customFlatRates.update(43, 31.5); }
if (FC.json.total_weight > 10) { FC.customFlatRates.update(43, 34); }
if (FC.json.total_weight > 11) { FC.customFlatRates.update(43, 36.5); }
if (FC.json.total_weight > 12) { FC.customFlatRates.update(43, 39); }
}
else if (address.country == "NO") {
FC.customFlatRates.add(31, 5, 'Irish Post', 'to Norway');
if (FC.json.total_weight > 0.25) { FC.customFlatRates.update(31, 6); }
if (FC.json.total_weight > 0.5) { FC.customFlatRates.update(31, 13.5); }
if (FC.json.total_weight > 1) { FC.customFlatRates.update(31, 20); }
if (FC.json.total_weight > 2) { FC.customFlatRates.update(31, 24); }
if (FC.json.total_weight > 3) { FC.customFlatRates.update(31, 27.5); }
if (FC.json.total_weight > 4) { FC.customFlatRates.update(31, 30); }
if (FC.json.total_weight > 5) { FC.customFlatRates.update(31, 33); }
if (FC.json.total_weight > 6) { FC.customFlatRates.update(31, 36); }
if (FC.json.total_weight > 7) { FC.customFlatRates.update(31, 39); }
if (FC.json.total_weight > 8) { FC.customFlatRates.update(31, 42); }
if (FC.json.total_weight > 9) { FC.customFlatRates.update(31, 45); }
if (FC.json.total_weight > 10) { FC.customFlatRates.update(31, 45); }
if (FC.json.total_weight > 11) { FC.customFlatRates.update(31, 48); }
if (FC.json.total_weight > 12) { FC.customFlatRates.update(31, 50); }
}
else if (address.country == "NZ") {
FC.customFlatRates.add(50, 5, 'Irish Post', 'to New Zealand');
if (FC.json.total_weight > 0.25) { FC.customFlatRates.update(50, 6); }
if (FC.json.total_weight > 0.5) { FC.customFlatRates.update(50, 30); }
if (FC.json.total_weight > 1) { FC.customFlatRates.update(50, 49.5); }
if (FC.json.total_weight > 2) { FC.customFlatRates.update(50, 69.5); }
if (FC.json.total_weight > 3) { FC.customFlatRates.update(50, 89.5); }
if (FC.json.total_weight > 4) { FC.customFlatRates.update(50, 109.5); }
if (FC.json.total_weight > 5) { FC.customFlatRates.update(50, 129.5); }
if (FC.json.total_weight > 6) { FC.customFlatRates.update(50, 149.5); }
if (FC.json.total_weight > 7) { FC.customFlatRates.update(50, 169.5); }
if (FC.json.total_weight > 8) { FC.customFlatRates.update(50, 189.5); }
if (FC.json.total_weight > 9) { FC.customFlatRates.update(50, 209.5); }
if (FC.json.total_weight > 10) { FC.customFlatRates.update(50, 229.5); }
if (FC.json.total_weight > 11) { FC.customFlatRates.update(50, 249.5); }
if (FC.json.total_weight > 12) { FC.customFlatRates.update(50, 269.5); }
}
else if (address.country == "PH") {
FC.customFlatRates.add(52, 5, 'Irish Post', 'to Philippines');
if (FC.json.total_weight > 0.25) { FC.customFlatRates.update(52, 6); }
if (FC.json.total_weight > 0.5) { FC.customFlatRates.update(52, 20); }
if (FC.json.total_weight > 1) { FC.customFlatRates.update(52, 25); }
if (FC.json.total_weight > 2) { FC.customFlatRates.update(52, 30); }
if (FC.json.total_weight > 3) { FC.customFlatRates.update(52, 37.5); }
if (FC.json.total_weight > 4) { FC.customFlatRates.update(52, 42.5); }
if (FC.json.total_weight > 5) { FC.customFlatRates.update(52, 47.5); }
if (FC.json.total_weight > 6) { FC.customFlatRates.update(52, 52.5); }
if (FC.json.total_weight > 7) { FC.customFlatRates.update(52, 57.5); }
if (FC.json.total_weight > 8) { FC.customFlatRates.update(52, 62.5); }
if (FC.json.total_weight > 9) { FC.customFlatRates.update(52, 67.5); }
if (FC.json.total_weight > 10) { FC.customFlatRates.update(52, 72.5); }
if (FC.json.total_weight > 11) { FC.customFlatRates.update(52, 80); }
if (FC.json.total_weight > 12) { FC.customFlatRates.update(52, 85); }
}
else if (address.country == "PL") {
FC.customFlatRates.add(32, 5, 'Irish Post', 'to Poland');
if (FC.json.total_weight > 0.25) { FC.customFlatRates.update(32, 6); }
if (FC.json.total_weight > 0.5) { FC.customFlatRates.update(32, 10); }
if (FC.json.total_weight > 1) { FC.customFlatRates.update(32, 14); }
if (FC.json.total_weight > 2) { FC.customFlatRates.update(32, 17.5); }
if (FC.json.total_weight > 3) { FC.customFlatRates.update(32, 21); }
if (FC.json.total_weight > 4) { FC.customFlatRates.update(32, 24.5); }
if (FC.json.total_weight > 5) { FC.customFlatRates.update(32, 28); }
if (FC.json.total_weight > 6) { FC.customFlatRates.update(32, 31.5); }
if (FC.json.total_weight > 7) { FC.customFlatRates.update(32, 35); }
if (FC.json.total_weight > 8) { FC.customFlatRates.update(32, 38.5); }
if (FC.json.total_weight > 9) { FC.customFlatRates.update(32, 42); }
if (FC.json.total_weight > 10) { FC.customFlatRates.update(32, 45.5); }
if (FC.json.total_weight > 11) { FC.customFlatRates.update(32, 49); }
if (FC.json.total_weight > 12) { FC.customFlatRates.update(32, 52.5); }
}
else if (address.country == "PT") {
FC.customFlatRates.add(33, 5, 'Irish Post', 'to Portugal');
if (FC.json.total_weight > 0.25) { FC.customFlatRates.update(33, 6); }
if (FC.json.total_weight > 0.5) { FC.customFlatRates.update(33, 10.5); }
if (FC.json.total_weight > 1) { FC.customFlatRates.update(33, 14); }
if (FC.json.total_weight > 2) { FC.customFlatRates.update(33, 17.5); }
if (FC.json.total_weight > 3) { FC.customFlatRates.update(33, 21); }
if (FC.json.total_weight > 4) { FC.customFlatRates.update(33, 24.5); }
if (FC.json.total_weight > 5) { FC.customFlatRates.update(33, 28); }
if (FC.json.total_weight > 6) { FC.customFlatRates.update(33, 31.5); }
if (FC.json.total_weight > 7) { FC.customFlatRates.update(33, 35); }
if (FC.json.total_weight > 8) { FC.customFlatRates.update(33, 38.5); }
if (FC.json.total_weight > 9) { FC.customFlatRates.update(33, 42); }
if (FC.json.total_weight > 10) { FC.customFlatRates.update(33, 45.5); }
if (FC.json.total_weight > 11) { FC.customFlatRates.update(33, 49); }
if (FC.json.total_weight > 12) { FC.customFlatRates.update(33, 52.5); }
}
else if (address.country == "RO") {
FC.customFlatRates.add(34, 5, 'Irish Post', 'to Romania');
if (FC.json.total_weight > 0.25) { FC.customFlatRates.update(34, 6); }
if (FC.json.total_weight > 0.5) { FC.customFlatRates.update(34, 8.5); }
if (FC.json.total_weight > 1) { FC.customFlatRates.update(34, 20); }
if (FC.json.total_weight > 2) { FC.customFlatRates.update(34, 22); }
if (FC.json.total_weight > 3) { FC.customFlatRates.update(34, 24); }
if (FC.json.total_weight > 4) { FC.customFlatRates.update(34, 26); }
if (FC.json.total_weight > 5) { FC.customFlatRates.update(34, 28); }
if (FC.json.total_weight > 6) { FC.customFlatRates.update(34, 30); }
if (FC.json.total_weight > 7) { FC.customFlatRates.update(34, 32); }
if (FC.json.total_weight > 8) { FC.customFlatRates.update(34, 34); }
if (FC.json.total_weight > 9) { FC.customFlatRates.update(34, 36); }
if (FC.json.total_weight > 10) { FC.customFlatRates.update(34, 38); }
if (FC.json.total_weight > 11) { FC.customFlatRates.update(34, 40); }
if (FC.json.total_weight > 12) { FC.customFlatRates.update(34, 40); }
}
else if (address.country == "RS") {
FC.customFlatRates.add(36, 5, 'Irish Post', 'to Serbia');
if (FC.json.total_weight > 0.25) { FC.customFlatRates.update(36, 6); }
if (FC.json.total_weight > 0.5) { FC.customFlatRates.update(36, 16.5); }
if (FC.json.total_weight > 1) { FC.customFlatRates.update(36, 20.5); }
if (FC.json.total_weight > 2) { FC.customFlatRates.update(36, 24.5); }
if (FC.json.total_weight > 3) { FC.customFlatRates.update(36, 28.5); }
if (FC.json.total_weight > 4) { FC.customFlatRates.update(36, 32.5); }
if (FC.json.total_weight > 5) { FC.customFlatRates.update(36, 36.5); }
if (FC.json.total_weight > 6) { FC.customFlatRates.update(36, 40.5); }
if (FC.json.total_weight > 7) { FC.customFlatRates.update(36, 44.5); }
if (FC.json.total_weight > 8) { FC.customFlatRates.update(36, 48.5); }
if (FC.json.total_weight > 9) { FC.customFlatRates.update(36, 52.5); }
if (FC.json.total_weight > 10) { FC.customFlatRates.update(36, 56.5); }
if (FC.json.total_weight > 11) { FC.customFlatRates.update(36, 60.5); }
if (FC.json.total_weight > 12) { FC.customFlatRates.update(36, 64.5); }
}
else if (address.country == "RU") {
FC.customFlatRates.add(35, 5, 'Irish Post', 'to Russia');
if (FC.json.total_weight > 0.25) { FC.customFlatRates.update(35, 6); }
if (FC.json.total_weight > 0.5) { FC.customFlatRates.update(35, 8.5); }
if (FC.json.total_weight > 1) { FC.customFlatRates.update(35, 37.5); }
if (FC.json.total_weight > 2) { FC.customFlatRates.update(35, 40); }
if (FC.json.total_weight > 3) { FC.customFlatRates.update(35, 40); }
if (FC.json.total_weight > 4) { FC.customFlatRates.update(35, 40); }
if (FC.json.total_weight > 5) { FC.customFlatRates.update(35, 40); }
if (FC.json.total_weight > 6) { FC.customFlatRates.update(35, 40); }
if (FC.json.total_weight > 7) { FC.customFlatRates.update(35, 40); }
if (FC.json.total_weight > 8) { FC.customFlatRates.update(35, 40); }
if (FC.json.total_weight > 9) { FC.customFlatRates.update(35, 40); }
if (FC.json.total_weight > 10) { FC.customFlatRates.update(35, 40); }
if (FC.json.total_weight > 11) { FC.customFlatRates.update(35, 40); }
if (FC.json.total_weight > 12) { FC.customFlatRates.update(35, 40); }
}
else if (address.country == "SE") {
FC.customFlatRates.add(40, 5, 'Irish Post', 'to Sweden');
if (FC.json.total_weight > 0.25) { FC.customFlatRates.update(40, 6); }
if (FC.json.total_weight > 0.5) { FC.customFlatRates.update(40, 10.5); }
if (FC.json.total_weight > 1) { FC.customFlatRates.update(40, 14.5); }
if (FC.json.total_weight > 2) { FC.customFlatRates.update(40, 17.5); }
if (FC.json.total_weight > 3) { FC.customFlatRates.update(40, 21.5); }
if (FC.json.total_weight > 4) { FC.customFlatRates.update(40, 25.5); }
if (FC.json.total_weight > 5) { FC.customFlatRates.update(40, 29.5); }
if (FC.json.total_weight > 6) { FC.customFlatRates.update(40, 33.5); }
if (FC.json.total_weight > 7) { FC.customFlatRates.update(40, 37.5); }
if (FC.json.total_weight > 8) { FC.customFlatRates.update(40, 41.5); }
if (FC.json.total_weight > 9) { FC.customFlatRates.update(40, 44.5); }
if (FC.json.total_weight > 10) { FC.customFlatRates.update(40, 48); }
if (FC.json.total_weight > 11) { FC.customFlatRates.update(40, 52.5); }
if (FC.json.total_weight > 12) { FC.customFlatRates.update(40, 55); }
}
else if (address.country == "SI") {
FC.customFlatRates.add(38, 5, 'Irish Post', 'to Slovenia');
if (FC.json.total_weight > 0.25) { FC.customFlatRates.update(38, 6); }
if (FC.json.total_weight > 0.5) { FC.customFlatRates.update(38, 10.5); }
if (FC.json.total_weight > 1) { FC.customFlatRates.update(38, 13.5); }
if (FC.json.total_weight > 2) { FC.customFlatRates.update(38, 16.5); }
if (FC.json.total_weight > 3) { FC.customFlatRates.update(38, 20); }
if (FC.json.total_weight > 4) { FC.customFlatRates.update(38, 23.5); }
if (FC.json.total_weight > 5) { FC.customFlatRates.update(38, 27); }
if (FC.json.total_weight > 6) { FC.customFlatRates.update(38, 30.5); }
if (FC.json.total_weight > 7) { FC.customFlatRates.update(38, 34); }
if (FC.json.total_weight > 8) { FC.customFlatRates.update(38, 37.5); }
if (FC.json.total_weight > 9) { FC.customFlatRates.update(38, 41); }
if (FC.json.total_weight > 10) { FC.customFlatRates.update(38, 44.5); }
if (FC.json.total_weight > 11) { FC.customFlatRates.update(38, 48); }
if (FC.json.total_weight > 12) { FC.customFlatRates.update(38, 51.5); }
}
else if (address.country == "SK") {
FC.customFlatRates.add(37, 5, 'Irish Post', 'to Slovakia');
if (FC.json.total_weight > 0.25) { FC.customFlatRates.update(37, 6); }
if (FC.json.total_weight > 0.5) { FC.customFlatRates.update(37, 10.5); }
if (FC.json.total_weight > 1) { FC.customFlatRates.update(37, 14); }
if (FC.json.total_weight > 2) { FC.customFlatRates.update(37, 17.5); }
if (FC.json.total_weight > 3) { FC.customFlatRates.update(37, 21); }
if (FC.json.total_weight > 4) { FC.customFlatRates.update(37, 24.5); }
if (FC.json.total_weight > 5) { FC.customFlatRates.update(37, 28); }
if (FC.json.total_weight > 6) { FC.customFlatRates.update(37, 31.5); }
if (FC.json.total_weight > 7) { FC.customFlatRates.update(37, 35); }
if (FC.json.total_weight > 8) { FC.customFlatRates.update(37, 38.5); }
if (FC.json.total_weight > 9) { FC.customFlatRates.update(37, 42); }
if (FC.json.total_weight > 10) { FC.customFlatRates.update(37, 45.5); }
if (FC.json.total_weight > 11) { FC.customFlatRates.update(37, 49); }
if (FC.json.total_weight > 12) { FC.customFlatRates.update(37, 52.5); }
}
else if (address.country == "TR") {
FC.customFlatRates.add(42, 5, 'Irish Post', 'to Turkey');
if (FC.json.total_weight > 0.25) { FC.customFlatRates.update(42, 6); }
if (FC.json.total_weight > 0.5) { FC.customFlatRates.update(42, 20); }
if (FC.json.total_weight > 1) { FC.customFlatRates.update(42, 22.5); }
if (FC.json.total_weight > 2) { FC.customFlatRates.update(42, 25); }
if (FC.json.total_weight > 3) { FC.customFlatRates.update(42, 27.5); }
if (FC.json.total_weight > 4) { FC.customFlatRates.update(42, 30); }
if (FC.json.total_weight > 5) { FC.customFlatRates.update(42, 32.5); }
if (FC.json.total_weight > 6) { FC.customFlatRates.update(42, 35); }
if (FC.json.total_weight > 7) { FC.customFlatRates.update(42, 37.5); }
if (FC.json.total_weight > 8) { FC.customFlatRates.update(42, 40); }
if (FC.json.total_weight > 9) { FC.customFlatRates.update(42, 42.5); }
if (FC.json.total_weight > 10) { FC.customFlatRates.update(42, 45); }
if (FC.json.total_weight > 11) { FC.customFlatRates.update(42, 47.5); }
if (FC.json.total_weight > 12) { FC.customFlatRates.update(42, 50); }
}
else if (address.country == "US") {
FC.customFlatRates.add(56, 4.6, 'US Postal Service', '');
if (FC.json.total_weight > 0.25) { FC.customFlatRates.update(56, 4.6); }
if (FC.json.total_weight > 0.5) { FC.customFlatRates.update(56, 10); }
if (FC.json.total_weight > 1) { FC.customFlatRates.update(56, 15); }
if (FC.json.total_weight > 2) { FC.customFlatRates.update(56, 20); }
if (FC.json.total_weight > 3) { FC.customFlatRates.update(56, 25); }
if (FC.json.total_weight > 4) { FC.customFlatRates.update(56, 30); }
if (FC.json.total_weight > 5) { FC.customFlatRates.update(56, 35); }
if (FC.json.total_weight > 6) { FC.customFlatRates.update(56, 40); }
if (FC.json.total_weight > 7) { FC.customFlatRates.update(56, 45); }
if (FC.json.total_weight > 8) { FC.customFlatRates.update(56, 50); }
if (FC.json.total_weight > 9) { FC.customFlatRates.update(56, 55); }
if (FC.json.total_weight > 10) { FC.customFlatRates.update(56, 60); }
if (FC.json.total_weight > 11) { FC.customFlatRates.update(56, 65); }
if (FC.json.total_weight > 12) { FC.customFlatRates.update(56, 70); }
}
else if (address.country == "ZA") {
FC.customFlatRates.add(53, 5, 'Irish Post', 'to South Africa');
if (FC.json.total_weight > 0.25) { FC.customFlatRates.update(53, 6); }
if (FC.json.total_weight > 0.5) { FC.customFlatRates.update(53, 22.5); }
if (FC.json.total_weight > 1) { FC.customFlatRates.update(53, 32.5); }
if (FC.json.total_weight > 2) { FC.customFlatRates.update(53, 42.5); }
if (FC.json.total_weight > 3) { FC.customFlatRates.update(53, 52.5); }
if (FC.json.total_weight > 4) { FC.customFlatRates.update(53, 62.5); }
if (FC.json.total_weight > 5) { FC.customFlatRates.update(53, 72.5); }
if (FC.json.total_weight > 6) { FC.customFlatRates.update(53, 82.5); }
if (FC.json.total_weight > 7) { FC.customFlatRates.update(53, 92.5); }
if (FC.json.total_weight > 8) { FC.customFlatRates.update(53, 102.5); }
if (FC.json.total_weight > 9) { FC.customFlatRates.update(53, 112.5); }
if (FC.json.total_weight > 10) { FC.customFlatRates.update(53, 122.5); }
if (FC.json.total_weight > 11) { FC.customFlatRates.update(53, 132.5); }
if (FC.json.total_weight > 12) { FC.customFlatRates.update(53, 142.5); }
}
else if (address.country == "ZZ") {
FC.customFlatRates.add(7, 5, 'Irish Post', 'to Rest of the World');
if (FC.json.total_weight > 0.25) { FC.customFlatRates.update(7, 6); }
if (FC.json.total_weight > 0.5) { FC.customFlatRates.update(7, 20); }
if (FC.json.total_weight > 1) { FC.customFlatRates.update(7, 25); }
if (FC.json.total_weight > 2) { FC.customFlatRates.update(7, 40.5); }
if (FC.json.total_weight > 3) { FC.customFlatRates.update(7, 60); }
if (FC.json.total_weight > 4) { FC.customFlatRates.update(7, 65); }
if (FC.json.total_weight > 5) { FC.customFlatRates.update(7, 70); }
if (FC.json.total_weight > 6) { FC.customFlatRates.update(7, 75); }
if (FC.json.total_weight > 7) { FC.customFlatRates.update(7, 75); }
if (FC.json.total_weight > 8) { FC.customFlatRates.update(7, 80); }
if (FC.json.total_weight > 9) { FC.customFlatRates.update(7, 85); }
if (FC.json.total_weight > 10) { FC.customFlatRates.update(7, 90); }
if (FC.json.total_weight > 11) { FC.customFlatRates.update(7, 95); }
if (FC.json.total_weight > 12) { FC.customFlatRates.update(7, 100); }
}



/* END CUSTOM SHIPPING LOGIC ******************************************************/