From c5e6a0078410ede4c38f2b978cc3c8aae0361222 Mon Sep 17 00:00:00 2001 From: Ash Smith Date: Thu, 6 Mar 2014 20:32:28 +0000 Subject: [PATCH 1/7] 2014 pricing, international rates updated too --- .../Meanbee/Royalmail/Helper/Data.php | 69 ++++++++- .../Model/Shipping/Carrier/Royalmail.php | 22 +-- .../Shipping/Carrier/Royalmail/Abstract.php | 1 - .../Shipping/Carrier/Royalmail/Airmail.php | 140 ------------------ .../Shipping/Carrier/Royalmail/Airsure.php | 73 --------- .../Carrier/Royalmail/Airsureinsurance.php | 38 ----- ...very9am50.php => Internationaleconomy.php} | 20 +-- ...rinsurance.php => Internationalsigned.php} | 19 +-- .../Royalmail/Internationalstandard.php | 87 +++++++++++ .../Royalmail/Internationaltracked.php | 123 +++++++++++++++ ...for.php => Internationaltrackedsigned.php} | 33 ++--- ...very9am2500.php => Specialdelivery9am.php} | 16 +- ...9am1000.php => Specialdeliverynextday.php} | 22 +-- .../Royalmail/Specialdeliverynextday1000.php | 40 ----- .../Royalmail/Specialdeliverynextday2500.php | 36 ----- .../Royalmail/Specialdeliverynextday500.php | 36 ----- .../Carrier/Royalmail/Surfacemail.php | 38 ----- .../Meanbee/Royalmail/Test/Helper/Data.php | 1 + .../Shipping/Carrier/Royalmail/Airmail.php | 85 ----------- .../Shipping/Carrier/Royalmail/Airsure.php | 85 ----------- .../Carrier/Royalmail/Airsureinsurance.php | 93 ------------ .../Shipping/Carrier/Royalmail/Firstclass.php | 2 +- .../Royalmail/Firstclassrecordedsignedfor.php | 2 +- ...ry9am2500.php => Internationaleconomy.php} | 40 ++--- .../Carrier/Royalmail/Internationalsigned.php | 85 +++++++++++ .../Royalmail/Internationalsignedfor.php | 85 ----------- .../Internationalsignedforinsurance.php | 85 ----------- .../Royalmail/Internationalstandard.php | 72 +++++++++ .../Royalmail/Internationaltracked.php | 83 +++++++++++ ...500.php => Internationaltrackedsigned.php} | 72 ++++----- .../Carrier/Royalmail/Largeletter.php | 4 +- .../Shipping/Carrier/Royalmail/Letter.php | 4 +- .../Carrier/Royalmail/Secondclass.php | 2 +- .../Secondclassrecordedsignedfor.php | 2 +- ...livery9am50.php => Specialdelivery9am.php} | 12 +- .../Royalmail/Specialdelivery9am1000.php | 105 ------------- ...tday500.php => Specialdeliverynextday.php} | 12 +- .../Royalmail/Specialdeliverynextday1000.php | 105 ------------- .../Meanbee/Royalmail/data/9am1000.csv | 8 +- .../Meanbee/Royalmail/data/9am2500.csv | 8 +- .../Meanbee/Royalmail/data/9am50.csv | 8 +- .../Meanbee/Royalmail/data/airmail_eu.csv | 9 -- .../Meanbee/Royalmail/data/airmail_rw1.csv | 9 -- .../Meanbee/Royalmail/data/airmail_rw2.csv | 9 -- .../Meanbee/Royalmail/data/airsure_eu.csv | 5 - .../Royalmail/data/firstclass_medium.csv | 6 +- .../Royalmail/data/firstclass_small.csv | 4 +- .../Royalmail/data/internationaleconomy.csv | 9 ++ .../data/internationalstandard_europe.csv | 9 ++ .../data/internationalstandard_wz1.csv | 9 ++ .../data/internationalstandard_wz2.csv | 9 ++ .../data/internationaltracked_eu.csv | 9 ++ .../data/internationaltracked_noneu.csv | 9 ++ .../data/internationaltracked_wz1.csv | 9 ++ .../data/internationaltracked_wz2.csv | 9 ++ .../Meanbee/Royalmail/data/largeletter.csv | 8 +- .../Meanbee/Royalmail/data/letter.csv | 2 +- .../Meanbee/Royalmail/data/nextday1000.csv | 10 +- .../Meanbee/Royalmail/data/nextday2500.csv | 12 +- .../Meanbee/Royalmail/data/nextday500.csv | 10 +- .../Royalmail/data/secondclass_medium.csv | 6 +- .../Royalmail/data/secondclass_small.csv | 4 +- .../Meanbee/Royalmail/data/surfacemail.csv | 9 -- 63 files changed, 759 insertions(+), 1289 deletions(-) delete mode 100644 app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Airmail.php delete mode 100644 app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Airsure.php delete mode 100644 app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Airsureinsurance.php rename app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/{Specialdelivery9am50.php => Internationaleconomy.php} (67%) rename app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/{Internationalsignedforinsurance.php => Internationalsigned.php} (69%) create mode 100644 app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Internationalstandard.php create mode 100644 app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Internationaltracked.php rename app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/{Internationalsignedfor.php => Internationaltrackedsigned.php} (57%) rename app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/{Specialdelivery9am2500.php => Specialdelivery9am.php} (71%) rename app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/{Specialdelivery9am1000.php => Specialdeliverynextday.php} (70%) delete mode 100644 app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Specialdeliverynextday1000.php delete mode 100644 app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Specialdeliverynextday2500.php delete mode 100644 app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Specialdeliverynextday500.php delete mode 100644 app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Surfacemail.php create mode 100644 app/code/community/Meanbee/Royalmail/Test/Helper/Data.php delete mode 100644 app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Airmail.php delete mode 100644 app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Airsure.php delete mode 100644 app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Airsureinsurance.php rename app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/{Specialdelivery9am2500.php => Internationaleconomy.php} (58%) create mode 100644 app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Internationalsigned.php delete mode 100644 app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Internationalsignedfor.php delete mode 100644 app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Internationalsignedforinsurance.php create mode 100644 app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Internationalstandard.php create mode 100644 app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Internationaltracked.php rename app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/{Specialdeliverynextday2500.php => Internationaltrackedsigned.php} (55%) rename app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/{Specialdelivery9am50.php => Specialdelivery9am.php} (89%) delete mode 100644 app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Specialdelivery9am1000.php rename app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/{Specialdeliverynextday500.php => Specialdeliverynextday.php} (88%) delete mode 100644 app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Specialdeliverynextday1000.php delete mode 100644 app/code/community/Meanbee/Royalmail/data/airmail_eu.csv delete mode 100644 app/code/community/Meanbee/Royalmail/data/airmail_rw1.csv delete mode 100644 app/code/community/Meanbee/Royalmail/data/airmail_rw2.csv delete mode 100644 app/code/community/Meanbee/Royalmail/data/airsure_eu.csv create mode 100644 app/code/community/Meanbee/Royalmail/data/internationaleconomy.csv create mode 100644 app/code/community/Meanbee/Royalmail/data/internationalstandard_europe.csv create mode 100644 app/code/community/Meanbee/Royalmail/data/internationalstandard_wz1.csv create mode 100644 app/code/community/Meanbee/Royalmail/data/internationalstandard_wz2.csv create mode 100644 app/code/community/Meanbee/Royalmail/data/internationaltracked_eu.csv create mode 100644 app/code/community/Meanbee/Royalmail/data/internationaltracked_noneu.csv create mode 100644 app/code/community/Meanbee/Royalmail/data/internationaltracked_wz1.csv create mode 100644 app/code/community/Meanbee/Royalmail/data/internationaltracked_wz2.csv delete mode 100644 app/code/community/Meanbee/Royalmail/data/surfacemail.csv diff --git a/app/code/community/Meanbee/Royalmail/Helper/Data.php b/app/code/community/Meanbee/Royalmail/Helper/Data.php index 6720490..dbe41ae 100644 --- a/app/code/community/Meanbee/Royalmail/Helper/Data.php +++ b/app/code/community/Meanbee/Royalmail/Helper/Data.php @@ -17,4 +17,71 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -class Meanbee_Royalmail_Helper_Data extends Mage_Core_Helper_Abstract {} +class Meanbee_Royalmail_Helper_Data extends Mage_Core_Helper_Abstract { + + public function addAdditionalCharges($rates, $charge, $weight, $chargePer = 250) { + for($i = 0; $i < count($rates); $i++) { + if($weight > $rates[$i]['upper']) { + $additional = ceil(((($weight - $rates[$i]['upper']) / $chargePer) * $charge * 100))/2; + $rates[$i]['cost'] += $additional; + } + } + return $rates; + } + + public function addInsuranceCharges($rates, $charge, $cartTotal, $valueOver = 50) { + if($cartTotal > $valueOver) { + for($i = 0; $i < count($rates); $i++) { + $rates[$i]['cost'] += $charge; + } + } + return $rates; + } + + public function getWorldZone($countryCode) { + $country = strtoupper($countryCode); + if ($country != 'GB') { + switch ($country) { + /** + * Countries defined by Royal Mail, but not by Magento. + * - Azores + * - Balearic Islands + * - Canary Islands + * - Corsica + * - Kosovo + * - Madeira + * - Belau + * - Norwegian Antarctic Territory + * + * Notes: Serbia and Montenegro = Serbia = Montenegro + * Notes: Cocos Islands = Keeling = COCOS (KEELING) ISLANDS + * Notes: MACAU = Macao + */ + case 'DK': case 'EE': case 'LV': case 'AT': case 'FI': + case 'LT': case 'SK': case 'FR': case 'LU': case 'SI': + case 'ES': case 'DE': case 'SE': case 'GI': case 'MT': + case 'BE': case 'GR': case 'MC': case 'BG': case 'HU': + case 'NL': case 'IE': case 'HR': case 'IT': case 'PL': + case 'CY': case 'PT': case 'CZ': case 'RO': + return 'eu'; + case 'SM': case 'AM': case 'FO': case 'LI': case 'RS': + case 'XK': case 'KZ': case 'VA': case 'NO': case 'UZ': + case 'UA': case 'ME': case 'TM': case 'IS': case 'TR': + case 'MD': case 'TJ': case 'BA': case 'GL': case 'CH': + case 'BY': case 'GE': case 'MK': case 'AZ': case 'KG': + case 'RU': case 'AD': case 'AL': + return 'noneu'; + case 'AU': case 'PW': case 'IO': case 'CX': case 'CC': + case 'CK': case 'FJ': case 'PF': case 'TF': case 'KI': + case 'MO': case 'NR': case 'NC': case 'NZ': case 'NU': + case 'NF': case 'PG': case 'LA': case 'PN': case 'SG': + case 'SB': case 'TK': case 'TO': case 'TV': case 'AS': + case 'WS': + return 'wz2'; + default: + return 'wz1'; + } + } + return null; + } +} diff --git a/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail.php b/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail.php index 5d73ae1..7ea7654 100644 --- a/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail.php +++ b/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail.php @@ -143,23 +143,15 @@ public function getMethods($name=null) { 'firstclass' => 'First Class Parcel', 'firstclassrecordedsignedfor' => 'First Class Parcel (Signed for)', - 'specialdeliverynextday500' => 'Special Delivery Guaranteed by 1pm (Up to 500GBP Insurance)', - 'specialdeliverynextday1000' => 'Special Delivery Guaranteed by 1pm (Up to 1,000GBP Insurance)', - 'specialdeliverynextday2500' => 'Special Delivery Guaranteed by 1pm (Up to 2,500GBP Insurance)', + 'specialdeliverynextday' => 'Special Delivery Guaranteed by 1pm (Up to 500GBP Insurance)', - 'specialdelivery9am50' => 'Special Delivery Guaranteed by 9am (Up to 50GBP Insurance)', - 'specialdelivery9am1000' => 'Special Delivery Guaranteed by 9am (Up to 1,000GBP Insurance)', - 'specialdelivery9am2500' => 'Special Delivery Guaranteed by 9am (Up to 2,500GBP Insurance)', + 'specialdelivery9am' => 'Special Delivery Guaranteed by 9am (Up to 2,500GBP Insurance)', - 'airmail' => 'Airmail', - - 'airsure' => 'Airsure (Up to 41GBP Insurance)', - 'airsureinsurance' => 'Airsure (Up to 250GBP/500GBP Insurance)', - - 'internationalsignedfor' => 'International Signed For', - 'internationalsignedforinsurance' => 'International Signed For (Up to 500GBP Insurance)', - - 'surfacemail' => 'Surface Mail' + 'internationalstandard' => 'International Standard (up to 5kg)', + 'internationaltrackedsigned' => 'International Tracked & Signed (Up to 250GBP Compensation)', + 'internationaltracked' => 'International Tracked (Up to 250GBP Compensation)', + 'internationalsigned' => 'International Signed (Up to 250GBP Compensation)', + 'internationaleconomy' => 'International Economy' ); if ($name !== null) { diff --git a/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Abstract.php b/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Abstract.php index 3b99d0d..c4c9f10 100644 --- a/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Abstract.php +++ b/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Abstract.php @@ -190,7 +190,6 @@ protected function _loadCsv($file) { $data = $parser->getData($filename); $return = array(); - if (count($data)) { foreach ($data as $key => $value) { list($upper, $cost) = $value; diff --git a/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Airmail.php b/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Airmail.php deleted file mode 100644 index 3a4214e..0000000 --- a/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Airmail.php +++ /dev/null @@ -1,140 +0,0 @@ -_loadCsv("airmail_eu"); - - return $rates_eu; - } - - /** - * Rest of the World Rates - * - * @return array rates - */ - protected function _getRw1Rates() { - $rates_rw = $this->_loadCsv("airmail_rw1"); - - return $rates_rw; - } - - /** - * Rest of the World Rates - * - * @return array rates - */ - protected function _getRw2Rates() { - $rates_rw = $this->_loadCsv("airmail_rw2"); - - return $rates_rw; - } - - /** - * Establish which rates to return - * - * @see http://www.royalmail.com/portal/rm/content3?catId=400036&mediaId=53600700 - * @return rates - */ - protected function getRates() { - $country = strtoupper($this->_getCountry()); - - if ($country != 'GB') { - switch ($this->getPostageArea()) { - case 'eu': - return $this->_getEuRates(); - case 'rw2': - return $this->_getRw2Rates(); - case 'rw1': - return $this->_getRw1Rates(); - } - - Mage::throwException('Invalid postage area'); - } - - return null; - } - - protected function getPostageArea() { - $country = strtoupper($this->_getCountry()); - - if ($country != 'GB') { - switch ($country) { - /** - * Countries defined by Royal Mail, but not by Magento. - * - * - Azores - * - Balearic Islands - * - Canary Islands - * - Corsica - * - Kosovo - * - Madeira - * - * - Belau - * - Norwegian Antarctic Territory - * - * Notes: Serbia and Montenegro = Serbia = Montenegro - * Notes: Cocos Islands = Keeling = COCOS (KEELING) ISLANDS - * Notes: MACAU = Macao - */ - case 'AL': case 'AD': case 'AM': case 'AT': case 'AZ': - case 'BY': case 'BE': case 'BA': case 'BG': - case 'HR': case 'CY': case 'CZ': - case 'DK': - case 'EE': - case 'FO': case 'FI': case 'FR': - case 'GE': case 'DE': case 'GI': case 'GR': case 'GL': - case 'HU': - case 'IS': case 'IE': case 'IT': - case 'KZ': case 'KG': - case 'LV': case 'LI': case 'LT': case 'LU': - case 'MK': case 'MT': case 'MD': case 'MC': case 'CS': - case 'NL': case 'NO': - case 'PL': case 'PT': - case 'RO': case 'RU': - case 'SM': case 'SK': case 'SI': case 'ES': case 'SE': case 'CH': - case 'TJ': case 'TR': case 'TM': case 'UA': case 'UZ': - case 'VA': - return 'eu'; - case 'AU': - case 'IO': - case 'CX': case 'CC': case 'CK': - case 'FJ': case 'PF': case 'TF': - case 'KI': - case 'MO': - case 'NR': case 'NC': case 'NZ': case 'NU': case 'NF': - case 'PG': case 'PN': - case 'SG': case 'SB': - case 'TK': case 'TO': case 'TV': case 'AS': case 'WS': - return 'rw2'; - default: - return 'rw1'; - } - } - - return null; - } -} diff --git a/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Airsure.php b/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Airsure.php deleted file mode 100644 index a787e6c..0000000 --- a/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Airsure.php +++ /dev/null @@ -1,73 +0,0 @@ -_validAirsureCountry()) { - for ($i = 0; $i < count($rates); $i++) { - $rates[$i]['cost'] += $this->_getExtraCharge(); - } - - return $rates; - } else { - return null; - } - } - - protected function _getExtraCharge() { - if ($this->getPostageArea() == 'eu') { - return 5.00; - } else { - return 5.40; - } - } - - /** - * @see http://www.royalmail.com/personal/international-delivery/airsure#faq-19350048-19350039 - * - * @return bool - */ - protected function _validAirsureCountry() { - $country = strtoupper($this->_getCountry()); - - switch($country) { - case 'AT': case 'BE': case 'DK': case 'EE': case 'FI': case 'FR': case 'DE': case 'LV': - case 'LU': case 'MT': case 'NL': case 'PT': case 'IE': case 'ES': case 'SE': - - case 'AD':case 'FO': case 'IS': case 'LI': case 'MC': case 'CH': - - case 'AU': case 'BR': case 'CA': case 'HK': case 'MY': case 'SG': case 'NZ': case 'US': - return true; - } - - return false; - } - - protected function _getMaximumCartTotal() { - return 50; - } -} diff --git a/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Airsureinsurance.php b/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Airsureinsurance.php deleted file mode 100644 index fcca724..0000000 --- a/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Airsureinsurance.php +++ /dev/null @@ -1,38 +0,0 @@ -getPostageArea() == 'eu') { - return 7.60; - } else { - return 8.00; - } - } - - protected function _getMinimumCartTotal() { - return 50.01; - } - - protected function _getMaximumCartTotal() { - return null; - } -} diff --git a/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Specialdelivery9am50.php b/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Internationaleconomy.php similarity index 67% rename from app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Specialdelivery9am50.php rename to app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Internationaleconomy.php index fb1cb11..eb636ff 100644 --- a/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Specialdelivery9am50.php +++ b/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Internationaleconomy.php @@ -13,25 +13,17 @@ * * @category Meanbee * @package Meanbee_Royalmail - * @copyright Copyright (c) 2008 Meanbee Internet Solutions (http://www.meanbee.com) + * @copyright Copyright (c) 2014 Meanbee Internet Solutions (http://www.meanbee.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -class Meanbee_Royalmail_Model_Shipping_Carrier_Royalmail_Specialdelivery9am50 +class Meanbee_Royalmail_Model_Shipping_Carrier_Royalmail_Internationaleconomy extends Meanbee_Royalmail_Model_Shipping_Carrier_Royalmail_Abstract { - protected function getRates() { - $rates = $this->_loadCsv('9am50'); - - if ($this->_getCountry() == 'GB') { - return $rates; + public function getRates() { + if($this->_getCountry() !== 'GB') { + return $this->_loadCsv('internationaleconomy'); } - return null; } - - - protected function _getMaximumCartTotal() { - return 50; - } -} +} \ No newline at end of file diff --git a/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Internationalsignedforinsurance.php b/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Internationalsigned.php similarity index 69% rename from app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Internationalsignedforinsurance.php rename to app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Internationalsigned.php index f476448..e40dbad 100644 --- a/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Internationalsignedforinsurance.php +++ b/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Internationalsigned.php @@ -13,22 +13,9 @@ * * @category Meanbee * @package Meanbee_Royalmail - * @copyright Copyright (c) 2008 Meanbee Internet Solutions (http://www.meanbee.com) + * @copyright Copyright (c) 2014 Meanbee Internet Solutions (http://www.meanbee.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -class Meanbee_Royalmail_Model_Shipping_Carrier_Royalmail_Internationalsignedforinsurance - extends Meanbee_Royalmail_Model_Shipping_Carrier_Royalmail_Internationalsignedfor { - - protected function _getExtraCharge() { - return 7.90; - } - - protected function _getMinimumCartTotal() { - return 250.01; - } - - protected function _getMaximumCartTotal() { - return null; - } -} +class Meanbee_Royalmail_Model_Shipping_Carrier_Royalmail_Internationalsigned + extends Meanbee_Royalmail_Model_Shipping_Carrier_Royalmail_Internationaltrackedsigned { } \ No newline at end of file diff --git a/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Internationalstandard.php b/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Internationalstandard.php new file mode 100644 index 0000000..6e34a51 --- /dev/null +++ b/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Internationalstandard.php @@ -0,0 +1,87 @@ +_getCountry(); + $worldZone = $_helper->getWorldZone($country); + $weight = $this->_getWeight(); + + if($weight > $this->maxWeight) { + return null; + } + if($country != 'GB') { + switch($worldZone) { + case 'eu': + case 'noneu': + $rates = $_helper->addAdditionalCharges( + $this->_getEuropeRates(), + $this->additionalChargeEurope, + $weight + ); + break; + case 'wz1': + $rates = $_helper->addAdditionalCharges( + $this->_getWz1Rates(), + $this->additionalChargeWz1, + $weight + ); + break; + case 'wz2': + $rates = $_helper->addAdditionalCharges( + $this->_getWz2Rates(), + $this->additionalChargeWz2, + $weight + ); + break; + } + return $rates; + } + + return null; + } + + public function calculateRate($weight) { + if($weight <= $this->maxWeight) { + $rates = $this->getRates(); + return $rates[count($rates)-1]['cost']; + } + return null; + } + + protected function _getEuropeRates() { + return $this->_loadCsv('internationalstandard_europe'); + } + + protected function _getWz1Rates() { + return $this->_loadCsv('internationalstandard_wz1'); + } + + protected function _getWz2Rates() { + return $this->_loadCsv('internationalstandard_wz2'); + } +} diff --git a/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Internationaltracked.php b/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Internationaltracked.php new file mode 100644 index 0000000..9bcbf44 --- /dev/null +++ b/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Internationaltracked.php @@ -0,0 +1,123 @@ +_getCountry(); + $worldZone = $_helper->getWorldZone($country); + $weight = $this->_getWeight(); + + if($weight > $this->maxWeight) { + return null; + } + + if($country != 'GB') { + switch($worldZone) { + case 'eu': + $rates = $_helper->addAdditionalCharges( + $_helper->addInsuranceCharges( + $this->_getEuRates(), + $this->additionalInsuranceChargeEu, + $this->getCartTotal(), + $this->insureOver + ), + $this->additionalChargeEu, + $weight + ); + break; + case 'noneu': + $rates = $_helper->addAdditionalCharges( + $_helper->addInsuranceCharges( + $this->_getNonEuRates(), + $this->additionalInsuranceChargeNonEu, + $this->getCartTotal(), + $this->insureOver + ), + $this->additionalChargeNonEu, + $weight + ); + break; + case 'wz1': + $rates = $_helper->addAdditionalCharges( + $_helper->addInsuranceCharges( + $this->_getWz1Rates(), + $this->additionalInsuranceChargeWz1, + $this->getCartTotal(), + $this->insureOver + ), + $this->additionalChargeWz1, + $weight + ); + break; + case 'wz2': + $rates = $_helper->addAdditionalCharges( + $_helper->addInsuranceCharges( + $this->_getWz2Rates(), + $this->additionalInsuranceChargeWz2, + $this->getCartTotal(), + $this->insureOver + ), + $this->additionalChargeWz2, + $weight + ); + break; + } + return $rates; + } + return null; + } + + public function calculateRate($weight) { + if($weight <= $this->maxWeight) { + $rates = $this->getRates(); + return $rates[count($rates)-1]['cost']; + } + return null; + } + + protected function _getEuRates() { + return $this->_loadCsv('internationaltracked_eu'); + } + + protected function _getNonEuRates() { + return $this->_loadCsv('internationaltracked_noneu'); + } + + protected function _getWz1Rates() { + return $this->_loadCsv('internationaltracked_wz1'); + } + + protected function _getWz2Rates() { + return $this->_loadCsv('internationaltracked_wz2'); + } +} \ No newline at end of file diff --git a/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Internationalsignedfor.php b/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Internationaltrackedsigned.php similarity index 57% rename from app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Internationalsignedfor.php rename to app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Internationaltrackedsigned.php index 9822bc9..1445bfb 100644 --- a/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Internationalsignedfor.php +++ b/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Internationaltrackedsigned.php @@ -13,32 +13,25 @@ * * @category Meanbee * @package Meanbee_Royalmail - * @copyright Copyright (c) 2008 Meanbee Internet Solutions (http://www.meanbee.com) + * @copyright Copyright (c) 2014 Meanbee Internet Solutions (http://www.meanbee.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -class Meanbee_Royalmail_Model_Shipping_Carrier_Royalmail_Internationalsignedfor - extends Meanbee_Royalmail_Model_Shipping_Carrier_Royalmail_Airmail { +class Meanbee_Royalmail_Model_Shipping_Carrier_Royalmail_Internationaltrackedsigned + extends Meanbee_Royalmail_Model_Shipping_Carrier_Royalmail_Internationalstandard { - protected function getRates() { - $rates = parent::getRates(); + protected $insureOver = 50; + protected $additionalInsuranceCharge = 2.50; - if ($rates == null) { - return null; - } + public function getRates() { + $rates = parent::getRates(); - for ($i = 0; $i < count($rates); $i++) { - $rates[$i]['cost'] += $this->_getExtraCharge(); + if($rates !== null) { + $rates = Mage::helper('royalmail')->addInsuranceCharges($rates, $this->additionalInsuranceCharge, $this->getCartTotal(), $this->insureOver); + for($i = 0; $i < count($rates); $i++) { + $rates[$i]['cost'] += 5; + } } - return $rates; } - - protected function _getExtraCharge() { - return 5.30; - } - - protected function _getMaximumCartTotal() { - return 250; - } -} +} \ No newline at end of file diff --git a/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Specialdelivery9am2500.php b/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Specialdelivery9am.php similarity index 71% rename from app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Specialdelivery9am2500.php rename to app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Specialdelivery9am.php index b4c2de8..10c1f1d 100644 --- a/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Specialdelivery9am2500.php +++ b/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Specialdelivery9am.php @@ -17,11 +17,11 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -class Meanbee_Royalmail_Model_Shipping_Carrier_Royalmail_Specialdelivery9am2500 +class Meanbee_Royalmail_Model_Shipping_Carrier_Royalmail_Specialdelivery9am extends Meanbee_Royalmail_Model_Shipping_Carrier_Royalmail_Abstract { protected function getRates() { - $rates = $this->_loadCsv('9am2500'); + $rates = $this->_getRatesCsv(); if ($this->_getCountry() == 'GB') { return $rates; @@ -30,7 +30,15 @@ protected function getRates() { return null; } - protected function _getMinimumCartTotal() { - return 1000.01; + protected function _getRatesCsv() { + $total = $this->getCartTotal(); + if ($total <= 50) { + return $this->_loadCsv('9am50'); + } else if ($total <= 1000) { + return $this->_loadCsv('9am1000'); + } else if ($total <= 2500) { + return $this->_loadCsv('9am2500'); + } + return null; } } diff --git a/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Specialdelivery9am1000.php b/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Specialdeliverynextday.php similarity index 70% rename from app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Specialdelivery9am1000.php rename to app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Specialdeliverynextday.php index 533f5d1..defab3f 100644 --- a/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Specialdelivery9am1000.php +++ b/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Specialdeliverynextday.php @@ -17,11 +17,11 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -class Meanbee_Royalmail_Model_Shipping_Carrier_Royalmail_Specialdelivery9am1000 +class Meanbee_Royalmail_Model_Shipping_Carrier_Royalmail_Specialdeliverynextday extends Meanbee_Royalmail_Model_Shipping_Carrier_Royalmail_Abstract { protected function getRates() { - $rates = $this->_loadCsv('9am1000'); + $rates = $this->_getRatesCsv(); if ($this->_getCountry() == 'GB') { return $rates; @@ -30,11 +30,15 @@ protected function getRates() { return null; } - protected function _getMinimumCartTotal() { - return 50.01; - } - - protected function _getMaximumCartTotal() { - return 1000; + protected function _getRatesCsv() { + $total = $this->getCartTotal(); + if ($total <= 50) { + return $this->_loadCsv('nextday500'); + } else if ($total <= 1000) { + return $this->_loadCsv('nextday1000'); + } else if ($total <= 2500) { + return $this->_loadCsv('nextday2500'); + } + return null; } -} +} \ No newline at end of file diff --git a/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Specialdeliverynextday1000.php b/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Specialdeliverynextday1000.php deleted file mode 100644 index 6a5535e..0000000 --- a/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Specialdeliverynextday1000.php +++ /dev/null @@ -1,40 +0,0 @@ -_loadCsv('nextday1000'); - - if ($this->_getCountry() == 'GB') { - return $rates; - } - - return null; - } - - protected function _getMinimumCartTotal() { - return 500.01; - } - - protected function _getMaximumCartTotal() { - return 1000; - } -} diff --git a/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Specialdeliverynextday2500.php b/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Specialdeliverynextday2500.php deleted file mode 100644 index 8637f53..0000000 --- a/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Specialdeliverynextday2500.php +++ /dev/null @@ -1,36 +0,0 @@ -_loadCsv('nextday2500'); - - if ($this->_getCountry() == 'GB') { - return $rates; - } - - return null; - } - - protected function _getMinimumCartTotal() { - return 1000.01; - } -} diff --git a/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Specialdeliverynextday500.php b/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Specialdeliverynextday500.php deleted file mode 100644 index 9a42ae5..0000000 --- a/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Specialdeliverynextday500.php +++ /dev/null @@ -1,36 +0,0 @@ -_loadCsv('nextday500'); - - if ($this->_getCountry() == 'GB') { - return $rates; - } - - return null; - } - - protected function _getMaximumCartTotal() { - return 500; - } -} diff --git a/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Surfacemail.php b/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Surfacemail.php deleted file mode 100644 index e9a9061..0000000 --- a/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Surfacemail.php +++ /dev/null @@ -1,38 +0,0 @@ -_getCountry()); - - if ($country != 'GB') { - return $this->_loadCsv('surfacemail'); - } - - return null; - } -} diff --git a/app/code/community/Meanbee/Royalmail/Test/Helper/Data.php b/app/code/community/Meanbee/Royalmail/Test/Helper/Data.php new file mode 100644 index 0000000..b3d9bbc --- /dev/null +++ b/app/code/community/Meanbee/Royalmail/Test/Helper/Data.php @@ -0,0 +1 @@ +_model = Mage::getModel('royalmail/shipping_carrier_royalmail_airmail'); - } - - public function tearDown() { - parent::tearDown(); - - $this->_model = null; - } - - public function testNotAllowedFromUk() { - $this->assertNull( - $this->_model->getCost($this->_getRateRequest( - 50, - 1.00, - 'GB' - )), - 'Airmail is not allowed for UK deliveries' - ); - } - - public function testEuropeUpperLimit() { - $this->assertEquals( - 13.65, - $this->_model->getCost($this->_getRateRequest( - 2000, - 1.00, - 'FR' - )) - ); - - $this->assertNull( - $this->_model->getCost($this->_getRateRequest( - 2001, - 1.00, - 'FR' - )) - ); - } - - public function testRestOfWorld1UpperLimit() { - $this->assertEquals( - 23.40, - $this->_model->getCost($this->_getRateRequest( - 2000, - 1.00, - 'US' - )) - ); - - $this->assertNull( - $this->_model->getCost($this->_getRateRequest( - 2001, - 1.00, - 'US' - )) - ); - } - - public function testRestOfWorld2UpperLimit() { - $this->assertEquals( - 24.65, - $this->_model->getCost($this->_getRateRequest( - 2000, - 1.00, - 'NZ' - )) - ); - - $this->assertNull( - $this->_model->getCost($this->_getRateRequest( - 2001, - 1.00, - 'NZ' - )) - ); - } -} diff --git a/app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Airsure.php b/app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Airsure.php deleted file mode 100644 index 75a8a94..0000000 --- a/app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Airsure.php +++ /dev/null @@ -1,85 +0,0 @@ -_model = Mage::getModel('royalmail/shipping_carrier_royalmail_airsure'); - } - - public function tearDown() { - parent::tearDown(); - - $this->_model = null; - } - - public function testNotAllowedFromUk() { - $this->assertNull( - $this->_model->getCost($this->_getRateRequest( - 50, - 1.00, - 'GB' - )), - 'Airmail is not allowed for UK deliveries' - ); - } - - public function testEuropeUpperLimit() { - $this->assertEquals( - 13.65 + 5, - $this->_model->getCost($this->_getRateRequest( - 2000, - 1.00, - 'FR' - )) - ); - - $this->assertNull( - $this->_model->getCost($this->_getRateRequest( - 2001, - 1.00, - 'FR' - )) - ); - } - - public function testRestOfWorld1UpperLimit() { - $this->assertEquals( - 23.40 + 5.40, - $this->_model->getCost($this->_getRateRequest( - 2000, - 1.00, - 'US' - )) - ); - - $this->assertNull( - $this->_model->getCost($this->_getRateRequest( - 2001, - 1.00, - 'US' - )) - ); - } - - public function testRestOfWorld2UpperLimit() { - $this->assertEquals( - 24.65 + 5.40, - $this->_model->getCost($this->_getRateRequest( - 2000, - 1.00, - 'NZ' - )) - ); - - $this->assertNull( - $this->_model->getCost($this->_getRateRequest( - 2001, - 1.00, - 'NZ' - )) - ); - } -} diff --git a/app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Airsureinsurance.php b/app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Airsureinsurance.php deleted file mode 100644 index bb71815..0000000 --- a/app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Airsureinsurance.php +++ /dev/null @@ -1,93 +0,0 @@ -_model = Mage::getModel('royalmail/shipping_carrier_royalmail_airsureinsurance'); - } - - public function tearDown() { - parent::tearDown(); - - $this->_model = null; - } - - public function testNotAllowedFromUk() { - $this->assertNull( - $this->_model->getCost($this->_getRateRequest( - 50, - 100.00, - 'GB' - )), - 'Airmail is not allowed for UK deliveries' - ); - } - - public function testEuropeUpperLimit() { - $this->assertEquals( - 13.65 + 7.60, - $this->_model->getCost($this->_getRateRequest( - 2000, - 100.00, - 'FR' - )) - ); - - $this->assertNull( - $this->_model->getCost($this->_getRateRequest( - 2001, - 100.00, - 'FR' - )) - ); - } - - public function testRestOfWorld1UpperLimit() { - $this->assertEquals( - 23.40 + 8, - $this->_model->getCost($this->_getRateRequest( - 2000, - 100.00, - 'US' - )) - ); - - $this->assertNull( - $this->_model->getCost($this->_getRateRequest( - 2001, - 100.00, - 'US' - )) - ); - } - - public function testRestOfWorld2UpperLimit() { - $this->assertEquals( - 24.65 + 8, - $this->_model->getCost($this->_getRateRequest( - 2000, - 100.00, - 'NZ' - )) - ); - - $this->assertNull( - $this->_model->getCost($this->_getRateRequest( - 2001, - 100.00, - 'NZ' - )) - ); - } - - public function testMinimalCartValue() { - $this->markTestSkipped('Needs implementation'); - } - - public function testMaximumCartValue() { - $this->markTestSkipped('Needs implementation'); - } -} diff --git a/app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Firstclass.php b/app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Firstclass.php index 3ecec63..ce9691d 100644 --- a/app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Firstclass.php +++ b/app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Firstclass.php @@ -40,7 +40,7 @@ public function testMinimalPrice() { public function testUpperLimit() { $this->assertEquals( - 32.40, + 33.40, $this->_model->getCost( $this->_getRateRequest( 20000, diff --git a/app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Firstclassrecordedsignedfor.php b/app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Firstclassrecordedsignedfor.php index 0e5260c..7702493 100644 --- a/app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Firstclassrecordedsignedfor.php +++ b/app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Firstclassrecordedsignedfor.php @@ -40,7 +40,7 @@ public function testMinimalPrice() { public function testUpperLimit() { $this->assertEquals( - 33.50, + 34.50, $this->_model->getCost( $this->_getRateRequest( 20000, diff --git a/app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Specialdelivery9am2500.php b/app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Internationaleconomy.php similarity index 58% rename from app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Specialdelivery9am2500.php rename to app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Internationaleconomy.php index 9f8689a..1f7e621 100644 --- a/app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Specialdelivery9am2500.php +++ b/app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Internationaleconomy.php @@ -1,12 +1,12 @@ _model = Mage::getModel('royalmail/shipping_carrier_royalmail_specialdelivery9am2500'); + $this->_model = Mage::getModel('royalmail/shipping_carrier_royalmail_internationaleconomy'); } public function tearDown() { @@ -15,36 +15,24 @@ public function tearDown() { $this->_model = null; } - public function testNotAllowedFromFrance() { + public function testNotAllowedFromGb() { $this->assertNull( $this->_model->getCost($this->_getRateRequest( 50, - 2500.00, - 'FR' + 1.00, + 'GB' )) ); } - public function testMinimalBasketValue() { - $this->assertNotNull( - $this->_model->getCost( - $this->_getRateRequest( - 50, - 2500, - 'GB' - ) - ) - ); - } - public function testMinimalPrice() { $this->assertEquals( - 17.64 + 5.70, + 2.80, $this->_model->getCost( $this->_getRateRequest( 50, - 2500.00, - 'GB' + 1.00, + 'FR' ) ) ); @@ -52,12 +40,12 @@ public function testMinimalPrice() { public function testUpperLimit() { $this->assertEquals( - 26.16 + 5.70, + 13.80, $this->_model->getCost( $this->_getRateRequest( 2000, - 3000.00, - 'GB' + 1.00, + 'FR' ) ) ); @@ -65,8 +53,8 @@ public function testUpperLimit() { $this->assertNull( $this->_model->getCost($this->_getRateRequest( 2001, - 3000.00, - 'GB' + 1.00, + 'FR' )) ); } diff --git a/app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Internationalsigned.php b/app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Internationalsigned.php new file mode 100644 index 0000000..30a7edb --- /dev/null +++ b/app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Internationalsigned.php @@ -0,0 +1,85 @@ +_model = Mage::getModel('royalmail/shipping_carrier_royalmail_internationalsigned'); + } + + public function tearDown() { + parent::tearDown(); + + $this->_model = null; + } + + public function testAllowedFromFrance() { + $this->assertEquals( + 8.20, + $this->_model->getCost($this->_getRateRequest( + 100, + 1.00, + 'FR' + )) + ); + } + + public function testNotAllowedFromUnitedKingdom() { + $this->assertNull( + $this->_model->getCost($this->_getRateRequest( + 100, + 1.00, + 'GB' + )) + ); + } + + public function testMinimalPrice() { + $this->assertEquals( + 8.20, + $this->_model->getCost( + $this->_getRateRequest( + 50, + 1.00, + 'FR' + ) + ) + ); + } + + public function testUpperLimit() { + $this->assertEquals( + 18.85, + $this->_model->getCost( + $this->_getRateRequest( + 2000, + 1.00, + 'FR' + ) + ) + ); + + $this->assertNull( + $this->_model->getCost($this->_getRateRequest( + 5001, + 1.00, + 'FR' + )) + ); + } + + public function testAdditionalInsuranceCharge() { + $this->assertEquals( + 21.35, + $this->_model->getCost( + $this->_getRateRequest( + 2000, + 100.00, + 'FR' + ) + ) + ); + } +} diff --git a/app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Internationalsignedfor.php b/app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Internationalsignedfor.php deleted file mode 100644 index 7d6a931..0000000 --- a/app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Internationalsignedfor.php +++ /dev/null @@ -1,85 +0,0 @@ -_model = Mage::getModel('royalmail/shipping_carrier_royalmail_internationalsignedfor'); - } - - public function tearDown() { - parent::tearDown(); - - $this->_model = null; - } - - public function testNotAllowedFromUk() { - $this->assertNull( - $this->_model->getCost($this->_getRateRequest( - 50, - 1.00, - 'GB' - )), - 'Airmail is not allowed for UK deliveries' - ); - } - - public function testEuropeUpperLimit() { - $this->assertEquals( - 13.65 + 5.30, - $this->_model->getCost($this->_getRateRequest( - 2000, - 1.00, - 'FR' - )) - ); - - $this->assertNull( - $this->_model->getCost($this->_getRateRequest( - 2001, - 1.00, - 'FR' - )) - ); - } - - public function testRestOfWorld1UpperLimit() { - $this->assertEquals( - 23.40 + 5.30, - $this->_model->getCost($this->_getRateRequest( - 2000, - 1.00, - 'US' - )) - ); - - $this->assertNull( - $this->_model->getCost($this->_getRateRequest( - 2001, - 1.00, - 'US' - )) - ); - } - - public function testRestOfWorld2UpperLimit() { - $this->assertEquals( - 24.65 + 5.30, - $this->_model->getCost($this->_getRateRequest( - 2000, - 1.00, - 'NZ' - )) - ); - - $this->assertNull( - $this->_model->getCost($this->_getRateRequest( - 2001, - 1.00, - 'NZ' - )) - ); - } -} diff --git a/app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Internationalsignedforinsurance.php b/app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Internationalsignedforinsurance.php deleted file mode 100644 index d3deb30..0000000 --- a/app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Internationalsignedforinsurance.php +++ /dev/null @@ -1,85 +0,0 @@ -_model = Mage::getModel('royalmail/shipping_carrier_royalmail_internationalsignedforinsurance'); - } - - public function tearDown() { - parent::tearDown(); - - $this->_model = null; - } - - public function testNotAllowedFromUk() { - $this->assertNull( - $this->_model->getCost($this->_getRateRequest( - 50, - 1.00, - 'GB' - )), - 'Airmail is not allowed for UK deliveries' - ); - } - - public function testEuropeUpperLimit() { - $this->assertEquals( - 13.65 + 7.90, - $this->_model->getCost($this->_getRateRequest( - 2000, - 350, - 'FR' - )) - ); - - $this->assertNull( - $this->_model->getCost($this->_getRateRequest( - 2001, - 350, - 'FR' - )) - ); - } - - public function testRestOfWorld1UpperLimit() { - $this->assertEquals( - 23.40 + 7.90, - $this->_model->getCost($this->_getRateRequest( - 2000, - 350, - 'US' - )) - ); - - $this->assertNull( - $this->_model->getCost($this->_getRateRequest( - 2001, - 350, - 'US' - )) - ); - } - - public function testRestOfWorld2UpperLimit() { - $this->assertEquals( - 24.65 + 7.90, - $this->_model->getCost($this->_getRateRequest( - 2000, - 350, - 'NZ' - )) - ); - - $this->assertNull( - $this->_model->getCost($this->_getRateRequest( - 2001, - 350, - 'NZ' - )) - ); - } -} diff --git a/app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Internationalstandard.php b/app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Internationalstandard.php new file mode 100644 index 0000000..0e6b0ca --- /dev/null +++ b/app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Internationalstandard.php @@ -0,0 +1,72 @@ +_model = Mage::getModel('royalmail/shipping_carrier_royalmail_internationalstandard'); + } + + public function tearDown() { + parent::tearDown(); + + $this->_model = null; + } + + public function testAllowedFromFrance() { + $this->assertEquals( + 3.20, + $this->_model->getCost($this->_getRateRequest( + 100, + 1.00, + 'FR' + )) + ); + } + + public function testNotAllowedFromUnitedKingdom() { + $this->assertNull( + $this->_model->getCost($this->_getRateRequest( + 100, + 1.00, + 'GB' + )) + ); + } + + public function testMinimalPrice() { + $this->assertEquals( + 3.20, + $this->_model->getCost( + $this->_getRateRequest( + 50, + 1.00, + 'FR' + ) + ) + ); + } + + public function testUpperLimit() { + $this->assertEquals( + 13.85, + $this->_model->getCost( + $this->_getRateRequest( + 2000, + 1.00, + 'FR' + ) + ) + ); + + $this->assertNull( + $this->_model->getCost($this->_getRateRequest( + 5001, + 1.00, + 'FR' + )) + ); + } +} diff --git a/app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Internationaltracked.php b/app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Internationaltracked.php new file mode 100644 index 0000000..a644aae --- /dev/null +++ b/app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Internationaltracked.php @@ -0,0 +1,83 @@ +_model = Mage::getModel('royalmail/shipping_carrier_royalmail_internationaltracked'); + } + + public function tearDown() { + parent::tearDown(); + + $this->_model = null; + } + + public function testAllowedFromFrance() { + $this->assertEquals( + 9.84, + $this->_model->getCost($this->_getRateRequest( + 100, + 1.00, + 'FR' + )) + ); + } + + public function testAllowedFromNonEuCountry() { + $this->assertEquals( + 8.20, + $this->_model->getCost($this->_getRateRequest( + 100, + 1.00, + 'AM' + )) + ); + } + + public function testNotAllowedFromUnitedKingdom() { + $this->assertNull( + $this->_model->getCost($this->_getRateRequest( + 100, + 1.00, + 'GB' + )) + ); + } + + public function testMinimalPrice() { + $this->assertEquals( + 9.84, + $this->_model->getCost( + $this->_getRateRequest( + 50, + 1.00, + 'FR' + ) + ) + ); + } + + public function testUpperLimit() { + $this->assertEquals( + 22.62, + $this->_model->getCost( + $this->_getRateRequest( + 2000, + 1.00, + 'FR' + ) + ) + ); + + $this->assertNull( + $this->_model->getCost($this->_getRateRequest( + 5001, + 1.00, + 'FR' + )) + ); + } +} diff --git a/app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Specialdeliverynextday2500.php b/app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Internationaltrackedsigned.php similarity index 55% rename from app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Specialdeliverynextday2500.php rename to app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Internationaltrackedsigned.php index d1fe348..2d64cd5 100644 --- a/app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Specialdeliverynextday2500.php +++ b/app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Internationaltrackedsigned.php @@ -1,12 +1,12 @@ _model = Mage::getModel('royalmail/shipping_carrier_royalmail_specialdeliverynextday2500'); + $this->_model = Mage::getModel('royalmail/shipping_carrier_royalmail_internationaltrackedsigned'); } public function tearDown() { @@ -15,46 +15,35 @@ public function tearDown() { $this->_model = null; } - public function testNotAllowedFromFrance() { - $this->assertNull( + public function testAllowedFromFrance() { + $this->assertEquals( + 8.20, $this->_model->getCost($this->_getRateRequest( - 50, + 100, 1.00, 'FR' )) ); } - public function testMinimumBasketValue() { + public function testNotAllowedFromUnitedKingdom() { $this->assertNull( - $this->_model->getCost( - $this->_getRateRequest( - 50, - 1000.00, - 'GB' - ) - ) - ); - - $this->assertNotNull( - $this->_model->getCost( - $this->_getRateRequest( - 50, - 1000.01, - 'GB' - ) - ) + $this->_model->getCost($this->_getRateRequest( + 100, + 1.00, + 'GB' + )) ); } - public function testLowerLimit() { + public function testMinimalPrice() { $this->assertEquals( - 8.22, + 8.20, $this->_model->getCost( $this->_getRateRequest( 50, - 1500.00, - 'GB' + 1.00, + 'FR' ) ) ); @@ -62,22 +51,35 @@ public function testLowerLimit() { public function testUpperLimit() { $this->assertEquals( - 42.00, + 18.85, $this->_model->getCost( $this->_getRateRequest( - 20000, - 1500.00, - 'GB' + 2000, + 1.00, + 'FR' ) ) ); $this->assertNull( $this->_model->getCost($this->_getRateRequest( - 20001, - 1500.00, - 'GB' + 5001, + 1.00, + 'FR' )) ); } + + public function testAdditionalInsuranceCharge() { + $this->assertEquals( + 21.35, + $this->_model->getCost( + $this->_getRateRequest( + 2000, + 100.00, + 'FR' + ) + ) + ); + } } diff --git a/app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Largeletter.php b/app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Largeletter.php index 115d1b1..8037819 100644 --- a/app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Largeletter.php +++ b/app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Largeletter.php @@ -27,7 +27,7 @@ public function testNotAllowedFromFrance() { public function testMinimalPrice() { $this->assertEquals( - 0.90, + 0.93, $this->_model->getCost( $this->_getRateRequest( 50, @@ -40,7 +40,7 @@ public function testMinimalPrice() { public function testUpperLimit() { $this->assertEquals( - 2.30, + 2.38, $this->_model->getCost( $this->_getRateRequest( 750, diff --git a/app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Letter.php b/app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Letter.php index c4ee11d..cbcdbcd 100644 --- a/app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Letter.php +++ b/app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Letter.php @@ -27,7 +27,7 @@ public function testNotAllowedFromFrance() { public function testMinimalPrice() { $this->assertEquals( - 0.60, + 0.62, $this->_model->getCost( $this->_getRateRequest( 50, @@ -40,7 +40,7 @@ public function testMinimalPrice() { public function testUpperLimit() { $this->assertEquals( - 0.60, + 0.62, $this->_model->getCost( $this->_getRateRequest( 100, diff --git a/app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Secondclass.php b/app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Secondclass.php index b3f5181..a37073b 100644 --- a/app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Secondclass.php +++ b/app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Secondclass.php @@ -40,7 +40,7 @@ public function testMinimalPrice() { public function testUpperLimit() { $this->assertEquals( - 27.70, + 28.55, $this->_model->getCost( $this->_getRateRequest( 20000, diff --git a/app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Secondclassrecordedsignedfor.php b/app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Secondclassrecordedsignedfor.php index 9982063..710e672 100644 --- a/app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Secondclassrecordedsignedfor.php +++ b/app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Secondclassrecordedsignedfor.php @@ -40,7 +40,7 @@ public function testMinimalPrice() { public function testUpperLimit() { $this->assertEquals( - 28.80, + 29.65, $this->_model->getCost( $this->_getRateRequest( 20000, diff --git a/app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Specialdelivery9am50.php b/app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Specialdelivery9am.php similarity index 89% rename from app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Specialdelivery9am50.php rename to app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Specialdelivery9am.php index e867563..b4d0574 100644 --- a/app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Specialdelivery9am50.php +++ b/app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Specialdelivery9am.php @@ -1,12 +1,12 @@ _model = Mage::getModel('royalmail/shipping_carrier_royalmail_specialdelivery9am50'); + $this->_model = Mage::getModel('royalmail/shipping_carrier_royalmail_specialdelivery9am'); } public function tearDown() { @@ -30,7 +30,7 @@ public function testMaximumBasketValue() { $this->_model->getCost( $this->_getRateRequest( 50, - 50.01, + 2500.01, 'GB' ) ) @@ -49,7 +49,7 @@ public function testMaximumBasketValue() { public function testMinimalPrice() { $this->assertEquals( - 17.64, + 18.18, $this->_model->getCost( $this->_getRateRequest( 50, @@ -62,7 +62,7 @@ public function testMinimalPrice() { public function testUpperLimit() { $this->assertEquals( - 26.16, + 26.94, $this->_model->getCost( $this->_getRateRequest( 2000, diff --git a/app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Specialdelivery9am1000.php b/app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Specialdelivery9am1000.php deleted file mode 100644 index 7d9bd83..0000000 --- a/app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Specialdelivery9am1000.php +++ /dev/null @@ -1,105 +0,0 @@ -_model = Mage::getModel('royalmail/shipping_carrier_royalmail_specialdelivery9am1000'); - } - - public function tearDown() { - parent::tearDown(); - - $this->_model = null; - } - - public function testNotAllowedFromFrance() { - $this->assertNull( - $this->_model->getCost($this->_getRateRequest( - 50, - 1500, - 'FR' - )) - ); - } - - public function testMinimalBasketValue() { - $this->assertNull( - $this->_model->getCost( - $this->_getRateRequest( - 50, - 50.00, - 'GB' - ) - ) - ); - - $this->assertNotNull( - $this->_model->getCost( - $this->_getRateRequest( - 50, - 50.01, - 'GB' - ) - ) - ); - } - - public function testMaximumBasketValue() { - $this->assertNull( - $this->_model->getCost( - $this->_getRateRequest( - 50, - 1000.01, - 'GB' - ) - ) - ); - - $this->assertNotNull( - $this->_model->getCost( - $this->_getRateRequest( - 50, - 1000.00, - 'GB' - ) - ) - ); - } - - public function testMinimalPrice() { - $this->assertEquals( - 17.64 + 2.20, - $this->_model->getCost( - $this->_getRateRequest( - 50, - 500, - 'GB' - ) - ) - ); - } - - public function testUpperLimit() { - $this->assertEquals( - 26.16 + 2.20, - $this->_model->getCost( - $this->_getRateRequest( - 2000, - 500, - 'GB' - ) - ) - ); - - $this->assertNull( - $this->_model->getCost($this->_getRateRequest( - 2001, - 500, - 'GB' - )) - ); - } -} diff --git a/app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Specialdeliverynextday500.php b/app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Specialdeliverynextday.php similarity index 88% rename from app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Specialdeliverynextday500.php rename to app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Specialdeliverynextday.php index 2d7821e..87e6990 100644 --- a/app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Specialdeliverynextday500.php +++ b/app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Specialdeliverynextday.php @@ -1,12 +1,12 @@ _model = Mage::getModel('royalmail/shipping_carrier_royalmail_specialdeliverynextday500'); + $this->_model = Mage::getModel('royalmail/shipping_carrier_royalmail_specialdeliverynextday'); } public function tearDown() { @@ -30,7 +30,7 @@ public function testMaximumBasketValue() { $this->_model->getCost( $this->_getRateRequest( 50, - 500.01, + 2500.01, 'GB' ) ) @@ -49,7 +49,7 @@ public function testMaximumBasketValue() { public function testLowerLimit() { $this->assertEquals( - 6.22, + 6.40, $this->_model->getCost( $this->_getRateRequest( 50, @@ -62,7 +62,7 @@ public function testLowerLimit() { public function testUpperLimit() { $this->assertEquals( - 40.00, + 41.20, $this->_model->getCost( $this->_getRateRequest( 20000, diff --git a/app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Specialdeliverynextday1000.php b/app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Specialdeliverynextday1000.php deleted file mode 100644 index 776ed07..0000000 --- a/app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Specialdeliverynextday1000.php +++ /dev/null @@ -1,105 +0,0 @@ -_model = Mage::getModel('royalmail/shipping_carrier_royalmail_specialdeliverynextday1000'); - } - - public function tearDown() { - parent::tearDown(); - - $this->_model = null; - } - - public function testNotAllowedFromFrance() { - $this->assertNull( - $this->_model->getCost($this->_getRateRequest( - 50, - 1.00, - 'FR' - )) - ); - } - - public function testMinimumBasketValue() { - $this->assertNull( - $this->_model->getCost( - $this->_getRateRequest( - 50, - 500.00, - 'GB' - ) - ) - ); - - $this->assertNotNull( - $this->_model->getCost( - $this->_getRateRequest( - 50, - 500.01, - 'GB' - ) - ) - ); - } - - public function testMaximumBasketValue() { - $this->assertNull( - $this->_model->getCost( - $this->_getRateRequest( - 50, - 1000.01, - 'GB' - ) - ) - ); - - $this->assertNotNull( - $this->_model->getCost( - $this->_getRateRequest( - 50, - 1000.00, - 'GB' - ) - ) - ); - } - - public function testLowerLimit() { - $this->assertEquals( - 7.22, - $this->_model->getCost( - $this->_getRateRequest( - 50, - 750.00, - 'GB' - ) - ) - ); - } - - public function testUpperLimit() { - $this->assertEquals( - 41.00, - $this->_model->getCost( - $this->_getRateRequest( - 20000, - 750.00, - 'GB' - ) - ) - ); - - $this->assertNull( - $this->_model->getCost($this->_getRateRequest( - 20001, - 750.00, - 'GB' - )) - ); - } -} diff --git a/app/code/community/Meanbee/Royalmail/data/9am1000.csv b/app/code/community/Meanbee/Royalmail/data/9am1000.csv index 372e077..631ba6d 100644 --- a/app/code/community/Meanbee/Royalmail/data/9am1000.csv +++ b/app/code/community/Meanbee/Royalmail/data/9am1000.csv @@ -1,4 +1,4 @@ -100,19.84 -500,22.12 -1000,23.80 -2000,28.36 +100,20.38 +500,22.72 +1000,24.46 +2000,29.14 diff --git a/app/code/community/Meanbee/Royalmail/data/9am2500.csv b/app/code/community/Meanbee/Royalmail/data/9am2500.csv index 57c2581..039d9bd 100644 --- a/app/code/community/Meanbee/Royalmail/data/9am2500.csv +++ b/app/code/community/Meanbee/Royalmail/data/9am2500.csv @@ -1,4 +1,4 @@ -100,23.34 -500,25.62 -1000,27.30 -2000,31.86 +100,23.88 +500,26.22 +1000,27.96 +2000,32.64 diff --git a/app/code/community/Meanbee/Royalmail/data/9am50.csv b/app/code/community/Meanbee/Royalmail/data/9am50.csv index acda607..7067b2f 100644 --- a/app/code/community/Meanbee/Royalmail/data/9am50.csv +++ b/app/code/community/Meanbee/Royalmail/data/9am50.csv @@ -1,4 +1,4 @@ -100,17.64 -500,19.92 -1000,21.60 -2000,26.16 +100,18.18 +500,20.52 +1000,22.26 +2000,26.94 diff --git a/app/code/community/Meanbee/Royalmail/data/airmail_eu.csv b/app/code/community/Meanbee/Royalmail/data/airmail_eu.csv deleted file mode 100644 index c713c46..0000000 --- a/app/code/community/Meanbee/Royalmail/data/airmail_eu.csv +++ /dev/null @@ -1,9 +0,0 @@ -100,3.00 -250,3.50 -500,4.95 -750,6.40 -1000,7.85 -1250,9.30 -1500,10.75 -1750,12.20 -2000,13.65 \ No newline at end of file diff --git a/app/code/community/Meanbee/Royalmail/data/airmail_rw1.csv b/app/code/community/Meanbee/Royalmail/data/airmail_rw1.csv deleted file mode 100644 index 14cd405..0000000 --- a/app/code/community/Meanbee/Royalmail/data/airmail_rw1.csv +++ /dev/null @@ -1,9 +0,0 @@ -100,3.50 -250,4.50 -500,7.20 -750,9.90 -1000,12.60 -1250,15.30 -1500,18.00 -1750,20.70 -2000,23.40 \ No newline at end of file diff --git a/app/code/community/Meanbee/Royalmail/data/airmail_rw2.csv b/app/code/community/Meanbee/Royalmail/data/airmail_rw2.csv deleted file mode 100644 index 13991e4..0000000 --- a/app/code/community/Meanbee/Royalmail/data/airmail_rw2.csv +++ /dev/null @@ -1,9 +0,0 @@ -100,3.50 -250,4.70 -500,7.55 -750,10.40 -1000,13.25 -1250,16.10 -1500,18.95 -1750,21.80 -2000,24.65 \ No newline at end of file diff --git a/app/code/community/Meanbee/Royalmail/data/airsure_eu.csv b/app/code/community/Meanbee/Royalmail/data/airsure_eu.csv deleted file mode 100644 index db9c845..0000000 --- a/app/code/community/Meanbee/Royalmail/data/airsure_eu.csv +++ /dev/null @@ -1,5 +0,0 @@ -100,9.24 -150,9.52 -200,9.79 -250,10.07 -300,10.34 diff --git a/app/code/community/Meanbee/Royalmail/data/firstclass_medium.csv b/app/code/community/Meanbee/Royalmail/data/firstclass_medium.csv index e43f06b..e575271 100644 --- a/app/code/community/Meanbee/Royalmail/data/firstclass_medium.csv +++ b/app/code/community/Meanbee/Royalmail/data/firstclass_medium.csv @@ -1,5 +1,5 @@ 1000,5.65 2000,8.90 -5000,15.10 -10000,21.25 -20000,32.40 +5000,15.85 +10000,21.90 +20000,33.40 diff --git a/app/code/community/Meanbee/Royalmail/data/firstclass_small.csv b/app/code/community/Meanbee/Royalmail/data/firstclass_small.csv index abb4889..ac34335 100644 --- a/app/code/community/Meanbee/Royalmail/data/firstclass_small.csv +++ b/app/code/community/Meanbee/Royalmail/data/firstclass_small.csv @@ -1,2 +1,2 @@ -1000,3.00 -2000,6.85 \ No newline at end of file +1000,3.20 +2000,5.45 \ No newline at end of file diff --git a/app/code/community/Meanbee/Royalmail/data/internationaleconomy.csv b/app/code/community/Meanbee/Royalmail/data/internationaleconomy.csv new file mode 100644 index 0000000..560c3ed --- /dev/null +++ b/app/code/community/Meanbee/Royalmail/data/internationaleconomy.csv @@ -0,0 +1,9 @@ +100,2.80 +250,3.65 +500,5.10 +750,6.55 +1000,8.00 +1250,9.45 +1500,10.90 +1750,12.35 +2000,13.80 \ No newline at end of file diff --git a/app/code/community/Meanbee/Royalmail/data/internationalstandard_europe.csv b/app/code/community/Meanbee/Royalmail/data/internationalstandard_europe.csv new file mode 100644 index 0000000..7240f11 --- /dev/null +++ b/app/code/community/Meanbee/Royalmail/data/internationalstandard_europe.csv @@ -0,0 +1,9 @@ +100,3.20 +250,3.70 +500,5.15 +750,6.60 +1000,8.05 +1250,9.50 +1500,10.95 +1750,12.40 +2000,13.85 \ No newline at end of file diff --git a/app/code/community/Meanbee/Royalmail/data/internationalstandard_wz1.csv b/app/code/community/Meanbee/Royalmail/data/internationalstandard_wz1.csv new file mode 100644 index 0000000..b5e43e5 --- /dev/null +++ b/app/code/community/Meanbee/Royalmail/data/internationalstandard_wz1.csv @@ -0,0 +1,9 @@ +100,3.80 +250,4.75 +500,7.45 +750,10.15 +1000,12.85 +1250,15.55 +1500,18.25 +1750,20.95 +2000,23.65 \ No newline at end of file diff --git a/app/code/community/Meanbee/Royalmail/data/internationalstandard_wz2.csv b/app/code/community/Meanbee/Royalmail/data/internationalstandard_wz2.csv new file mode 100644 index 0000000..4cf80ba --- /dev/null +++ b/app/code/community/Meanbee/Royalmail/data/internationalstandard_wz2.csv @@ -0,0 +1,9 @@ +100,4.00 +250,5.05 +500,7.90 +750,10.75 +1000,13.60 +1250,16.45 +1500,19.30 +1750,22.15 +2000,25.00 \ No newline at end of file diff --git a/app/code/community/Meanbee/Royalmail/data/internationaltracked_eu.csv b/app/code/community/Meanbee/Royalmail/data/internationaltracked_eu.csv new file mode 100644 index 0000000..22ec93b --- /dev/null +++ b/app/code/community/Meanbee/Royalmail/data/internationaltracked_eu.csv @@ -0,0 +1,9 @@ +100,9.84 +250,10.44 +500,12.18 +750,13.92 +1000,15.66 +1250,17.40 +1500,19.14 +1750,20.88 +2000,22.62 \ No newline at end of file diff --git a/app/code/community/Meanbee/Royalmail/data/internationaltracked_noneu.csv b/app/code/community/Meanbee/Royalmail/data/internationaltracked_noneu.csv new file mode 100644 index 0000000..9c799aa --- /dev/null +++ b/app/code/community/Meanbee/Royalmail/data/internationaltracked_noneu.csv @@ -0,0 +1,9 @@ +100,8.20 +250,8.75 +500,10.15 +750,11.60 +1000,13.05 +1250,14.50 +1500,15.95 +1750,17.40 +2000,18.85 \ No newline at end of file diff --git a/app/code/community/Meanbee/Royalmail/data/internationaltracked_wz1.csv b/app/code/community/Meanbee/Royalmail/data/internationaltracked_wz1.csv new file mode 100644 index 0000000..4d6d26c --- /dev/null +++ b/app/code/community/Meanbee/Royalmail/data/internationaltracked_wz1.csv @@ -0,0 +1,9 @@ +100,8.80 +250,9.75 +500,12.45 +750,15.15 +1000,17.85 +1250,20.55 +1500,23.25 +1750,25.95 +2000,28.65 \ No newline at end of file diff --git a/app/code/community/Meanbee/Royalmail/data/internationaltracked_wz2.csv b/app/code/community/Meanbee/Royalmail/data/internationaltracked_wz2.csv new file mode 100644 index 0000000..8e017bc --- /dev/null +++ b/app/code/community/Meanbee/Royalmail/data/internationaltracked_wz2.csv @@ -0,0 +1,9 @@ +100,9.00 +250,10.05 +500,12.90 +750,15.75 +1000,18.60 +1250,21.45 +1500,24.30 +1750,27.15 +2000,30.00 \ No newline at end of file diff --git a/app/code/community/Meanbee/Royalmail/data/largeletter.csv b/app/code/community/Meanbee/Royalmail/data/largeletter.csv index 88435e3..39e643e 100644 --- a/app/code/community/Meanbee/Royalmail/data/largeletter.csv +++ b/app/code/community/Meanbee/Royalmail/data/largeletter.csv @@ -1,4 +1,4 @@ -100,0.90 -250,1.20 -500,1.60 -750,2.30 +100,0.93 +250,1.24 +500,1.65 +750,2.38 diff --git a/app/code/community/Meanbee/Royalmail/data/letter.csv b/app/code/community/Meanbee/Royalmail/data/letter.csv index 5e935e6..7f29ebb 100644 --- a/app/code/community/Meanbee/Royalmail/data/letter.csv +++ b/app/code/community/Meanbee/Royalmail/data/letter.csv @@ -1 +1 @@ -100,0.60 \ No newline at end of file +100,0.62 \ No newline at end of file diff --git a/app/code/community/Meanbee/Royalmail/data/nextday1000.csv b/app/code/community/Meanbee/Royalmail/data/nextday1000.csv index b446ec2..96010d3 100644 --- a/app/code/community/Meanbee/Royalmail/data/nextday1000.csv +++ b/app/code/community/Meanbee/Royalmail/data/nextday1000.csv @@ -1,6 +1,6 @@ -100,7.22 -500,7.95 -1000,9.25 +100,7.40 +500,8.15 +1000,9.45 2000,12.00 -10000,26.80 -20000,41.00 \ No newline at end of file +10000,27.60 +20000,42.20 \ No newline at end of file diff --git a/app/code/community/Meanbee/Royalmail/data/nextday2500.csv b/app/code/community/Meanbee/Royalmail/data/nextday2500.csv index 1bddf83..5fc46e6 100644 --- a/app/code/community/Meanbee/Royalmail/data/nextday2500.csv +++ b/app/code/community/Meanbee/Royalmail/data/nextday2500.csv @@ -1,6 +1,6 @@ -100,8.22 -500,8.95 -1000,10.25 -2000,13.00 -10000,27.80 -20000,42.00 \ No newline at end of file +100,9.40 +500,10.15 +1000,11.45 +2000,14.00 +10000,29.60 +20000,44.20 \ No newline at end of file diff --git a/app/code/community/Meanbee/Royalmail/data/nextday500.csv b/app/code/community/Meanbee/Royalmail/data/nextday500.csv index 66360e1..0ea4ee4 100644 --- a/app/code/community/Meanbee/Royalmail/data/nextday500.csv +++ b/app/code/community/Meanbee/Royalmail/data/nextday500.csv @@ -1,6 +1,6 @@ -100,6.22 -500,6.95 -1000,8.25 +100,6.40 +500,7.15 +1000,8.45 2000,11.00 -10000,25.80 -20000,40.00 \ No newline at end of file +10000,26.60 +20000,41.20 \ No newline at end of file diff --git a/app/code/community/Meanbee/Royalmail/data/secondclass_medium.csv b/app/code/community/Meanbee/Royalmail/data/secondclass_medium.csv index 1ed643a..70db5dd 100644 --- a/app/code/community/Meanbee/Royalmail/data/secondclass_medium.csv +++ b/app/code/community/Meanbee/Royalmail/data/secondclass_medium.csv @@ -1,5 +1,5 @@ 1000,5.20 2000,8.00 -5000,13.35 -10000,19.65 -20000,27.70 +5000,13.75 +10000,20.25 +20000,28.55 diff --git a/app/code/community/Meanbee/Royalmail/data/secondclass_small.csv b/app/code/community/Meanbee/Royalmail/data/secondclass_small.csv index 5ee7eea..ab95636 100644 --- a/app/code/community/Meanbee/Royalmail/data/secondclass_small.csv +++ b/app/code/community/Meanbee/Royalmail/data/secondclass_small.csv @@ -1,2 +1,2 @@ -1000,2.60 -2000,5.60 \ No newline at end of file +1000,2.80 +2000,3.80 \ No newline at end of file diff --git a/app/code/community/Meanbee/Royalmail/data/surfacemail.csv b/app/code/community/Meanbee/Royalmail/data/surfacemail.csv deleted file mode 100644 index fa77406..0000000 --- a/app/code/community/Meanbee/Royalmail/data/surfacemail.csv +++ /dev/null @@ -1,9 +0,0 @@ -100,2.60 -250,3.25 -500,4.85 -750,6.45 -1000,8.05 -1250,9.65 -1500,11.25 -1750,12.85 -2000,14.45 \ No newline at end of file From a58e5402f1e53127b440f3bbe0838dfa30b3bd2e Mon Sep 17 00:00:00 2001 From: Ash Smith Date: Mon, 10 Mar 2014 17:16:30 +0000 Subject: [PATCH 2/7] Added Helper test --- .../community/Meanbee/Royalmail/Test/Helper/Data.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/code/community/Meanbee/Royalmail/Test/Helper/Data.php b/app/code/community/Meanbee/Royalmail/Test/Helper/Data.php index b3d9bbc..be26691 100644 --- a/app/code/community/Meanbee/Royalmail/Test/Helper/Data.php +++ b/app/code/community/Meanbee/Royalmail/Test/Helper/Data.php @@ -1 +1,11 @@ assertEquals('wz2', Mage::helper('royalmail')->getWorldZone('TO')); + } +} \ No newline at end of file From 4c0921bfa67b280d46894fc15ca221c94244cf95 Mon Sep 17 00:00:00 2001 From: Ash Smith Date: Mon, 10 Mar 2014 17:30:54 +0000 Subject: [PATCH 3/7] Moved world zone codes into protected class vars, and replaced switch with if/else --- .../Meanbee/Royalmail/Helper/Data.php | 74 +++++++++---------- 1 file changed, 35 insertions(+), 39 deletions(-) diff --git a/app/code/community/Meanbee/Royalmail/Helper/Data.php b/app/code/community/Meanbee/Royalmail/Helper/Data.php index dbe41ae..caecfa5 100644 --- a/app/code/community/Meanbee/Royalmail/Helper/Data.php +++ b/app/code/community/Meanbee/Royalmail/Helper/Data.php @@ -19,6 +19,33 @@ class Meanbee_Royalmail_Helper_Data extends Mage_Core_Helper_Abstract { + const WORLD_ZONE_EU = 'eu'; + const WORLD_ZONE_NONEU = 'noneu'; + const WORLD_ZONE_ONE = 'wz1'; + const WORLD_ZONE_TWO = 'wz2'; + + protected $_worldZoneEu = array( + 'DK', 'EE', 'LV', 'AT', 'FI', + 'LT', 'SK', 'FR', 'LU', 'SI', + 'ES', 'DE', 'SE', 'GI', 'MT', + 'BE', 'GR', 'MC', 'BG', 'HU', + 'NL', 'IE', 'HR', 'IT', 'PL', + 'CY', 'PT', 'CZ', 'RO'); + protected $_worldZoneNonEu = array( + 'SM', 'AM', 'FO', 'LI', 'RS', + 'XK', 'KZ', 'VA', 'NO', 'UZ', + 'UA', 'ME', 'TM', 'IS', 'TR', + 'MD', 'TJ', 'BA', 'GL', 'CH', + 'BY', 'GE', 'MK', 'AZ', 'KG', + 'RU', 'AD', 'AL'); + protected $_worldZone2 = array( + 'AU', 'PW', 'IO', 'CX', 'CC', + 'CK', 'FJ', 'PF', 'TF', 'KI', + 'MO', 'NR', 'NC', 'NZ', 'NU', + 'NF', 'PG', 'LA', 'PN', 'SG', + 'SB', 'TK', 'TO', 'TV', 'AS', + 'WS'); + public function addAdditionalCharges($rates, $charge, $weight, $chargePer = 250) { for($i = 0; $i < count($rates); $i++) { if($weight > $rates[$i]['upper']) { @@ -41,45 +68,14 @@ public function addInsuranceCharges($rates, $charge, $cartTotal, $valueOver = 50 public function getWorldZone($countryCode) { $country = strtoupper($countryCode); if ($country != 'GB') { - switch ($country) { - /** - * Countries defined by Royal Mail, but not by Magento. - * - Azores - * - Balearic Islands - * - Canary Islands - * - Corsica - * - Kosovo - * - Madeira - * - Belau - * - Norwegian Antarctic Territory - * - * Notes: Serbia and Montenegro = Serbia = Montenegro - * Notes: Cocos Islands = Keeling = COCOS (KEELING) ISLANDS - * Notes: MACAU = Macao - */ - case 'DK': case 'EE': case 'LV': case 'AT': case 'FI': - case 'LT': case 'SK': case 'FR': case 'LU': case 'SI': - case 'ES': case 'DE': case 'SE': case 'GI': case 'MT': - case 'BE': case 'GR': case 'MC': case 'BG': case 'HU': - case 'NL': case 'IE': case 'HR': case 'IT': case 'PL': - case 'CY': case 'PT': case 'CZ': case 'RO': - return 'eu'; - case 'SM': case 'AM': case 'FO': case 'LI': case 'RS': - case 'XK': case 'KZ': case 'VA': case 'NO': case 'UZ': - case 'UA': case 'ME': case 'TM': case 'IS': case 'TR': - case 'MD': case 'TJ': case 'BA': case 'GL': case 'CH': - case 'BY': case 'GE': case 'MK': case 'AZ': case 'KG': - case 'RU': case 'AD': case 'AL': - return 'noneu'; - case 'AU': case 'PW': case 'IO': case 'CX': case 'CC': - case 'CK': case 'FJ': case 'PF': case 'TF': case 'KI': - case 'MO': case 'NR': case 'NC': case 'NZ': case 'NU': - case 'NF': case 'PG': case 'LA': case 'PN': case 'SG': - case 'SB': case 'TK': case 'TO': case 'TV': case 'AS': - case 'WS': - return 'wz2'; - default: - return 'wz1'; + if (in_array($country, $this->_worldZoneEu)) { + return self::WORLD_ZONE_EU; + } else if (in_array($country, $this->_worldZoneNonEu)) { + return self::WORLD_ZONE_NONEU; + } else if (in_array($country, $this->_worldZone2)) { + return self::WORLD_ZONE_TWO; + } else { + return self::WORLD_ZONE_ONE; } } return null; From 651afdcda747e4c6f4ff8cc63f1add2edef7dc11 Mon Sep 17 00:00:00 2001 From: Ash Smith Date: Mon, 10 Mar 2014 17:39:52 +0000 Subject: [PATCH 4/7] Helper improvements, comments and more descriptive method names --- .../Meanbee/Royalmail/Helper/Data.php | 29 ++++++++++++++++++- .../Royalmail/Internationalstandard.php | 6 ++-- .../Royalmail/Internationaltracked.php | 8 ++--- 3 files changed, 35 insertions(+), 8 deletions(-) diff --git a/app/code/community/Meanbee/Royalmail/Helper/Data.php b/app/code/community/Meanbee/Royalmail/Helper/Data.php index caecfa5..2f05f9d 100644 --- a/app/code/community/Meanbee/Royalmail/Helper/Data.php +++ b/app/code/community/Meanbee/Royalmail/Helper/Data.php @@ -46,7 +46,17 @@ class Meanbee_Royalmail_Helper_Data extends Mage_Core_Helper_Abstract { 'SB', 'TK', 'TO', 'TV', 'AS', 'WS'); - public function addAdditionalCharges($rates, $charge, $weight, $chargePer = 250) { + /** + * RoyalMail allow weights over their upper limit, up to 5kg, and usually charge per additional 250g. + * This is a helper to add those charges onto the rates supplied. + * + * @param $rates + * @param $charge + * @param $weight + * @param int $chargePer + * @return mixed + */ + public function addAdditionalWeightCharges($rates, $charge, $weight, $chargePer = 250) { for($i = 0; $i < count($rates); $i++) { if($weight > $rates[$i]['upper']) { $additional = ceil(((($weight - $rates[$i]['upper']) / $chargePer) * $charge * 100))/2; @@ -56,6 +66,16 @@ public function addAdditionalCharges($rates, $charge, $weight, $chargePer = 250) return $rates; } + /** + * A simple helper to add the insurance charges on top of the rates supplied. + * RoyalMail will compensate an item up to a certain value, but this costs extra for more cover. + * + * @param $rates + * @param $charge + * @param $cartTotal + * @param int $valueOver + * @return mixed + */ public function addInsuranceCharges($rates, $charge, $cartTotal, $valueOver = 50) { if($cartTotal > $valueOver) { for($i = 0; $i < count($rates); $i++) { @@ -65,6 +85,13 @@ public function addInsuranceCharges($rates, $charge, $cartTotal, $valueOver = 50 return $rates; } + /** + * Figure out what World Zone a country is in, as defined by RoyalMail + * Used on International Rates. + * + * @param $countryCode + * @return null|string + */ public function getWorldZone($countryCode) { $country = strtoupper($countryCode); if ($country != 'GB') { diff --git a/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Internationalstandard.php b/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Internationalstandard.php index 6e34a51..e704968 100644 --- a/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Internationalstandard.php +++ b/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Internationalstandard.php @@ -38,21 +38,21 @@ public function getRates() { switch($worldZone) { case 'eu': case 'noneu': - $rates = $_helper->addAdditionalCharges( + $rates = $_helper->addAdditionalWeightCharges( $this->_getEuropeRates(), $this->additionalChargeEurope, $weight ); break; case 'wz1': - $rates = $_helper->addAdditionalCharges( + $rates = $_helper->addAdditionalWeightCharges( $this->_getWz1Rates(), $this->additionalChargeWz1, $weight ); break; case 'wz2': - $rates = $_helper->addAdditionalCharges( + $rates = $_helper->addAdditionalWeightCharges( $this->_getWz2Rates(), $this->additionalChargeWz2, $weight diff --git a/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Internationaltracked.php b/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Internationaltracked.php index 9bcbf44..618183f 100644 --- a/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Internationaltracked.php +++ b/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Internationaltracked.php @@ -44,7 +44,7 @@ public function getRates() { if($country != 'GB') { switch($worldZone) { case 'eu': - $rates = $_helper->addAdditionalCharges( + $rates = $_helper->addAdditionalWeightCharges( $_helper->addInsuranceCharges( $this->_getEuRates(), $this->additionalInsuranceChargeEu, @@ -56,7 +56,7 @@ public function getRates() { ); break; case 'noneu': - $rates = $_helper->addAdditionalCharges( + $rates = $_helper->addAdditionalWeightCharges( $_helper->addInsuranceCharges( $this->_getNonEuRates(), $this->additionalInsuranceChargeNonEu, @@ -68,7 +68,7 @@ public function getRates() { ); break; case 'wz1': - $rates = $_helper->addAdditionalCharges( + $rates = $_helper->addAdditionalWeightCharges( $_helper->addInsuranceCharges( $this->_getWz1Rates(), $this->additionalInsuranceChargeWz1, @@ -80,7 +80,7 @@ public function getRates() { ); break; case 'wz2': - $rates = $_helper->addAdditionalCharges( + $rates = $_helper->addAdditionalWeightCharges( $_helper->addInsuranceCharges( $this->_getWz2Rates(), $this->additionalInsuranceChargeWz2, From 0af30019ef2aa7a97d93402521cea8f1b25aac3e Mon Sep 17 00:00:00 2001 From: Ash Smith Date: Mon, 10 Mar 2014 17:40:29 +0000 Subject: [PATCH 5/7] Bug fix: additional weight charges helper didn't calculate correctly --- app/code/community/Meanbee/Royalmail/Helper/Data.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/community/Meanbee/Royalmail/Helper/Data.php b/app/code/community/Meanbee/Royalmail/Helper/Data.php index 2f05f9d..00ed2f7 100644 --- a/app/code/community/Meanbee/Royalmail/Helper/Data.php +++ b/app/code/community/Meanbee/Royalmail/Helper/Data.php @@ -59,7 +59,7 @@ class Meanbee_Royalmail_Helper_Data extends Mage_Core_Helper_Abstract { public function addAdditionalWeightCharges($rates, $charge, $weight, $chargePer = 250) { for($i = 0; $i < count($rates); $i++) { if($weight > $rates[$i]['upper']) { - $additional = ceil(((($weight - $rates[$i]['upper']) / $chargePer) * $charge * 100))/2; + $additional = ceil(((($weight - $rates[$i]['upper']) / $chargePer) * $charge * 100)) / 100; $rates[$i]['cost'] += $additional; } } From d6e52e16cfe2202a3e4a763ab44050d163083d49 Mon Sep 17 00:00:00 2001 From: Ash Smith Date: Wed, 12 Mar 2014 15:47:04 +0000 Subject: [PATCH 6/7] Amended comment --- app/code/community/Meanbee/Royalmail/Helper/Data.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/community/Meanbee/Royalmail/Helper/Data.php b/app/code/community/Meanbee/Royalmail/Helper/Data.php index 00ed2f7..ee95db5 100644 --- a/app/code/community/Meanbee/Royalmail/Helper/Data.php +++ b/app/code/community/Meanbee/Royalmail/Helper/Data.php @@ -47,7 +47,7 @@ class Meanbee_Royalmail_Helper_Data extends Mage_Core_Helper_Abstract { 'WS'); /** - * RoyalMail allow weights over their upper limit, up to 5kg, and usually charge per additional 250g. + * RoyalMail allow weights over their upper limit, and usually charge per additional 250g. * This is a helper to add those charges onto the rates supplied. * * @param $rates From 0a5ee537aa7b543e146c0d8513f04965f502f6ae Mon Sep 17 00:00:00 2001 From: Ash Smith Date: Tue, 18 Mar 2014 12:24:05 +0000 Subject: [PATCH 7/7] Bump the version number --- app/code/community/Meanbee/Royalmail/etc/config.xml | 2 +- package.xml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/code/community/Meanbee/Royalmail/etc/config.xml b/app/code/community/Meanbee/Royalmail/etc/config.xml index b9229e5..658b140 100644 --- a/app/code/community/Meanbee/Royalmail/etc/config.xml +++ b/app/code/community/Meanbee/Royalmail/etc/config.xml @@ -22,7 +22,7 @@ - 2.5.3 + 2.6.0 diff --git a/package.xml b/package.xml index fcdd292..3317dcf 100644 --- a/package.xml +++ b/package.xml @@ -10,9 +10,9 @@ Automatically calculated Royal Mail delivery methods. Open Software License v3.0 (OSL-3.0) http://www.opensource.org/licenses/osl-3.0.php - 2.5.3 + 2.6.0 stable - * Bug Fix: International Signed For was not calculated correctly. + * March 31st Pricing update, and updated International services inline with RoyalMail changes Meanbee