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 *****************************************************/


if (address.country == "AE") {
FC.customFlatRates.add(54, 5.00, 'Irish Post', 'to United Arab Emirates');
if (FC.json.total_weight > 0.25) { FC.customFlatRates.update(54, 6.00); }
if (FC.json.total_weight > 0.5) { FC.customFlatRates.update(54, 11.55); }
if (FC.json.total_weight > 1) { FC.customFlatRates.update(54, 19.00); }
if (FC.json.total_weight > 2) { FC.customFlatRates.update(54, 21.50); }
if (FC.json.total_weight > 3) { FC.customFlatRates.update(54, 23.00); }
if (FC.json.total_weight > 4) { FC.customFlatRates.update(54, 25.50); }
if (FC.json.total_weight > 5) { FC.customFlatRates.update(54, 28.00); }
if (FC.json.total_weight > 6) { FC.customFlatRates.update(54, 30.50); }
if (FC.json.total_weight > 7) { FC.customFlatRates.update(54, 33.00); }
if (FC.json.total_weight > 8) { FC.customFlatRates.update(54, 35.50); }
if (FC.json.total_weight > 9) { FC.customFlatRates.update(54, 38.00); }
if (FC.json.total_weight > 10) { FC.customFlatRates.update(54, 40.00); }
if (FC.json.total_weight > 11) { FC.customFlatRates.update(54, 40.00); }
if (FC.json.total_weight > 12) { FC.customFlatRates.update(54, 40.00); }
}
else if (address.country == "AT") {
FC.customFlatRates.add(9, 5.00, 'Irish Post', 'to Austria');
if (FC.json.total_weight > 0.25) { FC.customFlatRates.update(9, 6.00); }
if (FC.json.total_weight > 0.5) { FC.customFlatRates.update(9, 8.50); }
if (FC.json.total_weight > 1) { FC.customFlatRates.update(9, 12.50); }
if (FC.json.total_weight > 2) { FC.customFlatRates.update(9, 14.00); }
if (FC.json.total_weight > 3) { FC.customFlatRates.update(9, 17.00); }
if (FC.json.total_weight > 4) { FC.customFlatRates.update(9, 18.50); }
if (FC.json.total_weight > 5) { FC.customFlatRates.update(9, 20.00); }
if (FC.json.total_weight > 6) { FC.customFlatRates.update(9, 21.50); }
if (FC.json.total_weight > 7) { FC.customFlatRates.update(9, 23.00); }
if (FC.json.total_weight > 8) { FC.customFlatRates.update(9, 24.50); }
if (FC.json.total_weight > 9) { FC.customFlatRates.update(9, 26.00); }
if (FC.json.total_weight > 10) { FC.customFlatRates.update(9, 27.50); }
if (FC.json.total_weight > 11) { FC.customFlatRates.update(9, 29.00); }
if (FC.json.total_weight > 12) { FC.customFlatRates.update(9, 30.50); }
}
else if (address.country == "AU") {
FC.customFlatRates.add(44, 5.00, 'Irish Post', 'to Australia');
if (FC.json.total_weight > 0.25) { FC.customFlatRates.update(44, 6.00); }
if (FC.json.total_weight > 0.5) { FC.customFlatRates.update(44, 11.55); }
if (FC.json.total_weight > 1) { FC.customFlatRates.update(44, 20.00); }
if (FC.json.total_weight > 2) { FC.customFlatRates.update(44, 29.45); }
if (FC.json.total_weight > 3) { FC.customFlatRates.update(44, 38.90); }
if (FC.json.total_weight > 4) { FC.customFlatRates.update(44, 40.00); }
if (FC.json.total_weight > 5) { FC.customFlatRates.update(44, 40.00); }
if (FC.json.total_weight > 6) { FC.customFlatRates.update(44, 40.00); }
if (FC.json.total_weight > 7) { FC.customFlatRates.update(44, 40.00); }
if (FC.json.total_weight > 8) { FC.customFlatRates.update(44, 40.00); }
if (FC.json.total_weight > 9) { FC.customFlatRates.update(44, 40.00); }
if (FC.json.total_weight > 10) { FC.customFlatRates.update(44, 40.00); }
if (FC.json.total_weight > 11) { FC.customFlatRates.update(44, 40.00); }
if (FC.json.total_weight > 12) { FC.customFlatRates.update(44, 40.00); }
}
else if (address.country == "BA") {
FC.customFlatRates.add(12, 5.00, 'Irish Post', 'to Bosnia & Herzegovina');
if (FC.json.total_weight > 0.25) { FC.customFlatRates.update(12, 6.00); }
if (FC.json.total_weight > 0.5) { FC.customFlatRates.update(12, 8.50); }
if (FC.json.total_weight > 1) { FC.customFlatRates.update(12, 16.00); }
if (FC.json.total_weight > 2) { FC.customFlatRates.update(12, 18.00); }
if (FC.json.total_weight > 3) { FC.customFlatRates.update(12, 20.00); }
if (FC.json.total_weight > 4) { FC.customFlatRates.update(12, 22.00); }
if (FC.json.total_weight > 5) { FC.customFlatRates.update(12, 24.00); }
if (FC.json.total_weight > 6) { FC.customFlatRates.update(12, 26.00); }
if (FC.json.total_weight > 7) { FC.customFlatRates.update(12, 28.00); }
if (FC.json.total_weight > 8) { FC.customFlatRates.update(12, 30.00); }
if (FC.json.total_weight > 9) { FC.customFlatRates.update(12, 32.00); }
if (FC.json.total_weight > 10) { FC.customFlatRates.update(12, 34.00); }
if (FC.json.total_weight > 11) { FC.customFlatRates.update(12, 36.00); }
if (FC.json.total_weight > 12) { FC.customFlatRates.update(12, 38.00); }
}
else if (address.country == "BE") {
FC.customFlatRates.add(11, 5.00, 'Irish Post', 'to Belgium');
if (FC.json.total_weight > 0.25) { FC.customFlatRates.update(11, 6.00); }
if (FC.json.total_weight > 0.5) { FC.customFlatRates.update(11, 8.50); }
if (FC.json.total_weight > 1) { FC.customFlatRates.update(11, 10.00); }
if (FC.json.total_weight > 2) { FC.customFlatRates.update(11, 11.00); }
if (FC.json.total_weight > 3) { FC.customFlatRates.update(11, 12.00); }
if (FC.json.total_weight > 4) { FC.customFlatRates.update(11, 13.00); }
if (FC.json.total_weight > 5) { FC.customFlatRates.update(11, 14.00); }
if (FC.json.total_weight > 6) { FC.customFlatRates.update(11, 15.00); }
if (FC.json.total_weight > 7) { FC.customFlatRates.update(11, 16.00); }
if (FC.json.total_weight > 8) { FC.customFlatRates.update(11, 17.00); }
if (FC.json.total_weight > 9) { FC.customFlatRates.update(11, 18.00); }
if (FC.json.total_weight > 10) { FC.customFlatRates.update(11, 19.00); }
if (FC.json.total_weight > 11) { FC.customFlatRates.update(11, 20.00); }
if (FC.json.total_weight > 12) { FC.customFlatRates.update(11, 20.00); }
}
else if (address.country == "BG") {
FC.customFlatRates.add(13, 5.00, 'Irish Post', 'to Bulgaria');
if (FC.json.total_weight > 0.25) { FC.customFlatRates.update(13, 6.00); }
if (FC.json.total_weight > 0.5) { FC.customFlatRates.update(13, 8.50); }
if (FC.json.total_weight > 1) { FC.customFlatRates.update(13, 12.50); }
if (FC.json.total_weight > 2) { FC.customFlatRates.update(13, 13.50); }
if (FC.json.total_weight > 3) { FC.customFlatRates.update(13, 14.50); }
if (FC.json.total_weight > 4) { FC.customFlatRates.update(13, 15.50); }
if (FC.json.total_weight > 5) { FC.customFlatRates.update(13, 16.50); }
if (FC.json.total_weight > 6) { FC.customFlatRates.update(13, 17.50); }
if (FC.json.total_weight > 7) { FC.customFlatRates.update(13, 18.50); }
if (FC.json.total_weight > 8) { FC.customFlatRates.update(13, 19.50); }
if (FC.json.total_weight > 9) { FC.customFlatRates.update(13, 20.50); }
if (FC.json.total_weight > 10) { FC.customFlatRates.update(13, 21.50); }
if (FC.json.total_weight > 11) { FC.customFlatRates.update(13, 22.50); }
if (FC.json.total_weight > 12) { FC.customFlatRates.update(13, 23.50); }
}
else if (address.country == "BR") {
FC.customFlatRates.add(45, 5.00, 'Irish Post', 'to Brazil');
if (FC.json.total_weight > 0.25) { FC.customFlatRates.update(45, 6.00); }
if (FC.json.total_weight > 0.5) { FC.customFlatRates.update(45, 11.55); }
if (FC.json.total_weight > 1) { FC.customFlatRates.update(45, 17.50); }
if (FC.json.total_weight > 2) { FC.customFlatRates.update(45, 20.00); }
if (FC.json.total_weight > 3) { FC.customFlatRates.update(45, 22.50); }
if (FC.json.total_weight > 4) { FC.customFlatRates.update(45, 25.00); }
if (FC.json.total_weight > 5) { FC.customFlatRates.update(45, 27.50); }
if (FC.json.total_weight > 6) { FC.customFlatRates.update(45, 30.00); }
if (FC.json.total_weight > 7) { FC.customFlatRates.update(45, 32.50); }
if (FC.json.total_weight > 8) { FC.customFlatRates.update(45, 35.00); }
if (FC.json.total_weight > 9) { FC.customFlatRates.update(45, 37.50); }
if (FC.json.total_weight > 10) { FC.customFlatRates.update(45, 40.00); }
if (FC.json.total_weight > 11) { FC.customFlatRates.update(45, 40.00); }
if (FC.json.total_weight > 12) { FC.customFlatRates.update(45, 40.00); }
}
else if (address.country == "CA") {
FC.customFlatRates.add(55, 9.40, 'Irish Post', 'to Canada');
if (FC.json.total_weight > 0.25) { FC.customFlatRates.update(55, 9.40); }
if (FC.json.total_weight > 0.5) { FC.customFlatRates.update(55, 9.40); }
if (FC.json.total_weight > 1) { FC.customFlatRates.update(55, 12.40); }
if (FC.json.total_weight > 2) { FC.customFlatRates.update(55, 15.40); }
if (FC.json.total_weight > 3) { FC.customFlatRates.update(55, 18.40); }
if (FC.json.total_weight > 4) { FC.customFlatRates.update(55, 21.40); }
if (FC.json.total_weight > 5) { FC.customFlatRates.update(55, 24.40); }
if (FC.json.total_weight > 6) { FC.customFlatRates.update(55, 27.40); }
if (FC.json.total_weight > 7) { FC.customFlatRates.update(55, 30.40); }
if (FC.json.total_weight > 8) { FC.customFlatRates.update(55, 33.40); }
if (FC.json.total_weight > 9) { FC.customFlatRates.update(55, 36.40); }
if (FC.json.total_weight > 10) { FC.customFlatRates.update(55, 39.40); }
if (FC.json.total_weight > 11) { FC.customFlatRates.update(55, 40.00); }
if (FC.json.total_weight > 12) { FC.customFlatRates.update(55, 40.00); }
}
else if (address.country == "CH") {
FC.customFlatRates.add(41, 5.00, 'Irish Post', 'to Switzerland');
if (FC.json.total_weight > 0.25) { FC.customFlatRates.update(41, 6.00); }
if (FC.json.total_weight > 0.5) { FC.customFlatRates.update(41, 8.50); }
if (FC.json.total_weight > 1) { FC.customFlatRates.update(41, 13.50); }
if (FC.json.total_weight > 2) { FC.customFlatRates.update(41, 14.50); }
if (FC.json.total_weight > 3) { FC.customFlatRates.update(41, 15.50); }
if (FC.json.total_weight > 4) { FC.customFlatRates.update(41, 16.50); }
if (FC.json.total_weight > 5) { FC.customFlatRates.update(41, 17.50); }
if (FC.json.total_weight > 6) { FC.customFlatRates.update(41, 18.50); }
if (FC.json.total_weight > 7) { FC.customFlatRates.update(41, 19.50); }
if (FC.json.total_weight > 8) { FC.customFlatRates.update(41, 20.50); }
if (FC.json.total_weight > 9) { FC.customFlatRates.update(41, 21.50); }
if (FC.json.total_weight > 10) { FC.customFlatRates.update(41, 22.50); }
if (FC.json.total_weight > 11) { FC.customFlatRates.update(41, 23.50); }
if (FC.json.total_weight > 12) { FC.customFlatRates.update(41, 24.50); }
}
else if (address.country == "CN") {
FC.customFlatRates.add(46, 5.00, 'Irish Post', 'to China');
if (FC.json.total_weight > 0.25) { FC.customFlatRates.update(46, 6.00); }
if (FC.json.total_weight > 0.5) { FC.customFlatRates.update(46, 11.55); }
if (FC.json.total_weight > 1) { FC.customFlatRates.update(46, 12.50); }
if (FC.json.total_weight > 2) { FC.customFlatRates.update(46, 15.25); }
if (FC.json.total_weight > 3) { FC.customFlatRates.update(46, 18.00); }
if (FC.json.total_weight > 4) { FC.customFlatRates.update(46, 20.75); }
if (FC.json.total_weight > 5) { FC.customFlatRates.update(46, 23.50); }
if (FC.json.total_weight > 6) { FC.customFlatRates.update(46, 26.25); }
if (FC.json.total_weight > 7) { FC.customFlatRates.update(46, 29.00); }
if (FC.json.total_weight > 8) { FC.customFlatRates.update(46, 31.75); }
if (FC.json.total_weight > 9) { FC.customFlatRates.update(46, 34.50); }
if (FC.json.total_weight > 10) { FC.customFlatRates.update(46, 37.25); }
if (FC.json.total_weight > 11) { FC.customFlatRates.update(46, 40.00); }
if (FC.json.total_weight > 12) { FC.customFlatRates.update(46, 40.00); }
}
else if (address.country == "CY") {
FC.customFlatRates.add(15, 5.00, 'Irish Post', 'to Cyprus');
if (FC.json.total_weight > 0.25) { FC.customFlatRates.update(15, 6.00); }
if (FC.json.total_weight > 0.5) { FC.customFlatRates.update(15, 8.50); }
if (FC.json.total_weight > 1) { FC.customFlatRates.update(15, 16.50); }
if (FC.json.total_weight > 2) { FC.customFlatRates.update(15, 17.50); }
if (FC.json.total_weight > 3) { FC.customFlatRates.update(15, 18.50); }
if (FC.json.total_weight > 4) { FC.customFlatRates.update(15, 19.50); }
if (FC.json.total_weight > 5) { FC.customFlatRates.update(15, 20.50); }
if (FC.json.total_weight > 6) { FC.customFlatRates.update(15, 21.50); }
if (FC.json.total_weight > 7) { FC.customFlatRates.update(15, 22.50); }
if (FC.json.total_weight > 8) { FC.customFlatRates.update(15, 53.50); }
if (FC.json.total_weight > 9) { FC.customFlatRates.update(15, 24.50); }
if (FC.json.total_weight > 10) { FC.customFlatRates.update(15, 25.50); }
if (FC.json.total_weight > 11) { FC.customFlatRates.update(15, 26.50); }
if (FC.json.total_weight > 12) { FC.customFlatRates.update(15, 27.50); }
}
else if (address.country == "CZ") {
FC.customFlatRates.add(16, 5.00, 'Irish Post', 'to Czech Republic');
if (FC.json.total_weight > 0.25) { FC.customFlatRates.update(16, 6.00); }
if (FC.json.total_weight > 0.5) { FC.customFlatRates.update(16, 8.50); }
if (FC.json.total_weight > 1) { FC.customFlatRates.update(16, 13.50); }
if (FC.json.total_weight > 2) { FC.customFlatRates.update(16, 15.25); }
if (FC.json.total_weight > 3) { FC.customFlatRates.update(16, 17.00); }
if (FC.json.total_weight > 4) { FC.customFlatRates.update(16, 18.75); }
if (FC.json.total_weight > 5) { FC.customFlatRates.update(16, 20.50); }
if (FC.json.total_weight > 6) { FC.customFlatRates.update(16, 22.25); }
if (FC.json.total_weight > 7) { FC.customFlatRates.update(16, 24.00); }
if (FC.json.total_weight > 8) { FC.customFlatRates.update(16, 25.75); }
if (FC.json.total_weight > 9) { FC.customFlatRates.update(16, 27.50); }
if (FC.json.total_weight > 10) { FC.customFlatRates.update(16, 29.25); }
if (FC.json.total_weight > 11) { FC.customFlatRates.update(16, 31.00); }
if (FC.json.total_weight > 12) { FC.customFlatRates.update(16, 32.75); }
}
else if (address.country == "DE") {
FC.customFlatRates.add(21, 5.00, 'Irish Post', 'to Germany');
if (FC.json.total_weight > 0.25) { FC.customFlatRates.update(21, 6.00); }
if (FC.json.total_weight > 0.5) { FC.customFlatRates.update(21, 8.50); }
if (FC.json.total_weight > 1) { FC.customFlatRates.update(21, 10.00); }
if (FC.json.total_weight > 2) { FC.customFlatRates.update(21, 11.50); }
if (FC.json.total_weight > 3) { FC.customFlatRates.update(21, 13.00); }
if (FC.json.total_weight > 4) { FC.customFlatRates.update(21, 14.50); }
if (FC.json.total_weight > 5) { FC.customFlatRates.update(21, 16.00); }
if (FC.json.total_weight > 6) { FC.customFlatRates.update(21, 17.50); }
if (FC.json.total_weight > 7) { FC.customFlatRates.update(21, 19.00); }
if (FC.json.total_weight > 8) { FC.customFlatRates.update(21, 20.50); }
if (FC.json.total_weight > 9) { FC.customFlatRates.update(21, 22.00); }
if (FC.json.total_weight > 10) { FC.customFlatRates.update(21, 23.50); }
if (FC.json.total_weight > 11) { FC.customFlatRates.update(21, 25.00); }
if (FC.json.total_weight > 12) { FC.customFlatRates.update(21, 26.50); }
}
else if (address.country == "DK") {
FC.customFlatRates.add(17, 5.00, 'Irish Post', 'to Denmark');
if (FC.json.total_weight > 0.25) { FC.customFlatRates.update(17, 6.00); }
if (FC.json.total_weight > 0.5) { FC.customFlatRates.update(17, 8.50); }
if (FC.json.total_weight > 1) { FC.customFlatRates.update(17, 10.00); }
if (FC.json.total_weight > 2) { FC.customFlatRates.update(17, 11.50); }
if (FC.json.total_weight > 3) { FC.customFlatRates.update(17, 13.00); }
if (FC.json.total_weight > 4) { FC.customFlatRates.update(17, 14.50); }
if (FC.json.total_weight > 5) { FC.customFlatRates.update(17, 16.00); }
if (FC.json.total_weight > 6) { FC.customFlatRates.update(17, 17.50); }
if (FC.json.total_weight > 7) { FC.customFlatRates.update(17, 19.00); }
if (FC.json.total_weight > 8) { FC.customFlatRates.update(17, 20.50); }
if (FC.json.total_weight > 9) { FC.customFlatRates.update(17, 22.00); }
if (FC.json.total_weight > 10) { FC.customFlatRates.update(17, 23.50); }
if (FC.json.total_weight > 11) { FC.customFlatRates.update(17, 25.00); }
if (FC.json.total_weight > 12) { FC.customFlatRates.update(17, 26.50); }
}
else if (address.country == "EE") {
FC.customFlatRates.add(18, 5.00, 'Irish Post', 'to Estonia');
if (FC.json.total_weight > 0.25) { FC.customFlatRates.update(18, 6.00); }
if (FC.json.total_weight > 0.5) { FC.customFlatRates.update(18, 8.50); }
if (FC.json.total_weight > 1) { FC.customFlatRates.update(18, 14.00); }
if (FC.json.total_weight > 2) { FC.customFlatRates.update(18, 16.50); }
if (FC.json.total_weight > 3) { FC.customFlatRates.update(18, 19.00); }
if (FC.json.total_weight > 4) { FC.customFlatRates.update(18, 21.50); }
if (FC.json.total_weight > 5) { FC.customFlatRates.update(18, 24.00); }
if (FC.json.total_weight > 6) { FC.customFlatRates.update(18, 26.50); }
if (FC.json.total_weight > 7) { FC.customFlatRates.update(18, 29.00); }
if (FC.json.total_weight > 8) { FC.customFlatRates.update(18, 31.50); }
if (FC.json.total_weight > 9) { FC.customFlatRates.update(18, 34.00); }
if (FC.json.total_weight > 10) { FC.customFlatRates.update(18, 36.50); }
if (FC.json.total_weight > 11) { FC.customFlatRates.update(18, 39.00); }
if (FC.json.total_weight > 12) { FC.customFlatRates.update(18, 40.00); }
}
else if (address.country == "ES") {
FC.customFlatRates.add(39, 5.00, 'Irish Post', 'to Spain');
if (FC.json.total_weight > 0.25) { FC.customFlatRates.update(39, 6.00); }
if (FC.json.total_weight > 0.5) { FC.customFlatRates.update(39, 8.50); }
if (FC.json.total_weight > 1) { FC.customFlatRates.update(39, 13.50); }
if (FC.json.total_weight > 2) { FC.customFlatRates.update(39, 14.50); }
if (FC.json.total_weight > 3) { FC.customFlatRates.update(39, 15.50); }
if (FC.json.total_weight > 4) { FC.customFlatRates.update(39, 16.50); }
if (FC.json.total_weight > 5) { FC.customFlatRates.update(39, 17.50); }
if (FC.json.total_weight > 6) { FC.customFlatRates.update(39, 18.50); }
if (FC.json.total_weight > 7) { FC.customFlatRates.update(39, 19.50); }
if (FC.json.total_weight > 8) { FC.customFlatRates.update(39, 20.50); }
if (FC.json.total_weight > 9) { FC.customFlatRates.update(39, 21.50); }
if (FC.json.total_weight > 10) { FC.customFlatRates.update(39, 22.50); }
if (FC.json.total_weight > 11) { FC.customFlatRates.update(39, 23.50); }
if (FC.json.total_weight > 12) { FC.customFlatRates.update(39, 24.50); }
}
else if (address.country == "FI") {
FC.customFlatRates.add(19, 5.00, 'Irish Post', 'to Finland');
if (FC.json.total_weight > 0.25) { FC.customFlatRates.update(19, 6.00); }
if (FC.json.total_weight > 0.5) { FC.customFlatRates.update(19, 8.50); }
if (FC.json.total_weight > 1) { FC.customFlatRates.update(19, 14.00); }
if (FC.json.total_weight > 2) { FC.customFlatRates.update(19, 15.75); }
if (FC.json.total_weight > 3) { FC.customFlatRates.update(19, 17.50); }
if (FC.json.total_weight > 4) { FC.customFlatRates.update(19, 19.20); }
if (FC.json.total_weight > 5) { FC.customFlatRates.update(19, 21.00); }
if (FC.json.total_weight > 6) { FC.customFlatRates.update(19, 22.75); }
if (FC.json.total_weight > 7) { FC.customFlatRates.update(19, 24.50); }
if (FC.json.total_weight > 8) { FC.customFlatRates.update(19, 26.25); }
if (FC.json.total_weight > 9) { FC.customFlatRates.update(19, 28.00); }
if (FC.json.total_weight > 10) { FC.customFlatRates.update(19, 29.75); }
if (FC.json.total_weight > 11) { FC.customFlatRates.update(19, 31.50); }
if (FC.json.total_weight > 12) { FC.customFlatRates.update(19, 33.25); }
}
else if (address.country == "FR") {
FC.customFlatRates.add(20, 5.00, 'Irish Post', 'to France');
if (FC.json.total_weight > 0.25) { FC.customFlatRates.update(20, 6.00); }
if (FC.json.total_weight > 0.5) { FC.customFlatRates.update(20, 8.50); }
if (FC.json.total_weight > 1) { FC.customFlatRates.update(20, 12.75); }
if (FC.json.total_weight > 2) { FC.customFlatRates.update(20, 14.25); }
if (FC.json.total_weight > 3) { FC.customFlatRates.update(20, 15.75); }
if (FC.json.total_weight > 4) { FC.customFlatRates.update(20, 17.25); }
if (FC.json.total_weight > 5) { FC.customFlatRates.update(20, 18.75); }
if (FC.json.total_weight > 6) { FC.customFlatRates.update(20, 20.25); }
if (FC.json.total_weight > 7) { FC.customFlatRates.update(20, 21.75); }
if (FC.json.total_weight > 8) { FC.customFlatRates.update(20, 23.25); }
if (FC.json.total_weight > 9) { FC.customFlatRates.update(20, 24.75); }
if (FC.json.total_weight > 10) { FC.customFlatRates.update(20, 26.25); }
if (FC.json.total_weight > 11) { FC.customFlatRates.update(20, 27.75); }
if (FC.json.total_weight > 12) { FC.customFlatRates.update(20, 29.25); }
}
else if (address.country == "GB") {
FC.customFlatRates.add(5, 5.00, 'Irish Post', 'to UK');
if (FC.json.total_weight > 0.25) { FC.customFlatRates.update(5, 6.00); }
if (FC.json.total_weight > 0.5) { FC.customFlatRates.update(5, 8.50); }
if (FC.json.total_weight > 1) { FC.customFlatRates.update(5, 8.50); }
if (FC.json.total_weight > 2) { FC.customFlatRates.update(5, 8.50); }
if (FC.json.total_weight > 3) { FC.customFlatRates.update(5, 8.50); }
if (FC.json.total_weight > 4) { FC.customFlatRates.update(5, 8.50); }
if (FC.json.total_weight > 5) { FC.customFlatRates.update(5, 12.50); }
if (FC.json.total_weight > 6) { FC.customFlatRates.update(5, 12.50); }
if (FC.json.total_weight > 7) { FC.customFlatRates.update(5, 12.50); }
if (FC.json.total_weight > 8) { FC.customFlatRates.update(5, 12.50); }
if (FC.json.total_weight > 9) { FC.customFlatRates.update(5, 12.50); }
if (FC.json.total_weight > 10) { FC.customFlatRates.update(5, 15.00); }
if (FC.json.total_weight > 11) { FC.customFlatRates.update(5, 15.00); }
if (FC.json.total_weight > 12) { FC.customFlatRates.update(5, 15.00); }
}
else if (address.country == "GR") {
FC.customFlatRates.add(22, 5.00, 'Irish Post', 'to Greece');
if (FC.json.total_weight > 0.25) { FC.customFlatRates.update(22, 6.00); }
if (FC.json.total_weight > 0.5) { FC.customFlatRates.update(22, 8.50); }
if (FC.json.total_weight > 1) { FC.customFlatRates.update(22, 16.00); }
if (FC.json.total_weight > 2) { FC.customFlatRates.update(22, 17.00); }
if (FC.json.total_weight > 3) { FC.customFlatRates.update(22, 18.00); }
if (FC.json.total_weight > 4) { FC.customFlatRates.update(22, 19.00); }
if (FC.json.total_weight > 5) { FC.customFlatRates.update(22, 20.00); }
if (FC.json.total_weight > 6) { FC.customFlatRates.update(22, 21.00); }
if (FC.json.total_weight > 7) { FC.customFlatRates.update(22, 22.00); }
if (FC.json.total_weight > 8) { FC.customFlatRates.update(22, 23.00); }
if (FC.json.total_weight > 9) { FC.customFlatRates.update(22, 24.00); }
if (FC.json.total_weight > 10) { FC.customFlatRates.update(22, 25.00); }
if (FC.json.total_weight > 11) { FC.customFlatRates.update(22, 26.00); }
if (FC.json.total_weight > 12) { FC.customFlatRates.update(22, 27.00); }
}
else if (address.country == "HK") {
FC.customFlatRates.add(48, 5.00, 'Irish Post', 'to Hong Kong');
if (FC.json.total_weight > 0.25) { FC.customFlatRates.update(48, 6.00); }
if (FC.json.total_weight > 0.5) { FC.customFlatRates.update(48, 11.55); }
if (FC.json.total_weight > 1) { FC.customFlatRates.update(48, 12.50); }
if (FC.json.total_weight > 2) { FC.customFlatRates.update(48, 15.25); }
if (FC.json.total_weight > 3) { FC.customFlatRates.update(48, 18.00); }
if (FC.json.total_weight > 4) { FC.customFlatRates.update(48, 20.75); }
if (FC.json.total_weight > 5) { FC.customFlatRates.update(48, 20.75); }
if (FC.json.total_weight > 6) { FC.customFlatRates.update(48, 23.50); }
if (FC.json.total_weight > 7) { FC.customFlatRates.update(48, 29.00); }
if (FC.json.total_weight > 8) { FC.customFlatRates.update(48, 31.75); }
if (FC.json.total_weight > 9) { FC.customFlatRates.update(48, 34.50); }
if (FC.json.total_weight > 10) { FC.customFlatRates.update(48, 37.25); }
if (FC.json.total_weight > 11) { FC.customFlatRates.update(48, 40.00); }
if (FC.json.total_weight > 12) { FC.customFlatRates.update(48, 40.00); }
}
else if (address.country == "HR") {
FC.customFlatRates.add(14, 5.00, 'Irish Post', 'to Croatia');
if (FC.json.total_weight > 0.25) { FC.customFlatRates.update(14, 6.00); }
if (FC.json.total_weight > 0.5) { FC.customFlatRates.update(14, 8.50); }
if (FC.json.total_weight > 1) { FC.customFlatRates.update(14, 12.50); }
if (FC.json.total_weight > 2) { FC.customFlatRates.update(14, 14.00); }
if (FC.json.total_weight > 3) { FC.customFlatRates.update(14, 17.00); }
if (FC.json.total_weight > 4) { FC.customFlatRates.update(14, 18.50); }
if (FC.json.total_weight > 5) { FC.customFlatRates.update(14, 20.00); }
if (FC.json.total_weight > 6) { FC.customFlatRates.update(14, 21.50); }
if (FC.json.total_weight > 7) { FC.customFlatRates.update(14, 23.00); }
if (FC.json.total_weight > 8) { FC.customFlatRates.update(14, 24.50); }
if (FC.json.total_weight > 9) { FC.customFlatRates.update(14, 26.00); }
if (FC.json.total_weight > 10) { FC.customFlatRates.update(14, 27.50); }
if (FC.json.total_weight > 11) { FC.customFlatRates.update(14, 29.00); }
if (FC.json.total_weight > 12) { FC.customFlatRates.update(14, 30.50); }
}
else if (address.country == "HU") {
FC.customFlatRates.add(23, 5.00, 'Irish Post', 'to Hungary');
if (FC.json.total_weight > 0.25) { FC.customFlatRates.update(23, 6.00); }
if (FC.json.total_weight > 0.5) { FC.customFlatRates.update(23, 8.50); }
if (FC.json.total_weight > 1) { FC.customFlatRates.update(23, 16.50); }
if (FC.json.total_weight > 2) { FC.customFlatRates.update(23, 18.50); }
if (FC.json.total_weight > 3) { FC.customFlatRates.update(23, 20.50); }
if (FC.json.total_weight > 4) { FC.customFlatRates.update(23, 22.50); }
if (FC.json.total_weight > 5) { FC.customFlatRates.update(23, 24.50); }
if (FC.json.total_weight > 6) { FC.customFlatRates.update(23, 26.50); }
if (FC.json.total_weight > 7) { FC.customFlatRates.update(23, 28.50); }
if (FC.json.total_weight > 8) { FC.customFlatRates.update(23, 30.50); }
if (FC.json.total_weight > 9) { FC.customFlatRates.update(23, 32.50); }
if (FC.json.total_weight > 10) { FC.customFlatRates.update(23, 34.50); }
if (FC.json.total_weight > 11) { FC.customFlatRates.update(23, 36.50); }
if (FC.json.total_weight > 12) { FC.customFlatRates.update(23, 38.50); }
}
else if (address.country == "IE") {
FC.customFlatRates.add(4, 2.50, 'Irish Post', 'to Ireland');
if (FC.json.total_weight > 0.25) { FC.customFlatRates.update(4, 4.50); }
if (FC.json.total_weight > 0.5) { FC.customFlatRates.update(4, 6.50); }
if (FC.json.total_weight > 1) { FC.customFlatRates.update(4, 6.50); }
if (FC.json.total_weight > 2) { FC.customFlatRates.update(4, 6.50); }
if (FC.json.total_weight > 3) { FC.customFlatRates.update(4, 6.50); }
if (FC.json.total_weight > 4) { FC.customFlatRates.update(4, 6.50); }
if (FC.json.total_weight > 5) { FC.customFlatRates.update(4, 7.50); }
if (FC.json.total_weight > 6) { FC.customFlatRates.update(4, 7.50); }
if (FC.json.total_weight > 7) { FC.customFlatRates.update(4, 7.50); }
if (FC.json.total_weight > 8) { FC.customFlatRates.update(4, 7.50); }
if (FC.json.total_weight > 9) { FC.customFlatRates.update(4, 7.50); }
if (FC.json.total_weight > 10) { FC.customFlatRates.update(4, 12.50); }
if (FC.json.total_weight > 11) { FC.customFlatRates.update(4, 12.50); }
if (FC.json.total_weight > 12) { FC.customFlatRates.update(4, 15.00); }
}
else if (address.country == "IN") {
FC.customFlatRates.add(47, 5.00, 'Irish Post', 'to India');
if (FC.json.total_weight > 0.25) { FC.customFlatRates.update(47, 6.00); }
if (FC.json.total_weight > 0.5) { FC.customFlatRates.update(47, 11.55); }
if (FC.json.total_weight > 1) { FC.customFlatRates.update(47, 17.00); }
if (FC.json.total_weight > 2) { FC.customFlatRates.update(47, 19.50); }
if (FC.json.total_weight > 3) { FC.customFlatRates.update(47, 22.00); }
if (FC.json.total_weight > 4) { FC.customFlatRates.update(47, 24.50); }
if (FC.json.total_weight > 5) { FC.customFlatRates.update(47, 27.00); }
if (FC.json.total_weight > 6) { FC.customFlatRates.update(47, 29.50); }
if (FC.json.total_weight > 7) { FC.customFlatRates.update(47, 32.00); }
if (FC.json.total_weight > 8) { FC.customFlatRates.update(47, 34.50); }
if (FC.json.total_weight > 9) { FC.customFlatRates.update(47, 37.00); }
if (FC.json.total_weight > 10) { FC.customFlatRates.update(47, 39.50); }
if (FC.json.total_weight > 11) { FC.customFlatRates.update(47, 40.00); }
if (FC.json.total_weight > 12) { FC.customFlatRates.update(47, 40.00); }
}
else if (address.country == "IS") {
FC.customFlatRates.add(24, 5.00, 'Irish Post', 'to Iceland');
if (FC.json.total_weight > 0.25) { FC.customFlatRates.update(24, 6.00); }
if (FC.json.total_weight > 0.5) { FC.customFlatRates.update(24, 8.50); }
if (FC.json.total_weight > 1) { FC.customFlatRates.update(24, 14.00); }
if (FC.json.total_weight > 2) { FC.customFlatRates.update(24, 15.50); }
if (FC.json.total_weight > 3) { FC.customFlatRates.update(24, 17.00); }
if (FC.json.total_weight > 4) { FC.customFlatRates.update(24, 18.50); }
if (FC.json.total_weight > 5) { FC.customFlatRates.update(24, 20.00); }
if (FC.json.total_weight > 6) { FC.customFlatRates.update(24, 21.50); }
if (FC.json.total_weight > 7) { FC.customFlatRates.update(24, 23.00); }
if (FC.json.total_weight > 8) { FC.customFlatRates.update(24, 24.50); }
if (FC.json.total_weight > 9) { FC.customFlatRates.update(24, 26.00); }
if (FC.json.total_weight > 10) { FC.customFlatRates.update(24, 27.50); }
if (FC.json.total_weight > 11) { FC.customFlatRates.update(24, 29.00); }
if (FC.json.total_weight > 12) { FC.customFlatRates.update(24, 30.50); }
}
else if (address.country == "IT") {
FC.customFlatRates.add(25, 5.00, 'Irish Post', 'to Italy');
if (FC.json.total_weight > 0.25) { FC.customFlatRates.update(25, 6.00); }
if (FC.json.total_weight > 0.5) { FC.customFlatRates.update(25, 8.50); }
if (FC.json.total_weight > 1) { FC.customFlatRates.update(25, 14.00); }
if (FC.json.total_weight > 2) { FC.customFlatRates.update(25, 16.00); }
if (FC.json.total_weight > 3) { FC.customFlatRates.update(25, 18.00); }
if (FC.json.total_weight > 4) { FC.customFlatRates.update(25, 20.00); }
if (FC.json.total_weight > 5) { FC.customFlatRates.update(25, 22.00); }
if (FC.json.total_weight > 6) { FC.customFlatRates.update(25, 24.00); }
if (FC.json.total_weight > 7) { FC.customFlatRates.update(25, 26.00); }
if (FC.json.total_weight > 8) { FC.customFlatRates.update(25, 28.00); }
if (FC.json.total_weight > 9) { FC.customFlatRates.update(25, 30.00); }
if (FC.json.total_weight > 10) { FC.customFlatRates.update(25, 32.00); }
if (FC.json.total_weight > 11) { FC.customFlatRates.update(25, 34.00); }
if (FC.json.total_weight > 12) { FC.customFlatRates.update(25, 36.00); }
}
else if (address.country == "JP") {
FC.customFlatRates.add(49, 5.00, 'Irish Post', 'to Japan');
if (FC.json.total_weight > 0.25) { FC.customFlatRates.update(49, 6.00); }
if (FC.json.total_weight > 0.5) { FC.customFlatRates.update(49, 11.55); }
if (FC.json.total_weight > 1) { FC.customFlatRates.update(49, 14.00); }
if (FC.json.total_weight > 2) { FC.customFlatRates.update(49, 17.50); }
if (FC.json.total_weight > 3) { FC.customFlatRates.update(49, 21.00); }
if (FC.json.total_weight > 4) { FC.customFlatRates.update(49, 24.50); }
if (FC.json.total_weight > 5) { FC.customFlatRates.update(49, 28.00); }
if (FC.json.total_weight > 6) { FC.customFlatRates.update(49, 31.50); }
if (FC.json.total_weight > 7) { FC.customFlatRates.update(49, 35.00); }
if (FC.json.total_weight > 8) { FC.customFlatRates.update(49, 38.50); }
if (FC.json.total_weight > 9) { FC.customFlatRates.update(49, 40.00); }
if (FC.json.total_weight > 10) { FC.customFlatRates.update(49, 40.00); }
if (FC.json.total_weight > 11) { FC.customFlatRates.update(49, 40.00); }
if (FC.json.total_weight > 12) { FC.customFlatRates.update(49, 40.00); }
}
else if (address.country == "LT") {
FC.customFlatRates.add(27, 5.00, 'Irish Post', 'to Lithuania');
if (FC.json.total_weight > 0.25) { FC.customFlatRates.update(27, 6.00); }
if (FC.json.total_weight > 0.5) { FC.customFlatRates.update(27, 8.50); }
if (FC.json.total_weight > 1) { FC.customFlatRates.update(27, 15.50); }
if (FC.json.total_weight > 2) { FC.customFlatRates.update(27, 19.00); }
if (FC.json.total_weight > 3) { FC.customFlatRates.update(27, 22.50); }
if (FC.json.total_weight > 4) { FC.customFlatRates.update(27, 26.00); }
if (FC.json.total_weight > 5) { FC.customFlatRates.update(27, 29.50); }
if (FC.json.total_weight > 6) { FC.customFlatRates.update(27, 33.00); }
if (FC.json.total_weight > 7) { FC.customFlatRates.update(27, 36.50); }
if (FC.json.total_weight > 8) { FC.customFlatRates.update(27, 40.00); }
if (FC.json.total_weight > 9) { FC.customFlatRates.update(27, 40.00); }
if (FC.json.total_weight > 10) { FC.customFlatRates.update(27, 40.00); }
if (FC.json.total_weight > 11) { FC.customFlatRates.update(27, 40.00); }
if (FC.json.total_weight > 12) { FC.customFlatRates.update(27, 40.00); }
}
else if (address.country == "LU") {
FC.customFlatRates.add(28, 5.00, 'Irish Post', 'to Luxembourg');
if (FC.json.total_weight > 0.25) { FC.customFlatRates.update(28, 6.00); }
if (FC.json.total_weight > 0.5) { FC.customFlatRates.update(28, 8.50); }
if (FC.json.total_weight > 1) { FC.customFlatRates.update(28, 17.50); }
if (FC.json.total_weight > 2) { FC.customFlatRates.update(28, 20.00); }
if (FC.json.total_weight > 3) { FC.customFlatRates.update(28, 22.50); }
if (FC.json.total_weight > 4) { FC.customFlatRates.update(28, 25.00); }
if (FC.json.total_weight > 5) { FC.customFlatRates.update(28, 27.50); }
if (FC.json.total_weight > 6) { FC.customFlatRates.update(28, 30.00); }
if (FC.json.total_weight > 7) { FC.customFlatRates.update(28, 32.50); }
if (FC.json.total_weight > 8) { FC.customFlatRates.update(28, 35.00); }
if (FC.json.total_weight > 9) { FC.customFlatRates.update(28, 37.50); }
if (FC.json.total_weight > 10) { FC.customFlatRates.update(28, 40.00); }
if (FC.json.total_weight > 11) { FC.customFlatRates.update(28, 40.00); }
if (FC.json.total_weight > 12) { FC.customFlatRates.update(28, 40.00); }
}
else if (address.country == "LV") {
FC.customFlatRates.add(26, 5.00, 'Irish Post', 'to Latvia');
if (FC.json.total_weight > 0.25) { FC.customFlatRates.update(26, 6.00); }
if (FC.json.total_weight > 0.5) { FC.customFlatRates.update(26, 8.50); }
if (FC.json.total_weight > 1) { FC.customFlatRates.update(26, 14.50); }
if (FC.json.total_weight > 2) { FC.customFlatRates.update(26, 18.00); }
if (FC.json.total_weight > 3) { FC.customFlatRates.update(26, 21.50); }
if (FC.json.total_weight > 4) { FC.customFlatRates.update(26, 25.00); }
if (FC.json.total_weight > 5) { FC.customFlatRates.update(26, 28.50); }
if (FC.json.total_weight > 6) { FC.customFlatRates.update(26, 32.00); }
if (FC.json.total_weight > 7) { FC.customFlatRates.update(26, 35.50); }
if (FC.json.total_weight > 8) { FC.customFlatRates.update(26, 39.00); }
if (FC.json.total_weight > 9) { FC.customFlatRates.update(26, 40.00); }
if (FC.json.total_weight > 10) { FC.customFlatRates.update(26, 40.00); }
if (FC.json.total_weight > 11) { FC.customFlatRates.update(26, 40.00); }
if (FC.json.total_weight > 12) { FC.customFlatRates.update(26, 40.00); }
}
else if (address.country == "MK") {
FC.customFlatRates.add(29, 5.00, 'Irish Post', 'to Macedonia');
if (FC.json.total_weight > 0.25) { FC.customFlatRates.update(29, 6.00); }
if (FC.json.total_weight > 0.5) { FC.customFlatRates.update(29, 8.50); }
if (FC.json.total_weight > 1) { FC.customFlatRates.update(29, 16.50); }
if (FC.json.total_weight > 2) { FC.customFlatRates.update(29, 18.50); }
if (FC.json.total_weight > 3) { FC.customFlatRates.update(29, 20.50); }
if (FC.json.total_weight > 4) { FC.customFlatRates.update(29, 22.50); }
if (FC.json.total_weight > 5) { FC.customFlatRates.update(29, 24.50); }
if (FC.json.total_weight > 6) { FC.customFlatRates.update(29, 26.50); }
if (FC.json.total_weight > 7) { FC.customFlatRates.update(29, 28.50); }
if (FC.json.total_weight > 8) { FC.customFlatRates.update(29, 30.50); }
if (FC.json.total_weight > 9) { FC.customFlatRates.update(29, 32.50); }
if (FC.json.total_weight > 10) { FC.customFlatRates.update(29, 34.50); }
if (FC.json.total_weight > 11) { FC.customFlatRates.update(29, 36.50); }
if (FC.json.total_weight > 12) { FC.customFlatRates.update(29, 38.50); }
}
else if (address.country == "MT") {
FC.customFlatRates.add(30, 5.00, 'Irish Post', 'to Malta');
if (FC.json.total_weight > 0.25) { FC.customFlatRates.update(30, 6.00); }
if (FC.json.total_weight > 0.5) { FC.customFlatRates.update(30, 8.50); }
if (FC.json.total_weight > 1) { FC.customFlatRates.update(30, 15.50); }
if (FC.json.total_weight > 2) { FC.customFlatRates.update(30, 18.50); }
if (FC.json.total_weight > 3) { FC.customFlatRates.update(30, 20.50); }
if (FC.json.total_weight > 4) { FC.customFlatRates.update(30, 23.00); }
if (FC.json.total_weight > 5) { FC.customFlatRates.update(30, 25.50); }
if (FC.json.total_weight > 6) { FC.customFlatRates.update(30, 28.00); }
if (FC.json.total_weight > 7) { FC.customFlatRates.update(30, 30.50); }
if (FC.json.total_weight > 8) { FC.customFlatRates.update(30, 33.00); }
if (FC.json.total_weight > 9) { FC.customFlatRates.update(30, 35.50); }
if (FC.json.total_weight > 10) { FC.customFlatRates.update(30, 38.00); }
if (FC.json.total_weight > 11) { FC.customFlatRates.update(30, 40.00); }
if (FC.json.total_weight > 12) { FC.customFlatRates.update(30, 40.00); }
}
else if (address.country == "NG") {
FC.customFlatRates.add(51, 5.00, 'Irish Post', 'to Nigeria');
if (FC.json.total_weight > 0.25) { FC.customFlatRates.update(51, 6.00); }
if (FC.json.total_weight > 0.5) { FC.customFlatRates.update(51, 11.55); }
if (FC.json.total_weight > 1) { FC.customFlatRates.update(51, 16.50); }
if (FC.json.total_weight > 2) { FC.customFlatRates.update(51, 19.00); }
if (FC.json.total_weight > 3) { FC.customFlatRates.update(51, 21.50); }
if (FC.json.total_weight > 4) { FC.customFlatRates.update(51, 24.00); }
if (FC.json.total_weight > 5) { FC.customFlatRates.update(51, 26.50); }
if (FC.json.total_weight > 6) { FC.customFlatRates.update(51, 29.00); }
if (FC.json.total_weight > 7) { FC.customFlatRates.update(51, 31.50); }
if (FC.json.total_weight > 8) { FC.customFlatRates.update(51, 34.00); }
if (FC.json.total_weight > 9) { FC.customFlatRates.update(51, 36.50); }
if (FC.json.total_weight > 10) { FC.customFlatRates.update(51, 39.00); }
if (FC.json.total_weight > 11) { FC.customFlatRates.update(51, 40.00); }
if (FC.json.total_weight > 12) { FC.customFlatRates.update(51, 40.00); }
}
if (address.postal_code.indexOf("BT") === 0) {
FC.customFlatRates.add(58, 2.50, 'Irish Post', 'to Northern Ireland');
if (FC.json.total_weight > 0.25) { FC.customFlatRates.update(58, 4.50); }
if (FC.json.total_weight > 0.5) { FC.customFlatRates.update(58, 7.50); }
if (FC.json.total_weight > 1) { FC.customFlatRates.update(58, 7.50); }
if (FC.json.total_weight > 2) { FC.customFlatRates.update(58, 7.50); }
if (FC.json.total_weight > 3) { FC.customFlatRates.update(58, 7.50); }
if (FC.json.total_weight > 4) { FC.customFlatRates.update(58, 7.50); }
if (FC.json.total_weight > 5) { FC.customFlatRates.update(58, 8.50); }
if (FC.json.total_weight > 6) { FC.customFlatRates.update(58, 8.50); }
if (FC.json.total_weight > 7) { FC.customFlatRates.update(58, 8.50); }
if (FC.json.total_weight > 8) { FC.customFlatRates.update(58, 8.50); }
if (FC.json.total_weight > 9) { FC.customFlatRates.update(58, 8.50); }
if (FC.json.total_weight > 10) { FC.customFlatRates.update(58, 12.50); }
if (FC.json.total_weight > 11) { FC.customFlatRates.update(58, 12.50); }
if (FC.json.total_weight > 12) { FC.customFlatRates.update(58, 15.00); }
}
else if (address.country == "NL") {
FC.customFlatRates.add(43, 5.00, 'Irish Post', 'to The Netherlands');
if (FC.json.total_weight > 0.25) { FC.customFlatRates.update(43, 6.00); }
if (FC.json.total_weight > 0.5) { FC.customFlatRates.update(43, 8.50); }
if (FC.json.total_weight > 1) { FC.customFlatRates.update(43, 11.50); }
if (FC.json.total_weight > 2) { FC.customFlatRates.update(43, 14.00); }
if (FC.json.total_weight > 3) { FC.customFlatRates.update(43, 16.50); }
if (FC.json.total_weight > 4) { FC.customFlatRates.update(43, 19.00); }
if (FC.json.total_weight > 5) { FC.customFlatRates.update(43, 21.50); }
if (FC.json.total_weight > 6) { FC.customFlatRates.update(43, 24.00); }
if (FC.json.total_weight > 7) { FC.customFlatRates.update(43, 26.50); }
if (FC.json.total_weight > 8) { FC.customFlatRates.update(43, 29.00); }
if (FC.json.total_weight > 9) { FC.customFlatRates.update(43, 31.50); }
if (FC.json.total_weight > 10) { FC.customFlatRates.update(43, 34.00); }
if (FC.json.total_weight > 11) { FC.customFlatRates.update(43, 36.50); }
if (FC.json.total_weight > 12) { FC.customFlatRates.update(43, 39.00); }
}
else if (address.country == "NO") {
FC.customFlatRates.add(31, 5.00, 'Irish Post', 'to Norway');
if (FC.json.total_weight > 0.25) { FC.customFlatRates.update(31, 6.00); }
if (FC.json.total_weight > 0.5) { FC.customFlatRates.update(31, 8.50); }
if (FC.json.total_weight > 1) { FC.customFlatRates.update(31, 22.50); }
if (FC.json.total_weight > 2) { FC.customFlatRates.update(31, 24.00); }
if (FC.json.total_weight > 3) { FC.customFlatRates.update(31, 25.50); }
if (FC.json.total_weight > 4) { FC.customFlatRates.update(31, 27.00); }
if (FC.json.total_weight > 5) { FC.customFlatRates.update(31, 28.50); }
if (FC.json.total_weight > 6) { FC.customFlatRates.update(31, 30.00); }
if (FC.json.total_weight > 7) { FC.customFlatRates.update(31, 31.50); }
if (FC.json.total_weight > 8) { FC.customFlatRates.update(31, 33.00); }
if (FC.json.total_weight > 9) { FC.customFlatRates.update(31, 34.50); }
if (FC.json.total_weight > 10) { FC.customFlatRates.update(31, 36.00); }
if (FC.json.total_weight > 11) { FC.customFlatRates.update(31, 37.50); }
if (FC.json.total_weight > 12) { FC.customFlatRates.update(31, 39.00); }
}
else if (address.country == "NZ") {
FC.customFlatRates.add(50, 5.00, 'Irish Post', 'to New Zealand');
if (FC.json.total_weight > 0.25) { FC.customFlatRates.update(50, 6.00); }
if (FC.json.total_weight > 0.5) { FC.customFlatRates.update(50, 11.55); }
if (FC.json.total_weight > 1) { FC.customFlatRates.update(50, 18.00); }
if (FC.json.total_weight > 2) { FC.customFlatRates.update(50, 23.50); }
if (FC.json.total_weight > 3) { FC.customFlatRates.update(50, 29.00); }
if (FC.json.total_weight > 4) { FC.customFlatRates.update(50, 34.50); }
if (FC.json.total_weight > 5) { FC.customFlatRates.update(50, 40.00); }
if (FC.json.total_weight > 6) { FC.customFlatRates.update(50, 40.00); }
if (FC.json.total_weight > 7) { FC.customFlatRates.update(50, 40.00); }
if (FC.json.total_weight > 8) { FC.customFlatRates.update(50, 40.00); }
if (FC.json.total_weight > 9) { FC.customFlatRates.update(50, 40.00); }
if (FC.json.total_weight > 10) { FC.customFlatRates.update(50, 40.00); }
if (FC.json.total_weight > 11) { FC.customFlatRates.update(50, 40.00); }
if (FC.json.total_weight > 12) { FC.customFlatRates.update(50, 40.00); }
}
else if (address.country == "PH") {
FC.customFlatRates.add(52, 5.00, 'Irish Post', 'to Philippines');
if (FC.json.total_weight > 0.25) { FC.customFlatRates.update(52, 6.00); }
if (FC.json.total_weight > 0.5) { FC.customFlatRates.update(52, 11.55); }
if (FC.json.total_weight > 1) { FC.customFlatRates.update(52, 13.50); }
if (FC.json.total_weight > 2) { FC.customFlatRates.update(52, 15.50); }
if (FC.json.total_weight > 3) { FC.customFlatRates.update(52, 17.50); }
if (FC.json.total_weight > 4) { FC.customFlatRates.update(52, 19.50); }
if (FC.json.total_weight > 5) { FC.customFlatRates.update(52, 21.50); }
if (FC.json.total_weight > 6) { FC.customFlatRates.update(52, 23.50); }
if (FC.json.total_weight > 7) { FC.customFlatRates.update(52, 25.50); }
if (FC.json.total_weight > 8) { FC.customFlatRates.update(52, 27.50); }
if (FC.json.total_weight > 9) { FC.customFlatRates.update(52, 29.50); }
if (FC.json.total_weight > 10) { FC.customFlatRates.update(52, 31.50); }
if (FC.json.total_weight > 11) { FC.customFlatRates.update(52, 33.50); }
if (FC.json.total_weight > 12) { FC.customFlatRates.update(52, 35.50); }
}
else if (address.country == "PL") {
FC.customFlatRates.add(32, 5.00, 'Irish Post', 'to Poland');
if (FC.json.total_weight > 0.25) { FC.customFlatRates.update(32, 6.00); }
if (FC.json.total_weight > 0.5) { FC.customFlatRates.update(32, 8.50); }
if (FC.json.total_weight > 1) { FC.customFlatRates.update(32, 14.00); }
if (FC.json.total_weight > 2) { FC.customFlatRates.update(32, 16.00); }
if (FC.json.total_weight > 3) { FC.customFlatRates.update(32, 18.00); }
if (FC.json.total_weight > 4) { FC.customFlatRates.update(32, 20.00); }
if (FC.json.total_weight > 5) { FC.customFlatRates.update(32, 22.00); }
if (FC.json.total_weight > 6) { FC.customFlatRates.update(32, 24.00); }
if (FC.json.total_weight > 7) { FC.customFlatRates.update(32, 26.00); }
if (FC.json.total_weight > 8) { FC.customFlatRates.update(32, 28.00); }
if (FC.json.total_weight > 9) { FC.customFlatRates.update(32, 30.00); }
if (FC.json.total_weight > 10) { FC.customFlatRates.update(32, 32.00); }
if (FC.json.total_weight > 11) { FC.customFlatRates.update(32, 34.00); }
if (FC.json.total_weight > 12) { FC.customFlatRates.update(32, 36.00); }
}
else if (address.country == "PT") {
FC.customFlatRates.add(33, 5.00, 'Irish Post', 'to Portugal');
if (FC.json.total_weight > 0.25) { FC.customFlatRates.update(33, 6.00); }
if (FC.json.total_weight > 0.5) { FC.customFlatRates.update(33, 8.50); }
if (FC.json.total_weight > 1) { FC.customFlatRates.update(33, 10.50); }
if (FC.json.total_weight > 2) { FC.customFlatRates.update(33, 11.50); }
if (FC.json.total_weight > 3) { FC.customFlatRates.update(33, 12.50); }
if (FC.json.total_weight > 4) { FC.customFlatRates.update(33, 13.50); }
if (FC.json.total_weight > 5) { FC.customFlatRates.update(33, 14.50); }
if (FC.json.total_weight > 6) { FC.customFlatRates.update(33, 15.50); }
if (FC.json.total_weight > 7) { FC.customFlatRates.update(33, 16.50); }
if (FC.json.total_weight > 8) { FC.customFlatRates.update(33, 17.50); }
if (FC.json.total_weight > 9) { FC.customFlatRates.update(33, 18.50); }
if (FC.json.total_weight > 10) { FC.customFlatRates.update(33, 19.50); }
if (FC.json.total_weight > 11) { FC.customFlatRates.update(33, 20.50); }
if (FC.json.total_weight > 12) { FC.customFlatRates.update(33, 21.50); }
}
else if (address.country == "RO") {
FC.customFlatRates.add(34, 5.00, 'Irish Post', 'to Romania');
if (FC.json.total_weight > 0.25) { FC.customFlatRates.update(34, 6.00); }
if (FC.json.total_weight > 0.5) { FC.customFlatRates.update(34, 8.50); }
if (FC.json.total_weight > 1) { FC.customFlatRates.update(34, 20.00); }
if (FC.json.total_weight > 2) { FC.customFlatRates.update(34, 22.00); }
if (FC.json.total_weight > 3) { FC.customFlatRates.update(34, 24.00); }
if (FC.json.total_weight > 4) { FC.customFlatRates.update(34, 26.00); }
if (FC.json.total_weight > 5) { FC.customFlatRates.update(34, 28.00); }
if (FC.json.total_weight > 6) { FC.customFlatRates.update(34, 30.00); }
if (FC.json.total_weight > 7) { FC.customFlatRates.update(34, 32.00); }
if (FC.json.total_weight > 8) { FC.customFlatRates.update(34, 34.00); }
if (FC.json.total_weight > 9) { FC.customFlatRates.update(34, 36.00); }
if (FC.json.total_weight > 10) { FC.customFlatRates.update(34, 38.00); }
if (FC.json.total_weight > 11) { FC.customFlatRates.update(34, 40.00); }
if (FC.json.total_weight > 12) { FC.customFlatRates.update(34, 40.00); }
}
else if (address.country == "RS") {
FC.customFlatRates.add(36, 5.00, 'Irish Post', 'to Serbia');
if (FC.json.total_weight > 0.25) { FC.customFlatRates.update(36, 6.00); }
if (FC.json.total_weight > 0.5) { FC.customFlatRates.update(36, 8.50); }
if (FC.json.total_weight > 1) { FC.customFlatRates.update(36, 15.50); }
if (FC.json.total_weight > 2) { FC.customFlatRates.update(36, 17.25); }
if (FC.json.total_weight > 3) { FC.customFlatRates.update(36, 19.00); }
if (FC.json.total_weight > 4) { FC.customFlatRates.update(36, 20.75); }
if (FC.json.total_weight > 5) { FC.customFlatRates.update(36, 22.50); }
if (FC.json.total_weight > 6) { FC.customFlatRates.update(36, 24.25); }
if (FC.json.total_weight > 7) { FC.customFlatRates.update(36, 26.00); }
if (FC.json.total_weight > 8) { FC.customFlatRates.update(36, 27.75); }
if (FC.json.total_weight > 9) { FC.customFlatRates.update(36, 29.50); }
if (FC.json.total_weight > 10) { FC.customFlatRates.update(36, 31.25); }
if (FC.json.total_weight > 11) { FC.customFlatRates.update(36, 33.00); }
if (FC.json.total_weight > 12) { FC.customFlatRates.update(36, 34.75); }
}
else if (address.country == "RU") {
FC.customFlatRates.add(35, 5.00, 'Irish Post', 'to Russia');
if (FC.json.total_weight > 0.25) { FC.customFlatRates.update(35, 6.00); }
if (FC.json.total_weight > 0.5) { FC.customFlatRates.update(35, 8.50); }
if (FC.json.total_weight > 1) { FC.customFlatRates.update(35, 37.50); }
if (FC.json.total_weight > 2) { FC.customFlatRates.update(35, 40.00); }
if (FC.json.total_weight > 3) { FC.customFlatRates.update(35, 40.00); }
if (FC.json.total_weight > 4) { FC.customFlatRates.update(35, 40.00); }
if (FC.json.total_weight > 5) { FC.customFlatRates.update(35, 40.00); }
if (FC.json.total_weight > 6) { FC.customFlatRates.update(35, 40.00); }
if (FC.json.total_weight > 7) { FC.customFlatRates.update(35, 40.00); }
if (FC.json.total_weight > 8) { FC.customFlatRates.update(35, 40.00); }
if (FC.json.total_weight > 9) { FC.customFlatRates.update(35, 40.00); }
if (FC.json.total_weight > 10) { FC.customFlatRates.update(35, 40.00); }
if (FC.json.total_weight > 11) { FC.customFlatRates.update(35, 40.00); }
if (FC.json.total_weight > 12) { FC.customFlatRates.update(35, 40.00); }
}
else if (address.country == "SE") {
FC.customFlatRates.add(40, 5.00, 'Irish Post', 'to Sweden');
if (FC.json.total_weight > 0.25) { FC.customFlatRates.update(40, 6.00); }
if (FC.json.total_weight > 0.5) { FC.customFlatRates.update(40, 8.50); }
if (FC.json.total_weight > 1) { FC.customFlatRates.update(40, 11.50); }
if (FC.json.total_weight > 2) { FC.customFlatRates.update(40, 13.00); }
if (FC.json.total_weight > 3) { FC.customFlatRates.update(40, 14.50); }
if (FC.json.total_weight > 4) { FC.customFlatRates.update(40, 16.00); }
if (FC.json.total_weight > 5) { FC.customFlatRates.update(40, 17.50); }
if (FC.json.total_weight > 6) { FC.customFlatRates.update(40, 19.00); }
if (FC.json.total_weight > 7) { FC.customFlatRates.update(40, 20.50); }
if (FC.json.total_weight > 8) { FC.customFlatRates.update(40, 22.00); }
if (FC.json.total_weight > 9) { FC.customFlatRates.update(40, 23.50); }
if (FC.json.total_weight > 10) { FC.customFlatRates.update(40, 25.00); }
if (FC.json.total_weight > 11) { FC.customFlatRates.update(40, 26.50); }
if (FC.json.total_weight > 12) { FC.customFlatRates.update(40, 28.00); }
}
else if (address.country == "SI") {
FC.customFlatRates.add(38, 5.00, 'Irish Post', 'to Slovenia');
if (FC.json.total_weight > 0.25) { FC.customFlatRates.update(38, 6.00); }
if (FC.json.total_weight > 0.5) { FC.customFlatRates.update(38, 8.50); }
if (FC.json.total_weight > 1) { FC.customFlatRates.update(38, 13.50); }
if (FC.json.total_weight > 2) { FC.customFlatRates.update(38, 14.50); }
if (FC.json.total_weight > 3) { FC.customFlatRates.update(38, 15.50); }
if (FC.json.total_weight > 4) { FC.customFlatRates.update(38, 16.50); }
if (FC.json.total_weight > 5) { FC.customFlatRates.update(38, 17.50); }
if (FC.json.total_weight > 6) { FC.customFlatRates.update(38, 18.50); }
if (FC.json.total_weight > 7) { FC.customFlatRates.update(38, 19.50); }
if (FC.json.total_weight > 8) { FC.customFlatRates.update(38, 20.50); }
if (FC.json.total_weight > 9) { FC.customFlatRates.update(38, 21.50); }
if (FC.json.total_weight > 10) { FC.customFlatRates.update(38, 22.50); }
if (FC.json.total_weight > 11) { FC.customFlatRates.update(38, 23.50); }
if (FC.json.total_weight > 12) { FC.customFlatRates.update(38, 24.50); }
}
else if (address.country == "SK") {
FC.customFlatRates.add(37, 5.00, 'Irish Post', 'to Slovakia');
if (FC.json.total_weight > 0.25) { FC.customFlatRates.update(37, 6.00); }
if (FC.json.total_weight > 0.5) { FC.customFlatRates.update(37, 8.50); }
if (FC.json.total_weight > 1) { FC.customFlatRates.update(37, 11.00); }
if (FC.json.total_weight > 2) { FC.customFlatRates.update(37, 13.00); }
if (FC.json.total_weight > 3) { FC.customFlatRates.update(37, 15.00); }
if (FC.json.total_weight > 4) { FC.customFlatRates.update(37, 17.00); }
if (FC.json.total_weight > 5) { FC.customFlatRates.update(37, 19.00); }
if (FC.json.total_weight > 6) { FC.customFlatRates.update(37, 21.00); }
if (FC.json.total_weight > 7) { FC.customFlatRates.update(37, 23.00); }
if (FC.json.total_weight > 8) { FC.customFlatRates.update(37, 25.00); }
if (FC.json.total_weight > 9) { FC.customFlatRates.update(37, 27.00); }
if (FC.json.total_weight > 10) { FC.customFlatRates.update(37, 29.00); }
if (FC.json.total_weight > 11) { FC.customFlatRates.update(37, 31.00); }
if (FC.json.total_weight > 12) { FC.customFlatRates.update(37, 33.00); }
}
else if (address.country == "TR") {
FC.customFlatRates.add(42, 5.00, 'Irish Post', 'to Turkey');
if (FC.json.total_weight > 0.25) { FC.customFlatRates.update(42, 6.00); }
if (FC.json.total_weight > 0.5) { FC.customFlatRates.update(42, 8.50); }
if (FC.json.total_weight > 1) { FC.customFlatRates.update(42, 13.50); }
if (FC.json.total_weight > 2) { FC.customFlatRates.update(42, 15.50); }
if (FC.json.total_weight > 3) { FC.customFlatRates.update(42, 17.50); }
if (FC.json.total_weight > 4) { FC.customFlatRates.update(42, 19.50); }
if (FC.json.total_weight > 5) { FC.customFlatRates.update(42, 21.50); }
if (FC.json.total_weight > 6) { FC.customFlatRates.update(42, 23.50); }
if (FC.json.total_weight > 7) { FC.customFlatRates.update(42, 25.50); }
if (FC.json.total_weight > 8) { FC.customFlatRates.update(42, 27.50); }
if (FC.json.total_weight > 9) { FC.customFlatRates.update(42, 29.50); }
if (FC.json.total_weight > 10) { FC.customFlatRates.update(42, 31.50); }
if (FC.json.total_weight > 11) { FC.customFlatRates.update(42, 33.50); }
if (FC.json.total_weight > 12) { FC.customFlatRates.update(42, 35.50); }
}
else if (address.country == "US") {
FC.customFlatRates.add(56, 4.60, 'US Postal Service', '');
if (FC.json.total_weight > 0.25) { FC.customFlatRates.update(56, 4.60); }
if (FC.json.total_weight > 0.5) { FC.customFlatRates.update(56, 7.00); }
if (FC.json.total_weight > 1) { FC.customFlatRates.update(56, 8.60); }
if (FC.json.total_weight > 2) { FC.customFlatRates.update(56, 10.20); }
if (FC.json.total_weight > 3) { FC.customFlatRates.update(56, 11.50); }
if (FC.json.total_weight > 4) { FC.customFlatRates.update(56, 13.40); }
if (FC.json.total_weight > 5) { FC.customFlatRates.update(56, 15.00); }
if (FC.json.total_weight > 6) { FC.customFlatRates.update(56, 16.60); }
if (FC.json.total_weight > 7) { FC.customFlatRates.update(56, 18.20); }
if (FC.json.total_weight > 8) { FC.customFlatRates.update(56, 19.80); }
if (FC.json.total_weight > 9) { FC.customFlatRates.update(56, 21.40); }
if (FC.json.total_weight > 10) { FC.customFlatRates.update(56, 23.00); }
if (FC.json.total_weight > 11) { FC.customFlatRates.update(56, 24.60); }
if (FC.json.total_weight > 12) { FC.customFlatRates.update(56, 26.20); }
}
else if (address.country == "ZA") {
FC.customFlatRates.add(53, 5.00, 'Irish Post', 'to South Africa');
if (FC.json.total_weight > 0.25) { FC.customFlatRates.update(53, 6.00); }
if (FC.json.total_weight > 0.5) { FC.customFlatRates.update(53, 11.55); }
if (FC.json.total_weight > 1) { FC.customFlatRates.update(53, 17.50); }
if (FC.json.total_weight > 2) { FC.customFlatRates.update(53, 20.00); }
if (FC.json.total_weight > 3) { FC.customFlatRates.update(53, 22.50); }
if (FC.json.total_weight > 4) { FC.customFlatRates.update(53, 25.00); }
if (FC.json.total_weight > 5) { FC.customFlatRates.update(53, 27.50); }
if (FC.json.total_weight > 6) { FC.customFlatRates.update(53, 30.00); }
if (FC.json.total_weight > 7) { FC.customFlatRates.update(53, 32.50); }
if (FC.json.total_weight > 8) { FC.customFlatRates.update(53, 35.00); }
if (FC.json.total_weight > 9) { FC.customFlatRates.update(53, 37.50); }
if (FC.json.total_weight > 10) { FC.customFlatRates.update(53, 40.00); }
if (FC.json.total_weight > 11) { FC.customFlatRates.update(53, 40.00); }
if (FC.json.total_weight > 12) { FC.customFlatRates.update(53, 40.00); }
}
else {
FC.customFlatRates.add(7, 5.00, 'Irish Post', 'to Rest of the World');
if (FC.json.total_weight > 0.25) { FC.customFlatRates.update(7, 6.00); }
if (FC.json.total_weight > 0.5) { FC.customFlatRates.update(7, 11.55); }
if (FC.json.total_weight > 1) { FC.customFlatRates.update(7, 17.80); }
if (FC.json.total_weight > 2) { FC.customFlatRates.update(7, 40.50); }
if (FC.json.total_weight > 3) { FC.customFlatRates.update(7, 50.50); }
if (FC.json.total_weight > 4) { FC.customFlatRates.update(7, 60.50); }
if (FC.json.total_weight > 5) { FC.customFlatRates.update(7, 61.50); }
if (FC.json.total_weight > 6) { FC.customFlatRates.update(7, 62.50); }
if (FC.json.total_weight > 7) { FC.customFlatRates.update(7, 63.50); }
if (FC.json.total_weight > 8) { FC.customFlatRates.update(7, 64.50); }
if (FC.json.total_weight > 9) { FC.customFlatRates.update(7, 65.50); }
if (FC.json.total_weight > 10) { FC.customFlatRates.update(7, 66.50); }
if (FC.json.total_weight > 11) { FC.customFlatRates.update(7, 67.50); }
if (FC.json.total_weight > 12) { FC.customFlatRates.update(7, 68.50); }
}



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