diff --git a/app/code/community/Meanbee/Royalmail/Helper/Data.php b/app/code/community/Meanbee/Royalmail/Helper/Data.php index e8de042..dbb6fcc 100644 --- a/app/code/community/Meanbee/Royalmail/Helper/Data.php +++ b/app/code/community/Meanbee/Royalmail/Helper/Data.php @@ -300,25 +300,6 @@ public function isCountryAvailableForInternationalSigned($countryCode) { return $this->_isCountryAvailableForMethod($countryCode, self::INTERNATIONAL_SIGNED); } - /** - * 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 - * @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)) / 100; - $rates[$i]['cost'] += $additional; - } - } - return $rates; - } /** * A simple helper to add the insurance charges on top of the rates supplied. 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 41e8536..8044fc4 100644 --- a/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail.php +++ b/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail.php @@ -135,10 +135,16 @@ public function getAllowedMethods() { public function getMethods($name=null) { $codes = array( // To maintain backwards comparability we need to keep letter and largeletter indices the same + 'letter' => 'First Class Letter', 'largeletter' => 'First Class Large Letter', + 'firstclasslettersignedfor' => 'First Class Letter (Signed for)', + 'firstclasslargelettersignedfor' => 'First Class Large Letter (Signed for)', + 'secondclassletter' => 'Second Class Letter', 'secondclasslargeletter' => 'Second Class Large Letter', + 'secondclasslettersignedfor' => 'Second Class Letter (Signed For)', + 'secondclasslargelettersignedfor' => 'Second Class Large Letter (Signed For)', 'secondclass' => 'Second Class Parcel', 'secondclassrecordedsignedfor' => 'Second Class Parcel (Signed for)', @@ -146,15 +152,22 @@ public function getMethods($name=null) { 'firstclass' => 'First Class Parcel', 'firstclassrecordedsignedfor' => 'First Class Parcel (Signed for)', - 'specialdeliverynextday' => 'Special Delivery Guaranteed by 1pm (Up to 500GBP Insurance)', - + 'specialdeliverynextday' => 'Special Delivery Guaranteed by 1pm (Up to 2,500GBP Insurance)', 'specialdelivery9am' => 'Special Delivery Guaranteed by 9am (Up to 2,500GBP Insurance)', + 'specialdelivery9amsaturday' => 'Special Delivery Saturday Guaranteed by 9am (Up to 2,500GBP Insurance)', + 'specialdeliverynextdaysaturday' => 'Special Delivery Saturday Guaranteed by 1pm (Up to 2,500GBP Insurance)', - 'internationalstandard' => 'International Standard (up to 5kg)', + 'internationalstandard' => 'International Standard (up to 2kg)', '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' + 'internationaleconomy' => 'International Economy', + + 'internationallettertracked' => 'International Letter Tracked', + 'internationallettersigned' => 'International Letter Signed', + 'internationallettereconomy' => 'International Letter Economy', + 'internationalletterstandard' => 'International Letter Standard', + 'internationallettertrackedsigned' => 'International Letter Tracked (Signed)', ); if ($name !== null) { @@ -167,4 +180,4 @@ public function getMethods($name=null) { return $codes; } } -} +} \ No newline at end of file diff --git a/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Firstclass.php b/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Firstclass.php index e403448..4442ceb 100644 --- a/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Firstclass.php +++ b/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Firstclass.php @@ -24,7 +24,7 @@ public function getRates() { $helper = Mage::helper('royalmail'); $rates = $this->_loadCsv($this->_getRateFile()); - if ($helper->getWorldZone($this->_getCountry()) == 'gb') { + if ($helper->getWorldZone($this->_getCountry()) == Meanbee_Royalmail_Helper_Data::WORLD_ZONE_GB) { return $rates; } diff --git a/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Firstclasslargelettersignedfor.php b/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Firstclasslargelettersignedfor.php new file mode 100644 index 0000000..227c8f4 --- /dev/null +++ b/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Firstclasslargelettersignedfor.php @@ -0,0 +1,34 @@ +_loadCsv('firstclass_largeletter_signedfor'); + + if ($helper->getWorldZone($this->_getCountry()) == Meanbee_Royalmail_Helper_Data::WORLD_ZONE_GB) { + return $rates; + } + + return null; + } + +} \ No newline at end of file diff --git a/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Firstclasslettersignedfor.php b/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Firstclasslettersignedfor.php new file mode 100644 index 0000000..682089c --- /dev/null +++ b/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Firstclasslettersignedfor.php @@ -0,0 +1,34 @@ +_loadCsv('firstclass_letter_signedfor'); + + if ($helper->getWorldZone($this->_getCountry()) == Meanbee_Royalmail_Helper_Data::WORLD_ZONE_GB) { + return $rates; + } + + return null; + } + +} \ No newline at end of file diff --git a/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Firstclassrecordedsignedfor.php b/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Firstclassrecordedsignedfor.php index f29e51d..de09a68 100644 --- a/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Firstclassrecordedsignedfor.php +++ b/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Firstclassrecordedsignedfor.php @@ -20,15 +20,23 @@ class Meanbee_Royalmail_Model_Shipping_Carrier_Royalmail_Firstclassrecordedsignedfor extends Meanbee_Royalmail_Model_Shipping_Carrier_Royalmail_Firstclass { - private $_extraCharge = 1.10; - public function getRates() { - $rates = parent::getRates(); + $helper = Mage::helper('royalmail'); + $rates = $this->_loadCsv($this->_getRateFile()); + + if ($helper->getWorldZone($this->_getCountry()) == Meanbee_Royalmail_Helper_Data::WORLD_ZONE_GB) { + return $rates; + } + + return null; + } + + protected function _getRateFile() { - for ($i = 0; $i < count($rates); $i++) { - $rates[$i]['cost'] += $this->_extraCharge; + if (Mage::getStoreConfig('carriers/royalmail/parcel_size') == Meanbee_Royalmail_Model_Parcelsize::SMALL) { + return 'firstclass_small_signedfor'; } - return $rates; + return 'firstclass_medium_signedfor'; } } diff --git a/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Internationallettereconomy.php b/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Internationallettereconomy.php new file mode 100644 index 0000000..051fccf --- /dev/null +++ b/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Internationallettereconomy.php @@ -0,0 +1,30 @@ +getWorldZone($this->_getCountry()) !== Meanbee_Royalmail_Helper_Data::WORLD_ZONE_GB) { + return $this->_loadCsv('internationalltettereconomy'); + } + return null; + } +} diff --git a/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Internationallettersigned.php b/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Internationallettersigned.php new file mode 100644 index 0000000..2be4354 --- /dev/null +++ b/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Internationallettersigned.php @@ -0,0 +1,81 @@ +_getCountry(); + $worldZone = $_helper->getWorldZone($country); + + + if (!$_helper->isCountryAvailableForInternationalSigned($country)) { + return null; + } + + + switch($worldZone) { + case Meanbee_Royalmail_Helper_Data::WORLD_ZONE_GB: + return null; + case Meanbee_Royalmail_Helper_Data::WORLD_ZONE_EU: + $rates = $_helper->addInsuranceCharges( + $this->_getEuRates(), + $this->additionalInsuranceChargeEu, + $this->getCartTotal(), + $this->insureOver + ); + break; + case Meanbee_Royalmail_Helper_Data::WORLD_ZONE_ONE: + $rates = $_helper->addInsuranceCharges( + $this->_getWzRates(), + $this->additionalInsuranceChargeWz1, + $this->getCartTotal(), + $this->insureOver + ); + break; + case Meanbee_Royalmail_Helper_Data::WORLD_ZONE_TWO: + $rates = $_helper->addInsuranceCharges( + $this->_getWzRates(), + $this->additionalInsuranceChargeWz2, + $this->getCartTotal(), + $this->insureOver + ); + break; + default: + return null; + } + return $rates; + } + + protected function _getEuRates() { + return $this->_loadCsv('internationallettersigned_eu'); + } + + protected function _getWzRates() { + return $this->_loadCsv('internationallettersigned_wz'); + } + +} \ No newline at end of file diff --git a/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Internationalletterstandard.php b/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Internationalletterstandard.php new file mode 100644 index 0000000..1e5b9f5 --- /dev/null +++ b/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Internationalletterstandard.php @@ -0,0 +1,54 @@ +_getCountry(); + $worldZone = $_helper->getWorldZone($country); + + + switch($worldZone) { + case Meanbee_Royalmail_Helper_Data::WORLD_ZONE_GB: + return null; + case Meanbee_Royalmail_Helper_Data::WORLD_ZONE_EU: + $rates = $this->_getEuropeRates(); + break; + case Meanbee_Royalmail_Helper_Data::WORLD_ZONE_ONE: + case Meanbee_Royalmail_Helper_Data::WORLD_ZONE_TWO: + $rates = $this->_getWzRates(); + break; + default: + return null; + } + return $rates; + } + + protected function _getEuropeRates() { + return $this->_loadCsv('internationalletterstandard_eu'); + } + + protected function _getWzRates() { + return $this->_loadCsv('internationalletterstandard_wz'); + } + +} diff --git a/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Internationallettertracked.php b/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Internationallettertracked.php new file mode 100644 index 0000000..b6c9f1b --- /dev/null +++ b/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Internationallettertracked.php @@ -0,0 +1,85 @@ +_getCountry(); + $worldZone = $_helper->getWorldZone($country); + + + if (!$_helper->isCountryAvailableForInternationalTracked($country)) { + return null; + } + + + switch($worldZone) { + case Meanbee_Royalmail_Helper_Data::WORLD_ZONE_GB: + return null; + case Meanbee_Royalmail_Helper_Data::WORLD_ZONE_EU: + $rates = $_helper->addInsuranceCharges( + $this->_getEuRates(), + $this->additionalInsuranceChargeEu, + $this->getCartTotal(), + $this->insureOver + ); + break; + case Meanbee_Royalmail_Helper_Data::WORLD_ZONE_NONEU: + $rates = $_helper->addInsuranceCharges( + $this->_getNonEuRates(), + $this->additionalInsuranceChargeNonEu, + $this->getCartTotal(), + $this->insureOver + ); + break; + case Meanbee_Royalmail_Helper_Data::WORLD_ZONE_ONE: + case Meanbee_Royalmail_Helper_Data::WORLD_ZONE_TWO: + $rates = $_helper->addInsuranceCharges( + $this->_getWzRates(), + $this->additionalInsuranceChargeWz, + $this->getCartTotal(), + $this->insureOver + ); + break; + default: + return null; + } + return $rates; + } + + protected function _getEuRates() { + return $this->_loadCsv('internationallettertracked_eu'); + } + + protected function _getNonEuRates() { + return $this->_loadCsv('internationallettertracked_noneu'); + } + + protected function _getWzRates() { + return $this->_loadCsv('internationallettertracked_wz'); + } + +} \ No newline at end of file diff --git a/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Internationallettertrackedsigned.php b/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Internationallettertrackedsigned.php new file mode 100644 index 0000000..1f18102 --- /dev/null +++ b/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Internationallettertrackedsigned.php @@ -0,0 +1,71 @@ +_getCountry(); + $worldZone = $_helper->getWorldZone($country); + + + if (!$_helper->isCountryAvailableForInternationalTrackedAndSigned($country)) { + return null; + } + + switch($worldZone) { + case Meanbee_Royalmail_Helper_Data::WORLD_ZONE_GB: + return null; + case Meanbee_Royalmail_Helper_Data::WORLD_ZONE_EU: + $rates = $_helper->addInsuranceCharges( + $this->_getEuRates(), + $this->additionalInsuranceChargeEu, + $this->getCartTotal(), + $this->insureOver + ); + break; + case Meanbee_Royalmail_Helper_Data::WORLD_ZONE_ONE: + case Meanbee_Royalmail_Helper_Data::WORLD_ZONE_TWO: + $rates = $_helper->addInsuranceCharges( + $this->_getWzRates(), + $this->additionalInsuranceChargeWz, + $this->getCartTotal(), + $this->insureOver + ); + break; + default: + return null; + } + return $rates; + } + + protected function _getEuRates() { + return $this->_loadCsv('internationallettertrackedsigned_eu'); + } + + protected function _getWzRates() { + return $this->_loadCsv('internationallettertrackedsigned_wz'); + } + +} \ No newline at end of file diff --git a/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Internationalsigned.php b/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Internationalsigned.php index 81a54c8..1fb5e9b 100644 --- a/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Internationalsigned.php +++ b/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Internationalsigned.php @@ -18,26 +18,65 @@ */ class Meanbee_Royalmail_Model_Shipping_Carrier_Royalmail_Internationalsigned - extends Meanbee_Royalmail_Model_Shipping_Carrier_Royalmail_Internationalstandard { + extends Meanbee_Royalmail_Model_Shipping_Carrier_Royalmail_Abstract { protected $insureOver = 50; - protected $additionalInsuranceCharge = 2.50; + protected $additionalInsuranceChargeEu = 2.50; + protected $additionalInsuranceChargeWz1 = 2.50; + protected $additionalInsuranceChargeWz2 = 2.50; public function getRates() { - $helper = Mage::helper('royalmail'); + $_helper = Mage::helper('royalmail'); $country = $this->_getCountry(); + $worldZone = $_helper->getWorldZone($country); - if (!$helper->isCountryAvailableForInternationalSigned($country)) { + + if (!$_helper->isCountryAvailableForInternationalSigned($country)) { return null; } - $rates = parent::getRates(); - 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; - } + switch($worldZone) { + case Meanbee_Royalmail_Helper_Data::WORLD_ZONE_GB: + return null; + case Meanbee_Royalmail_Helper_Data::WORLD_ZONE_EU: + $rates = $_helper->addInsuranceCharges( + $this->_getEuRates(), + $this->additionalInsuranceChargeEu, + $this->getCartTotal(), + $this->insureOver + ); + break; + case Meanbee_Royalmail_Helper_Data::WORLD_ZONE_ONE: + $rates = $_helper->addInsuranceCharges( + $this->_getWz1Rates(), + $this->additionalInsuranceChargeWz1, + $this->getCartTotal(), + $this->insureOver + ); + break; + case Meanbee_Royalmail_Helper_Data::WORLD_ZONE_TWO: + $rates = $_helper->addInsuranceCharges( + $this->_getWz2Rates(), + $this->additionalInsuranceChargeWz2, + $this->getCartTotal(), + $this->insureOver + ); + break; + default: + return null; } return $rates; } -} \ No newline at end of file + + protected function _getEuRates() { + return $this->_loadCsv('internationalsigned_eu'); + } + + protected function _getWz1Rates() { + return $this->_loadCsv('internationalsigned_wz1'); + } + + protected function _getWz2Rates() { + return $this->_loadCsv('internationalsigned_wz2'); + } +} 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 8521d35..c7eae07 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 @@ -20,58 +20,31 @@ class Meanbee_Royalmail_Model_Shipping_Carrier_Royalmail_Internationalstandard extends Meanbee_Royalmail_Model_Shipping_Carrier_Royalmail_Abstract { - protected $additionalChargeEurope = 1.45; - protected $additionalChargeWz1 = 2.70; - protected $additionalChargeWz2 = 2.85; - protected $maxWeight = 5000; public function getRates() { $_helper = Mage::helper('royalmail'); $country = $this->_getCountry(); $worldZone = $_helper->getWorldZone($country); - $weight = $this->_getWeight(); - if($weight > $this->maxWeight) { - return null; - } switch($worldZone) { - case 'gb': + case Meanbee_Royalmail_Helper_Data::WORLD_ZONE_GB: return null; - case 'eu': - case 'noneu': - $rates = $_helper->addAdditionalWeightCharges( - $this->_getEuropeRates(), - $this->additionalChargeEurope, - $weight - ); + case Meanbee_Royalmail_Helper_Data::WORLD_ZONE_EU: + $rates = $this->_getEuropeRates(); break; - case 'wz1': - $rates = $_helper->addAdditionalWeightCharges( - $this->_getWz1Rates(), - $this->additionalChargeWz1, - $weight - ); + case Meanbee_Royalmail_Helper_Data::WORLD_ZONE_ONE: + $rates = $this->_getWz1Rates(); break; - case 'wz2': - $rates = $_helper->addAdditionalWeightCharges( - $this->_getWz2Rates(), - $this->additionalChargeWz2, - $weight - ); + case Meanbee_Royalmail_Helper_Data::WORLD_ZONE_TWO: + $rates = $this->_getWz2Rates(); break; + default: + return null; } return $rates; } - 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'); } 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 45fbe1c..1020c96 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 @@ -20,11 +20,6 @@ class Meanbee_Royalmail_Model_Shipping_Carrier_Royalmail_Internationaltracked extends Meanbee_Royalmail_Model_Shipping_Carrier_Royalmail_Abstract { - protected $additionalChargeEu = 1.74; - protected $additionalChargeNonEu = 1.45; - protected $additionalChargeWz1 = 2.70; - protected $additionalChargeWz2 = 2.85; - protected $maxWeight = 5000; protected $insureOver = 50; protected $additionalInsuranceChargeEu = 3; protected $additionalInsuranceChargeNonEu = 2.50; @@ -35,79 +30,53 @@ public function getRates() { $_helper = Mage::helper('royalmail'); $country = $this->_getCountry(); $worldZone = $_helper->getWorldZone($country); - $weight = $this->_getWeight(); - if($weight > $this->maxWeight) { - return null; - } if (!$_helper->isCountryAvailableForInternationalTracked($country)) { return null; } switch($worldZone) { - case 'gb': + case Meanbee_Royalmail_Helper_Data::WORLD_ZONE_GB: return null; - case 'eu': - $rates = $_helper->addAdditionalWeightCharges( - $_helper->addInsuranceCharges( - $this->_getEuRates(), - $this->additionalInsuranceChargeEu, - $this->getCartTotal(), - $this->insureOver - ), - $this->additionalChargeEu, - $weight + case Meanbee_Royalmail_Helper_Data::WORLD_ZONE_EU: + $rates = $_helper->addInsuranceCharges( + $this->_getEuRates(), + $this->additionalInsuranceChargeEu, + $this->getCartTotal(), + $this->insureOver ); break; - case 'noneu': - $rates = $_helper->addAdditionalWeightCharges( - $_helper->addInsuranceCharges( - $this->_getNonEuRates(), - $this->additionalInsuranceChargeNonEu, - $this->getCartTotal(), - $this->insureOver - ), - $this->additionalChargeNonEu, - $weight + case Meanbee_Royalmail_Helper_Data::WORLD_ZONE_NONEU: + $rates = $_helper->addInsuranceCharges( + $this->_getNonEuRates(), + $this->additionalInsuranceChargeNonEu, + $this->getCartTotal(), + $this->insureOver ); break; - case 'wz1': - $rates = $_helper->addAdditionalWeightCharges( - $_helper->addInsuranceCharges( - $this->_getWz1Rates(), - $this->additionalInsuranceChargeWz1, - $this->getCartTotal(), - $this->insureOver - ), - $this->additionalChargeWz1, - $weight + case Meanbee_Royalmail_Helper_Data::WORLD_ZONE_ONE: + $rates = $_helper->addInsuranceCharges( + $this->_getWz1Rates(), + $this->additionalInsuranceChargeWz1, + $this->getCartTotal(), + $this->insureOver ); break; - case 'wz2': - $rates = $_helper->addAdditionalWeightCharges( - $_helper->addInsuranceCharges( - $this->_getWz2Rates(), - $this->additionalInsuranceChargeWz2, - $this->getCartTotal(), - $this->insureOver - ), - $this->additionalChargeWz2, - $weight + case Meanbee_Royalmail_Helper_Data::WORLD_ZONE_TWO: + $rates = $_helper->addInsuranceCharges( + $this->_getWz2Rates(), + $this->additionalInsuranceChargeWz2, + $this->getCartTotal(), + $this->insureOver ); break; + default: + return null; } return $rates; } - 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'); } diff --git a/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Internationaltrackedsigned.php b/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Internationaltrackedsigned.php index 374c9ed..e73d242 100644 --- a/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Internationaltrackedsigned.php +++ b/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Internationaltrackedsigned.php @@ -18,26 +18,65 @@ */ class Meanbee_Royalmail_Model_Shipping_Carrier_Royalmail_Internationaltrackedsigned - extends Meanbee_Royalmail_Model_Shipping_Carrier_Royalmail_Internationalstandard { + extends Meanbee_Royalmail_Model_Shipping_Carrier_Royalmail_Abstract { protected $insureOver = 50; - protected $additionalInsuranceCharge = 2.50; + protected $additionalInsuranceChargeEu = 2.50; + protected $additionalInsuranceChargeWz1 = 2.50; + protected $additionalInsuranceChargeWz2 = 2.50; public function getRates() { - $helper = Mage::helper('royalmail'); + $_helper = Mage::helper('royalmail'); $country = $this->_getCountry(); + $worldZone = $_helper->getWorldZone($country); - if (!$helper->isCountryAvailableForInternationalTrackedAndSigned($country)) { + + if (!$_helper->isCountryAvailableForInternationalTrackedAndSigned($country)) { return null; } - $rates = parent::getRates(); - 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; - } + switch($worldZone) { + case Meanbee_Royalmail_Helper_Data::WORLD_ZONE_GB: + return null; + case Meanbee_Royalmail_Helper_Data::WORLD_ZONE_EU: + $rates = $_helper->addInsuranceCharges( + $this->_getEuRates(), + $this->additionalInsuranceChargeEu, + $this->getCartTotal(), + $this->insureOver + ); + break; + case Meanbee_Royalmail_Helper_Data::WORLD_ZONE_ONE: + $rates = $_helper->addInsuranceCharges( + $this->_getWz1Rates(), + $this->additionalInsuranceChargeWz1, + $this->getCartTotal(), + $this->insureOver + ); + break; + case Meanbee_Royalmail_Helper_Data::WORLD_ZONE_TWO: + $rates = $_helper->addInsuranceCharges( + $this->_getWz2Rates(), + $this->additionalInsuranceChargeWz2, + $this->getCartTotal(), + $this->insureOver + ); + break; + default: + return null; } return $rates; } -} \ No newline at end of file + + protected function _getEuRates() { + return $this->_loadCsv('internationaltrackedsigned_eu'); + } + + protected function _getWz1Rates() { + return $this->_loadCsv('internationaltrackedsigned_wz1'); + } + + protected function _getWz2Rates() { + return $this->_loadCsv('internationaltrackedsigned_wz2'); + } +} diff --git a/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Largeletter.php b/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Largeletter.php index bbbd9ab..95182a4 100644 --- a/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Largeletter.php +++ b/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Largeletter.php @@ -24,7 +24,7 @@ protected function getRates() { $helper = Mage::helper('royalmail'); $rates = $this->_loadCsv('largeletter'); - if ($helper->getWorldZone($this->_getCountry()) == 'gb') { + if ($helper->getWorldZone($this->_getCountry()) == Meanbee_Royalmail_Helper_Data::WORLD_ZONE_GB) { return $rates; } diff --git a/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Letter.php b/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Letter.php index c923332..013c97e 100644 --- a/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Letter.php +++ b/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Letter.php @@ -24,7 +24,7 @@ protected function getRates() { $helper = Mage::helper('royalmail'); $rates = $this->_loadCsv('letter'); - if ($helper->getWorldZone($this->_getCountry()) == 'gb') { + if ($helper->getWorldZone($this->_getCountry()) == Meanbee_Royalmail_Helper_Data::WORLD_ZONE_GB) { return $rates; } diff --git a/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Secondclass.php b/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Secondclass.php index 8cb9211..c184483 100644 --- a/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Secondclass.php +++ b/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Secondclass.php @@ -32,12 +32,9 @@ protected function getRates() { } protected function _getRateFile() { - $weight = $this->_getWeight(); - if ($weight <= 2000) { - if (Mage::getStoreConfig('carriers/royalmail/parcel_size') == Meanbee_Royalmail_Model_Parcelsize::SMALL) { - return 'secondclass_small'; - } + if (Mage::getStoreConfig('carriers/royalmail/parcel_size') == Meanbee_Royalmail_Model_Parcelsize::SMALL) { + return 'secondclass_small'; } return 'secondclass_medium'; diff --git a/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Secondclasslargelettersignedfor.php b/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Secondclasslargelettersignedfor.php new file mode 100644 index 0000000..5ccbedb --- /dev/null +++ b/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Secondclasslargelettersignedfor.php @@ -0,0 +1,34 @@ +_loadCsv('secondclass_largeletter_signedfor'); + + if ($helper->getWorldZone($this->_getCountry()) == Meanbee_Royalmail_Helper_Data::WORLD_ZONE_GB) { + return $rates; + } + + return null; + } + +} \ No newline at end of file diff --git a/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Secondclasslettersignedfor.php b/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Secondclasslettersignedfor.php new file mode 100644 index 0000000..220e15c --- /dev/null +++ b/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Secondclasslettersignedfor.php @@ -0,0 +1,34 @@ +_loadCsv('secondclass_letter_signedfor'); + + if ($helper->getWorldZone($this->_getCountry()) == Meanbee_Royalmail_Helper_Data::WORLD_ZONE_GB) { + return $rates; + } + + return null; + } + +} \ No newline at end of file diff --git a/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Secondclassrecordedsignedfor.php b/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Secondclassrecordedsignedfor.php index 1ac578f..dfd34bd 100644 --- a/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Secondclassrecordedsignedfor.php +++ b/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Secondclassrecordedsignedfor.php @@ -20,15 +20,23 @@ class Meanbee_Royalmail_Model_Shipping_Carrier_Royalmail_Secondclassrecordedsignedfor extends Meanbee_Royalmail_Model_Shipping_Carrier_Royalmail_Secondclass { - private $_extraCharge = 1.10; - protected function getRates() { - $rates = parent::getRates(); + $helper = Mage::helper('royalmail'); + $rates = $this->_loadCsv($this->_getRateFile()); + + if ($helper->getWorldZone($this->_getCountry()) == Meanbee_Royalmail_Helper_Data::WORLD_ZONE_GB) { + return $rates; + } + + return null; + } + + protected function _getRateFile() { - for ($i = 0; $i < count($rates); $i++) { - $rates[$i]['cost'] += $this->_extraCharge; + if (Mage::getStoreConfig('carriers/royalmail/parcel_size') == Meanbee_Royalmail_Model_Parcelsize::SMALL) { + return 'secondclass_small_signedfor'; } - return $rates; + return 'secondclass_medium_signedfor'; } } diff --git a/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Specialdelivery9am.php b/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Specialdelivery9am.php index 9aee7bd..521f866 100644 --- a/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Specialdelivery9am.php +++ b/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Specialdelivery9am.php @@ -24,7 +24,7 @@ protected function getRates() { $helper = Mage::helper('royalmail'); $rates = $this->_getRatesCsv(); - if ($helper->getWorldZone($this->_getCountry()) == 'gb' && $this->_getCountry() != "GG") { + if ($helper->getWorldZone($this->_getCountry()) == Meanbee_Royalmail_Helper_Data::WORLD_ZONE_GB && $this->_getCountry() != "GG") { return $rates; } diff --git a/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Specialdelivery9amsaturday.php b/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Specialdelivery9amsaturday.php new file mode 100644 index 0000000..053014d --- /dev/null +++ b/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Specialdelivery9amsaturday.php @@ -0,0 +1,45 @@ +_getRatesCsv(); + + if ($helper->getWorldZone($this->_getCountry()) == Meanbee_Royalmail_Helper_Data::WORLD_ZONE_GB && $this->_getCountry() != "GG") { + return $rates; + } + + return null; + } + + protected function _getRatesCsv() { + $total = $this->getCartTotal(); + if ($total <= 50) { + return $this->_loadCsv('9am50saturday'); + } else if ($total <= 1000) { + return $this->_loadCsv('9am1000saturday'); + } else if ($total <= 2500) { + return $this->_loadCsv('9am2500saturday'); + } + return null; + } +} diff --git a/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Specialdeliverynextday.php b/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Specialdeliverynextday.php index ee77b05..c0e12cf 100644 --- a/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Specialdeliverynextday.php +++ b/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Specialdeliverynextday.php @@ -24,7 +24,7 @@ protected function getRates() { $helper = Mage::helper('royalmail'); $rates = $this->_getRatesCsv(); - if ($helper->getWorldZone($this->_getCountry()) == 'gb') { + if ($helper->getWorldZone($this->_getCountry()) == Meanbee_Royalmail_Helper_Data::WORLD_ZONE_GB) { return $rates; } diff --git a/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Specialdeliverynextdaysaturday.php b/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Specialdeliverynextdaysaturday.php new file mode 100644 index 0000000..c1dd3d4 --- /dev/null +++ b/app/code/community/Meanbee/Royalmail/Model/Shipping/Carrier/Royalmail/Specialdeliverynextdaysaturday.php @@ -0,0 +1,45 @@ +_getRatesCsv(); + + if ($helper->getWorldZone($this->_getCountry()) == Meanbee_Royalmail_Helper_Data::WORLD_ZONE_GB) { + return $rates; + } + + return null; + } + + protected function _getRatesCsv() { + $total = $this->getCartTotal(); + if ($total <= 500) { + return $this->_loadCsv('nextday500saturday'); + } else if ($total <= 1000) { + return $this->_loadCsv('nextday1000saturday'); + } else if ($total <= 2500) { + return $this->_loadCsv('nextday2500saturday'); + } + return null; + } +} 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 deleted file mode 100644 index 56f6d27..0000000 --- a/app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Firstclass.php +++ /dev/null @@ -1,61 +0,0 @@ -_model = Mage::getModel('royalmail/shipping_carrier_royalmail_firstclass'); - } - - public function tearDown() { - parent::tearDown(); - - $this->_model = null; - } - - public function testNotAllowedFromFrance() { - $this->assertNull( - $this->_model->getCost($this->_getRateRequest( - 50, - 1.00, - 'FR' - )) - ); - } - - public function testMinimalPrice() { - $this->assertEquals( - 3.20, - $this->_model->getCost( - $this->_getRateRequest( - 50, - 1.00, - 'GB' - ) - ) - ); - } - - public function testUpperLimit() { - $this->assertEquals( - 33.40, - $this->_model->getCost( - $this->_getRateRequest( - 20000, - 1.00, - 'GB' - ) - ) - ); - - $this->assertNull( - $this->_model->getCost($this->_getRateRequest( - 20001, - 1.00, - 'GB' - )) - ); - } -} 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 deleted file mode 100644 index 25bbaee..0000000 --- a/app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Firstclassrecordedsignedfor.php +++ /dev/null @@ -1,61 +0,0 @@ -_model = Mage::getModel('royalmail/shipping_carrier_royalmail_firstclassrecordedsignedfor'); - } - - public function tearDown() { - parent::tearDown(); - - $this->_model = null; - } - - public function testNotAllowedFromFrance() { - $this->assertNull( - $this->_model->getCost($this->_getRateRequest( - 50, - 1.00, - 'FR' - )) - ); - } - - public function testMinimalPrice() { - $this->assertEquals( - 4.30, - $this->_model->getCost( - $this->_getRateRequest( - 50, - 1.00, - 'GB' - ) - ) - ); - } - - public function testUpperLimit() { - $this->assertEquals( - 34.50, - $this->_model->getCost( - $this->_getRateRequest( - 20000, - 1.00, - 'GB' - ) - ) - ); - - $this->assertNull( - $this->_model->getCost($this->_getRateRequest( - 20001, - 1.00, - 'GB' - )) - ); - } -} diff --git a/app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Internationaleconomy.php b/app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Internationaleconomy.php deleted file mode 100644 index 1f7e621..0000000 --- a/app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Internationaleconomy.php +++ /dev/null @@ -1,61 +0,0 @@ -_model = Mage::getModel('royalmail/shipping_carrier_royalmail_internationaleconomy'); - } - - public function tearDown() { - parent::tearDown(); - - $this->_model = null; - } - - public function testNotAllowedFromGb() { - $this->assertNull( - $this->_model->getCost($this->_getRateRequest( - 50, - 1.00, - 'GB' - )) - ); - } - - public function testMinimalPrice() { - $this->assertEquals( - 2.80, - $this->_model->getCost( - $this->_getRateRequest( - 50, - 1.00, - 'FR' - ) - ) - ); - } - - public function testUpperLimit() { - $this->assertEquals( - 13.80, - $this->_model->getCost( - $this->_getRateRequest( - 2000, - 1.00, - 'FR' - ) - ) - ); - - $this->assertNull( - $this->_model->getCost($this->_getRateRequest( - 2001, - 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 deleted file mode 100644 index 1f8d129..0000000 --- a/app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Internationalsigned.php +++ /dev/null @@ -1,95 +0,0 @@ -_model = Mage::getModel('royalmail/shipping_carrier_royalmail_internationalsigned'); - } - - public function tearDown() { - parent::tearDown(); - - $this->_model = null; - } - - public function testAllowedFromFiji() { - $this->assertEquals( - 9, - $this->_model->getCost($this->_getRateRequest( - 100, - 1.00, - 'FJ' - )) - ); - } - - public function testNotAllowedFromFrance() { - $this->assertNull( - $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( - 9, - $this->_model->getCost( - $this->_getRateRequest( - 50, - 1.00, - 'FJ' - ) - ) - ); - } - - public function testUpperLimit() { - $this->assertEquals( - 30, - $this->_model->getCost( - $this->_getRateRequest( - 2000, - 1.00, - 'FJ' - ) - ) - ); - - $this->assertNull( - $this->_model->getCost($this->_getRateRequest( - 5001, - 1.00, - 'FR' - )) - ); - } - - public function testAdditionalInsuranceCharge() { - $this->assertEquals( - 32.5, - $this->_model->getCost( - $this->_getRateRequest( - 2000, - 100.00, - 'FJ' - ) - ) - ); - } -} 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 deleted file mode 100644 index 0e6b0ca..0000000 --- a/app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Internationalstandard.php +++ /dev/null @@ -1,72 +0,0 @@ -_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 deleted file mode 100644 index 8b3c081..0000000 --- a/app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Internationaltracked.php +++ /dev/null @@ -1,93 +0,0 @@ -_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 testNotAllowedFromAfghanistan() { - $this->assertNull( - $this->_model->getCost($this->_getRateRequest( - 100, - 1.00, - 'AF' - )) - ); - } - - public function testAllowedFromNonEuCountry() { - $this->assertEquals( - 9, - $this->_model->getCost($this->_getRateRequest( - 100, - 1.00, - 'AU' - )) - ); - } - - 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/Internationaltrackedsigned.php b/app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Internationaltrackedsigned.php deleted file mode 100644 index 7506941..0000000 --- a/app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Internationaltrackedsigned.php +++ /dev/null @@ -1,95 +0,0 @@ -_model = Mage::getModel('royalmail/shipping_carrier_royalmail_internationaltrackedsigned'); - } - - 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 testNotAllowedFromAfghanistan() { - $this->assertNull( - $this->_model->getCost($this->_getRateRequest( - 100, - 1.00, - 'AF' - )) - ); - } - - 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/Largeletter.php b/app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Largeletter.php deleted file mode 100644 index 8037819..0000000 --- a/app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Largeletter.php +++ /dev/null @@ -1,61 +0,0 @@ -_model = Mage::getModel('royalmail/shipping_carrier_royalmail_largeletter'); - } - - public function tearDown() { - parent::tearDown(); - - $this->_model = null; - } - - public function testNotAllowedFromFrance() { - $this->assertNull( - $this->_model->getCost($this->_getRateRequest( - 50, - 1.00, - 'FR' - )) - ); - } - - public function testMinimalPrice() { - $this->assertEquals( - 0.93, - $this->_model->getCost( - $this->_getRateRequest( - 50, - 1.00, - 'GB' - ) - ) - ); - } - - public function testUpperLimit() { - $this->assertEquals( - 2.38, - $this->_model->getCost( - $this->_getRateRequest( - 750, - 1.00, - 'GB' - ) - ) - ); - - $this->assertNull( - $this->_model->getCost($this->_getRateRequest( - 751, - 1.00, - 'GB' - )) - ); - } -} 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 deleted file mode 100644 index cbcdbcd..0000000 --- a/app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Letter.php +++ /dev/null @@ -1,61 +0,0 @@ -_model = Mage::getModel('royalmail/shipping_carrier_royalmail_letter'); - } - - public function tearDown() { - parent::tearDown(); - - $this->_model = null; - } - - public function testNotAllowedFromFrance() { - $this->assertNull( - $this->_model->getCost($this->_getRateRequest( - 50, - 1.00, - 'FR' - )) - ); - } - - public function testMinimalPrice() { - $this->assertEquals( - 0.62, - $this->_model->getCost( - $this->_getRateRequest( - 50, - 1.00, - 'GB' - ) - ) - ); - } - - public function testUpperLimit() { - $this->assertEquals( - 0.62, - $this->_model->getCost( - $this->_getRateRequest( - 100, - 1.00, - 'GB' - ) - ) - ); - - $this->assertNull( - $this->_model->getCost($this->_getRateRequest( - 101, - 1.00, - 'GB' - )) - ); - } -} diff --git a/app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Rules.php b/app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Rules.php new file mode 100644 index 0000000..00bea1d --- /dev/null +++ b/app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Rules.php @@ -0,0 +1,168 @@ + 'GB', + Meanbee_Royalmail_Helper_Data::WORLD_ZONE_NONEU => 'RS', + Meanbee_Royalmail_Helper_Data::WORLD_ZONE_EU => 'FR', + Meanbee_Royalmail_Helper_Data::WORLD_ZONE_ONE => 'US', + Meanbee_Royalmail_Helper_Data::WORLD_ZONE_TWO => 'AU', + ); + + /** + * @test + * @dataProvider dataProvider + * @dataProviderFile runTests.yaml + * + * @param $modelAlias + * @param $data + */ + public function runTests($modelAlias, $data) + { + $this->_model = Mage::getModel("royalmail/shipping_carrier_royalmail_{$modelAlias}"); + + if (!is_array($data['zones'])) { + $this->testAllowedZone($this->getCountryCode($data), $data['weights']['lowest'], $data['weights']['highest']); + $this->testNotAllowedZones($this->getNotAllowedCountryCode($data), $data['weights']['lowest'], $data['weights']['highest']); + } else { + foreach ($data['zones'] as $key => $zone) { + $this->testAllowedZone($this->getCountryCode($data, $key), $data['weights']['lowest'], $data['weights']['highest']); + $this->testNotAllowedZones($this->getNotAllowedCountryCode($data, $key), $data['weights']['lowest'], $data['weights']['highest']); + } + } + } + + /** + * Test each allowed zones set, for the maximum and minimum + * weight and prices. + * + * @param string $zone + * @param string $lowest + * @param string $highest + */ + protected function testAllowedZone($zone, $lowest, $highest) + { + $this->testWeight(floatval($lowest['price']), floatval($lowest['weight']), $zone, $this->getCartTotal($lowest)); + $this->testWeight(floatval($highest['price']), floatval($highest['weight']), $zone, $this->getCartTotal($highest)); + } + + /** + * Test each all zones which are not allowed for the maximum and + * minimum weight and prices. + * + * @param string $zone + * @param array $lowest + * @param array $highest + * @param float $cartTotal + */ + protected function testNotAllowedZones($zone, $lowest, $highest, $cartTotal = 1.00) + { + $this->assertNull( + $this->_model->getCost( + $this->_getRateRequest( + $lowest['weight'], + $cartTotal, + $zone + ) + ) + ); + $this->assertNull( + $this->_model->getCost( + $this->_getRateRequest( + $highest['weight'], + $cartTotal, + $zone + ) + ) + ); + } + + /** + * Test that the price is correct based on country code and weight. + * + * @param mixed $price + * @param float $weight + * @param string $zone + * @param float $cartTotal + */ + protected function testWeight($price, $weight, $zone, $cartTotal = 1.00) + { + $this->assertEquals( + $price, + $this->_model->getCost( + $this->_getRateRequest( + $weight, + $cartTotal, + $zone + ) + ) + ); + } + + /** + * Get the Country Code from Zone. + * + * @param $data + * @param null|string $key + * + * @return string + */ + protected function getCountryCode($data, $key = null) + { + if (isset($data['country_code'])) { + if (is_array($data['country_code'])) { + return $data['country_code'][$key]; + } else { + return $data['country_code']; + } + } + + if (is_array($data['zones'])) { + return $this->_countryCodes[$data['zones'][$key]]; + } else { + return $this->_countryCodes[$data['zones']]; + } + + } + + /** + * Get the total price of the cart. + * + * @param $data + * @return float + */ + protected function getCartTotal($data) + { + if (isset($data['cart_total'])) { + return $data['cart_total']; + } else { + return 1.00; + } + } + + /** + * Get a country code that isn't aloud for the method. + * + * @param array $data + * @param null|string $key + * + * @return string + */ + protected function getNotAllowedCountryCode($data, $key = null) + { + if(isset($data['not_allowed_zone'])) { + $data['zone'] = $data['not_allowed_zone']; + return $this->getCountryCode($data, $key); + } + $code = $this->getCountryCode($data, $key); + if($code == 'GB') { + return $this->_countryCodes[Meanbee_Royalmail_Helper_Data::WORLD_ZONE_NONEU]; + } else { + return $this->_countryCodes[Meanbee_Royalmail_Helper_Data::WORLD_ZONE_GB]; + } + } + +} diff --git a/app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Rules/providers/runTests.yaml b/app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Rules/providers/runTests.yaml new file mode 100644 index 0000000..2414ba4 --- /dev/null +++ b/app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Rules/providers/runTests.yaml @@ -0,0 +1,132 @@ +- + model_alias: letter + data: { csv: letter, weights: { lowest: { weight: '100', price: "0.63" }, highest: { weight: '100', price: "0.63" } }, zones: gb } +- + model_alias: largeletter + data: { csv: largeletter, weights: { lowest: { weight: '250', price: '1.26' }, highest: { weight: '750', price: '2.42' } }, zones: gb } +- + model_alias: firstclasslettersignedfor + data: { csv: firstclass_letter_signedfor, weights: { lowest: { weight: '100', price: "1.73" }, highest: { weight: '100', price: "1.73" } }, zones: gb } +- + model_alias: firstclasslargelettersignedfor + data: { csv: firstclass_largeletter_signedfor, weights: { lowest: { weight: '250', price: '2.36' }, highest: { weight: '750', price: '3.52' } }, zones: gb } +- + model_alias: secondclassletter + data: { csv: secondclass_letter, weights: { lowest: { weight: '100', price: "0.54" }, highest: { weight: '100', price: "0.54" } }, zones: gb } +- + model_alias: secondclasslargeletter + data: { csv: secondclass_largeletter, weights: { lowest: { weight: '250', price: '1.19' }, highest: { weight: '750', price: '2.05' } }, zones: gb } +- + model_alias: secondclasslettersignedfor + data: { csv: secondclass_letter_signedfor, weights: { lowest: { weight: '100', price: "1.64" }, highest: { weight: '100', price: "1.64" } }, zones: gb } +- + model_alias: secondclasslargelettersignedfor + data: { csv: secondclass_largeletter_signedfor, weights: { lowest: { weight: '250', price: '2.36' }, highest: { weight: '750', price: '3.52' } }, zones: gb } +- + model_alias: specialdeliverynextday + data: { csv: nextday500, weights: { lowest: { weight: '500', price: '7.25' }, highest: { weight: '20000', price: '41.20' } }, zones: gb } +- + model_alias: specialdeliverynextday + data: { csv: nextday1000, weights: { lowest: { weight: '500', price: '8.25', cart_total: '999' }, highest: { weight: '20000', price: '41.20', cart_total: '999' } }, zones: gb } +- + model_alias: specialdeliverynextday + data: { csv: nextday2500, weights: { lowest: { weight: '500', price: '10.25', cart_total: '2499' }, highest: { weight: '20000', price: '44.20', cart_total: '2499' } }, zones: gb } +- + model_alias: specialdelivery9am + data: { csv: 9am50, weights: { lowest: { weight: '500', price: '20.76' }, highest: { weight: '2000', price: '26.94' } }, zones: gb } +- + model_alias: specialdelivery9am + data: { csv: 9am1000, weights: { lowest: { weight: '500', price: '22.96', cart_total: '999' }, highest: { weight: '2000', price: '29.14', cart_total: '999' } }, zones: gb } +- + model_alias: specialdelivery9am + data: { csv: 9am2500, weights: { lowest: { weight: '500', price: '26.46', cart_total: '2499' }, highest: { weight: '2000', price: '32.64', cart_total: '2499' } }, zones: gb } +- + model_alias: specialdelivery9amsaturday + data: { csv: 9am50saturday, weights: { lowest: { weight: '500', price: '23.76' }, highest: { weight: '2000', price: '29.94' } }, zones: gb } +- + model_alias: specialdelivery9amsaturday + data: { csv: 9am1000saturday, weights: { lowest: { weight: '500', price: '25.96', cart_total: '999' }, highest: { weight: '2000', price: '32.14', cart_total: '999' } }, zones: gb } +- + model_alias: specialdelivery9amsaturday + data: { csv: 9am2500saturday, weights: { lowest: { weight: '500', price: '29.46', cart_total: '2499' }, highest: { weight: '2000', price: '35.64', cart_total: '2499' } }, zones: gb } +- + model_alias: specialdeliverynextdaysaturday + data: { csv: nextday500saturday, weights: { lowest: { weight: '500', price: '11.70' }, highest: { weight: '20000', price: '52.44' } }, zones: gb } +- + model_alias: specialdeliverynextdaysaturday + data: { csv: nextday1000saturday, weights: { lowest: { weight: '500', price: '12.90', cart_total: '999' }, highest: { weight: '20000', price: '53.64', cart_total: '999' } }, zones: gb } +- + model_alias: specialdeliverynextdaysaturday + data: { csv: nextday2500saturday, weights: { lowest: { weight: '500', price: '15.18', cart_total: '2499' }, highest: { weight: '20000', price: '56.04', cart_total: '2499' } }, zones: gb } +- + model_alias: internationalstandard + data: { csv: internationalstandard_europe, weights: { lowest: { weight: '250', price: '3.95' }, highest: { weight: '2000', price: '13.46' } }, zones: eu } +- + model_alias: internationalstandard + data: { csv: internationalstandard_wz1, weights: { lowest: { weight: '250', price: '5.00' }, highest: { weight: '2000', price: '19.75' } }, zones: wz1 } +- + model_alias: internationalstandard + data: { csv: internationalstandard_wz2, weights: { lowest: { weight: '250', price: '5.45' }, highest: { weight: '2000', price: '21.50' } }, zones: wz2 } +- + model_alias: internationaltrackedsigned + data: { csv: internationaltrackedsigned_eu, weights: { lowest: { weight: '250', price: '8.7' }, highest: { weight: '2000', price: '16.96' } }, zones: eu } +- + model_alias: internationaltrackedsigned + data: { csv: internationaltrackedsigned_wz1, weights: { lowest: { weight: '250', price: '9.75' }, highest: { weight: '2000', price: '23.25' } }, zones: wz1 } +- + model_alias: internationaltrackedsigned + data: { csv: internationaltrackedsigned_wz2, weights: { lowest: { weight: '250', price: '10.05' }, highest: { weight: '2000', price: '25.00' } }, zones: wz2, country_code: NZ } +- + model_alias: internationaltracked + data: { csv: internationaltracked_eu, weights: { lowest: { weight: '250', price: '10.44' }, highest: { weight: '2000', price: '20.36' } }, zones: eu } +- + model_alias: internationaltracked + data: { csv: internationaltracked_noneu, weights: { lowest: { weight: '250', price: '8.70' }, highest: { weight: '2000', price: '16.96' } }, zones: noneu, country_code: LI } +- + model_alias: internationaltracked + data: { csv: internationaltracked_wz1, weights: { lowest: { weight: '250', price: '9.75' }, highest: { weight: '2000', price: '23.55' } }, zones: wz1 } +- + model_alias: internationaltracked + data: { csv: internationaltracked_wz2, weights: { lowest: { weight: '250', price: '10.05' }, highest: { weight: '2000', price: '25.00' } }, zones: wz2 } +- + model_alias: internationalsigned + data: { csv: internationalsigned_eu, weights: { lowest: { weight: '250', price: '8.7' }, highest: { weight: '2000', price: '16.96' } }, zones: eu, country_code: CY } +- + model_alias: internationalsigned + data: { csv: internationalsigned_wz1, weights: { lowest: { weight: '250', price: '9.75' }, highest: { weight: '2000', price: '23.25' } }, zones: wz1, country_code: AO } +- + model_alias: internationalsigned + data: { csv: internationalsigned_wz2, weights: { lowest: { weight: '250', price: '10.05' }, highest: { weight: '2000', price: '25.00' } }, zones: wz2 } +- + model_alias: internationaleconomy + data: { csv: internationaleconomy, weights: { lowest: { weight: '250', price: '3.75' }, highest: { weight: '2000', price: '13.26' } }, zones: wz1 } +- + model_alias: internationallettertracked + data: { csv: internationallettertracked_eu, weights: { lowest: { weight: '20', price: '7.20' }, highest: { weight: '100', price: '7.83' } }, zones: eu } +- + model_alias: internationallettertracked + data: { csv: internationallettertracked_noneu, weights: { lowest: { weight: '20', price: null }, highest: { weight: '100', price: null } }, zones: noneu } +- + model_alias: internationallettertracked + data: { csv: internationallettertracked_wz, weights: { lowest: { weight: '20', price: '6.33' }, highest: { weight: '100', price: '7.25' } }, zones: [wz1, wz2] } +- + model_alias: internationallettersigned + data: { csv: internationallettersigned_eu, weights: { lowest: { weight: '20', price: null }, highest: { weight: '100', price: null } }, zones: eu } +- + model_alias: internationallettersigned + data: { csv: internationallettersigned_wz, weights: { lowest: { weight: '20', price: '6.33' }, highest: { weight: '100', price: '7.25' } }, zones: [wz1, wz2], country_code: [TN, NC] } +- + model_alias: internationallettereconomy + data: { csv: internationalltettereconomy, weights: { lowest: { weight: '20', price: '1.33' }, highest: { weight: '100', price: '2.25' } }, zones: [wz1, wz2, eu] } +- + model_alias: internationalletterstandard + data: { csv: internationalletterstandard_eu, weights: { lowest: { weight: '20', price: '1.00' }, highest: { weight: '100', price: '1.52' } }, zones: eu } +- + model_alias: internationalletterstandard + data: { csv: internationalletterstandard_wz, weights: { lowest: { weight: '20', price: '1.33' }, highest: { weight: '100', price: '2.25' } }, zones: [wz1, wz2] } +- + model_alias: internationallettertrackedsigned + data: { csv: internationallettertrackedsigned_eu, weights: { lowest: { weight: '20', price: '1.00' }, highest: { weight: '100', price: '1.52' } }, zones: eu, country_code: AT } +- + model_alias: internationallettertrackedsigned + data: { csv: internationallettertrackedsigned_wz, weights: { lowest: { weight: '60', price: '7.15' }, highest: { weight: '100', price: '8.45' } }, zones: [wz1, wz2], country_code: [CA, CA] } 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 deleted file mode 100644 index a37073b..0000000 --- a/app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Secondclass.php +++ /dev/null @@ -1,61 +0,0 @@ -_model = Mage::getModel('royalmail/shipping_carrier_royalmail_secondclass'); - } - - public function tearDown() { - parent::tearDown(); - - $this->_model = null; - } - - public function testNotAllowedFromFrance() { - $this->assertNull( - $this->_model->getCost($this->_getRateRequest( - 50, - 1.00, - 'FR' - )) - ); - } - - public function testMinimalPrice() { - $this->assertEquals( - 5.20, - $this->_model->getCost( - $this->_getRateRequest( - 50, - 1.00, - 'GB' - ) - ) - ); - } - - public function testUpperLimit() { - $this->assertEquals( - 28.55, - $this->_model->getCost( - $this->_getRateRequest( - 20000, - 1.00, - 'GB' - ) - ) - ); - - $this->assertNull( - $this->_model->getCost($this->_getRateRequest( - 20001, - 1.00, - 'GB' - )) - ); - } -} diff --git a/app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Secondclasslargeletter.php b/app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Secondclasslargeletter.php deleted file mode 100644 index 1e44139..0000000 --- a/app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Secondclasslargeletter.php +++ /dev/null @@ -1,61 +0,0 @@ -_model = Mage::getModel('royalmail/shipping_carrier_royalmail_secondclasslargeletter'); - } - - public function tearDown() { - parent::tearDown(); - - $this->_model = null; - } - - public function testNotAllowedFromFrance() { - $this->assertNull( - $this->_model->getCost($this->_getRateRequest( - 50, - 1.00, - 'FR' - )) - ); - } - - public function testMinimalPrice() { - $this->assertEquals( - 0.73, - $this->_model->getCost( - $this->_getRateRequest( - 50, - 1.00, - 'GB' - ) - ) - ); - } - - public function testUpperLimit() { - $this->assertEquals( - 2.01, - $this->_model->getCost( - $this->_getRateRequest( - 750, - 1.00, - 'GB' - ) - ) - ); - - $this->assertNull( - $this->_model->getCost($this->_getRateRequest( - 751, - 1.00, - 'GB' - )) - ); - } -} diff --git a/app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Secondclassletter.php b/app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Secondclassletter.php deleted file mode 100644 index 3ae1105..0000000 --- a/app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Secondclassletter.php +++ /dev/null @@ -1,61 +0,0 @@ -_model = Mage::getModel('royalmail/shipping_carrier_royalmail_secondclassletter'); - } - - public function tearDown() { - parent::tearDown(); - - $this->_model = null; - } - - public function testNotAllowedFromFrance() { - $this->assertNull( - $this->_model->getCost($this->_getRateRequest( - 50, - 1.00, - 'FR' - )) - ); - } - - public function testMinimalPrice() { - $this->assertEquals( - 0.53, - $this->_model->getCost( - $this->_getRateRequest( - 50, - 1.00, - 'GB' - ) - ) - ); - } - - public function testUpperLimit() { - $this->assertEquals( - 0.53, - $this->_model->getCost( - $this->_getRateRequest( - 100, - 1.00, - 'GB' - ) - ) - ); - - $this->assertNull( - $this->_model->getCost($this->_getRateRequest( - 101, - 1.00, - 'GB' - )) - ); - } -} 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 deleted file mode 100644 index 710e672..0000000 --- a/app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Secondclassrecordedsignedfor.php +++ /dev/null @@ -1,61 +0,0 @@ -_model = Mage::getModel('royalmail/shipping_carrier_royalmail_secondclassrecordedsignedfor'); - } - - public function tearDown() { - parent::tearDown(); - - $this->_model = null; - } - - public function testNotAllowedFromFrance() { - $this->assertNull( - $this->_model->getCost($this->_getRateRequest( - 50, - 1.00, - 'FR' - )) - ); - } - - public function testMinimalPrice() { - $this->assertEquals( - 6.30, - $this->_model->getCost( - $this->_getRateRequest( - 50, - 1.00, - 'GB' - ) - ) - ); - } - - public function testUpperLimit() { - $this->assertEquals( - 29.65, - $this->_model->getCost( - $this->_getRateRequest( - 20000, - 1.00, - 'GB' - ) - ) - ); - - $this->assertNull( - $this->_model->getCost($this->_getRateRequest( - 20001, - 1.00, - 'GB' - )) - ); - } -} diff --git a/app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Specialdelivery9am.php b/app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Specialdelivery9am.php deleted file mode 100644 index b4d0574..0000000 --- a/app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Specialdelivery9am.php +++ /dev/null @@ -1,83 +0,0 @@ -_model = Mage::getModel('royalmail/shipping_carrier_royalmail_specialdelivery9am'); - } - - public function tearDown() { - parent::tearDown(); - - $this->_model = null; - } - - public function testNotAllowedFromFrance() { - $this->assertNull( - $this->_model->getCost($this->_getRateRequest( - 50, - 1.00, - 'FR' - )) - ); - } - - public function testMaximumBasketValue() { - $this->assertNull( - $this->_model->getCost( - $this->_getRateRequest( - 50, - 2500.01, - 'GB' - ) - ) - ); - - $this->assertNotNull( - $this->_model->getCost( - $this->_getRateRequest( - 50, - 50.00, - 'GB' - ) - ) - ); - } - - public function testMinimalPrice() { - $this->assertEquals( - 18.18, - $this->_model->getCost( - $this->_getRateRequest( - 50, - 1.00, - 'GB' - ) - ) - ); - } - - public function testUpperLimit() { - $this->assertEquals( - 26.94, - $this->_model->getCost( - $this->_getRateRequest( - 2000, - 1.00, - 'GB' - ) - ) - ); - - $this->assertNull( - $this->_model->getCost($this->_getRateRequest( - 2001, - 1.00, - 'GB' - )) - ); - } -} diff --git a/app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Specialdeliverynextday.php b/app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Specialdeliverynextday.php deleted file mode 100644 index 87e6990..0000000 --- a/app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Specialdeliverynextday.php +++ /dev/null @@ -1,83 +0,0 @@ -_model = Mage::getModel('royalmail/shipping_carrier_royalmail_specialdeliverynextday'); - } - - public function tearDown() { - parent::tearDown(); - - $this->_model = null; - } - - public function testNotAllowedFromFrance() { - $this->assertNull( - $this->_model->getCost($this->_getRateRequest( - 50, - 1.00, - 'FR' - )) - ); - } - - public function testMaximumBasketValue() { - $this->assertNull( - $this->_model->getCost( - $this->_getRateRequest( - 50, - 2500.01, - 'GB' - ) - ) - ); - - $this->assertNotNull( - $this->_model->getCost( - $this->_getRateRequest( - 50, - 500.00, - 'GB' - ) - ) - ); - } - - public function testLowerLimit() { - $this->assertEquals( - 6.40, - $this->_model->getCost( - $this->_getRateRequest( - 50, - 1.00, - 'GB' - ) - ) - ); - } - - public function testUpperLimit() { - $this->assertEquals( - 41.20, - $this->_model->getCost( - $this->_getRateRequest( - 20000, - 1.00, - 'GB' - ) - ) - ); - - $this->assertNull( - $this->_model->getCost($this->_getRateRequest( - 20001, - 1.00, - 'GB' - )) - ); - } -} diff --git a/app/code/community/Meanbee/Royalmail/data/9am1000.csv b/app/code/community/Meanbee/Royalmail/data/9am1000.csv index 631ba6d..72535d2 100644 --- a/app/code/community/Meanbee/Royalmail/data/9am1000.csv +++ b/app/code/community/Meanbee/Royalmail/data/9am1000.csv @@ -1,4 +1,4 @@ -100,20.38 -500,22.72 -1000,24.46 +100,20.56 +500,22.96 +1000,24.70 2000,29.14 diff --git a/app/code/community/Meanbee/Royalmail/data/9am1000saturday.csv b/app/code/community/Meanbee/Royalmail/data/9am1000saturday.csv new file mode 100644 index 0000000..2cb6795 --- /dev/null +++ b/app/code/community/Meanbee/Royalmail/data/9am1000saturday.csv @@ -0,0 +1,4 @@ +100,23.56 +500,25.96 +1000,27.70 +2000,32.14 diff --git a/app/code/community/Meanbee/Royalmail/data/9am2500.csv b/app/code/community/Meanbee/Royalmail/data/9am2500.csv index 039d9bd..9dbe004 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.88 -500,26.22 -1000,27.96 +100,24.06 +500,26.46 +1000,28.20 2000,32.64 diff --git a/app/code/community/Meanbee/Royalmail/data/9am2500saturday.csv b/app/code/community/Meanbee/Royalmail/data/9am2500saturday.csv new file mode 100644 index 0000000..23ae178 --- /dev/null +++ b/app/code/community/Meanbee/Royalmail/data/9am2500saturday.csv @@ -0,0 +1,4 @@ +100,27.06 +500,29.46 +1000,31.20 +2000,35.64 diff --git a/app/code/community/Meanbee/Royalmail/data/9am50.csv b/app/code/community/Meanbee/Royalmail/data/9am50.csv index 7067b2f..c20c5c5 100644 --- a/app/code/community/Meanbee/Royalmail/data/9am50.csv +++ b/app/code/community/Meanbee/Royalmail/data/9am50.csv @@ -1,4 +1,4 @@ -100,18.18 -500,20.52 -1000,22.26 +100,18.36 +500,20.76 +1000,22.50 2000,26.94 diff --git a/app/code/community/Meanbee/Royalmail/data/9am50saturday.csv b/app/code/community/Meanbee/Royalmail/data/9am50saturday.csv new file mode 100644 index 0000000..0c4846f --- /dev/null +++ b/app/code/community/Meanbee/Royalmail/data/9am50saturday.csv @@ -0,0 +1,4 @@ +100,21.36 +500,23.76 +1000,25.50 +2000,29.94 diff --git a/app/code/community/Meanbee/Royalmail/data/firstclass_largeletter_signedfor.csv b/app/code/community/Meanbee/Royalmail/data/firstclass_largeletter_signedfor.csv new file mode 100644 index 0000000..888d237 --- /dev/null +++ b/app/code/community/Meanbee/Royalmail/data/firstclass_largeletter_signedfor.csv @@ -0,0 +1,4 @@ +100,2.05 +250,2.36 +500,2.78 +750,3.52 diff --git a/app/code/community/Meanbee/Royalmail/data/firstclass_letter_signedfor.csv b/app/code/community/Meanbee/Royalmail/data/firstclass_letter_signedfor.csv new file mode 100644 index 0000000..2f66300 --- /dev/null +++ b/app/code/community/Meanbee/Royalmail/data/firstclass_letter_signedfor.csv @@ -0,0 +1 @@ +100,1.73 diff --git a/app/code/community/Meanbee/Royalmail/data/firstclass_medium.csv b/app/code/community/Meanbee/Royalmail/data/firstclass_medium.csv index e575271..7cabbc2 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 +2000,9.90 5000,15.85 10000,21.90 20000,33.40 diff --git a/app/code/community/Meanbee/Royalmail/data/firstclass_medium_signedfor.csv b/app/code/community/Meanbee/Royalmail/data/firstclass_medium_signedfor.csv new file mode 100644 index 0000000..cad5b61 --- /dev/null +++ b/app/code/community/Meanbee/Royalmail/data/firstclass_medium_signedfor.csv @@ -0,0 +1,5 @@ +1000,6.75 +2000,10.00 +5000,16.95 +10000,23.00 +20000,34.50 diff --git a/app/code/community/Meanbee/Royalmail/data/firstclass_small.csv b/app/code/community/Meanbee/Royalmail/data/firstclass_small.csv index ac34335..7b6f1c7 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.20 -2000,5.45 \ No newline at end of file +1000,3.30 +2000,5.45 diff --git a/app/code/community/Meanbee/Royalmail/data/firstclass_small_signedfor.csv b/app/code/community/Meanbee/Royalmail/data/firstclass_small_signedfor.csv new file mode 100644 index 0000000..4e16f4e --- /dev/null +++ b/app/code/community/Meanbee/Royalmail/data/firstclass_small_signedfor.csv @@ -0,0 +1,7 @@ +1000,4.10 +2000,6.25 +1000,6.75 +2000,10.00 +5000,16.95 +10000,23.00 +20000,34.50 diff --git a/app/code/community/Meanbee/Royalmail/data/internationaleconomy.csv b/app/code/community/Meanbee/Royalmail/data/internationaleconomy.csv index 560c3ed..fa031ca 100644 --- a/app/code/community/Meanbee/Royalmail/data/internationaleconomy.csv +++ b/app/code/community/Meanbee/Royalmail/data/internationaleconomy.csv @@ -1,9 +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 +100,3.25 +250,3.75 +500,5.30 +750,6.65 +1000,8.06 +1250,9.41 +1500,10.76 +1750,12.11 +2000,13.26 diff --git a/app/code/community/Meanbee/Royalmail/data/internationallettersigned_eu.csv b/app/code/community/Meanbee/Royalmail/data/internationallettersigned_eu.csv new file mode 100644 index 0000000..b29ebe5 --- /dev/null +++ b/app/code/community/Meanbee/Royalmail/data/internationallettersigned_eu.csv @@ -0,0 +1,3 @@ +10,6.00 +20,6.00 +100,6.52 diff --git a/app/code/community/Meanbee/Royalmail/data/internationallettersigned_wz.csv b/app/code/community/Meanbee/Royalmail/data/internationallettersigned_wz.csv new file mode 100644 index 0000000..63bd251 --- /dev/null +++ b/app/code/community/Meanbee/Royalmail/data/internationallettersigned_wz.csv @@ -0,0 +1,3 @@ +10,6.00 +20,6.33 +100,7.25 diff --git a/app/code/community/Meanbee/Royalmail/data/internationalletterstandard_eu.csv b/app/code/community/Meanbee/Royalmail/data/internationalletterstandard_eu.csv new file mode 100644 index 0000000..d82240c --- /dev/null +++ b/app/code/community/Meanbee/Royalmail/data/internationalletterstandard_eu.csv @@ -0,0 +1,3 @@ +10,1.00 +20,1.00 +100,1.52 diff --git a/app/code/community/Meanbee/Royalmail/data/internationalletterstandard_wz.csv b/app/code/community/Meanbee/Royalmail/data/internationalletterstandard_wz.csv new file mode 100644 index 0000000..b7f6f76 --- /dev/null +++ b/app/code/community/Meanbee/Royalmail/data/internationalletterstandard_wz.csv @@ -0,0 +1,3 @@ +10,1.00 +20,1.33 +100,2.25 diff --git a/app/code/community/Meanbee/Royalmail/data/internationallettertracked_eu.csv b/app/code/community/Meanbee/Royalmail/data/internationallettertracked_eu.csv new file mode 100644 index 0000000..df9c773 --- /dev/null +++ b/app/code/community/Meanbee/Royalmail/data/internationallettertracked_eu.csv @@ -0,0 +1,3 @@ +10,7.20 +20,7.20 +100,7.83 diff --git a/app/code/community/Meanbee/Royalmail/data/internationallettertracked_noneu.csv b/app/code/community/Meanbee/Royalmail/data/internationallettertracked_noneu.csv new file mode 100644 index 0000000..b29ebe5 --- /dev/null +++ b/app/code/community/Meanbee/Royalmail/data/internationallettertracked_noneu.csv @@ -0,0 +1,3 @@ +10,6.00 +20,6.00 +100,6.52 diff --git a/app/code/community/Meanbee/Royalmail/data/internationallettertracked_wz.csv b/app/code/community/Meanbee/Royalmail/data/internationallettertracked_wz.csv new file mode 100644 index 0000000..63bd251 --- /dev/null +++ b/app/code/community/Meanbee/Royalmail/data/internationallettertracked_wz.csv @@ -0,0 +1,3 @@ +10,6.00 +20,6.33 +100,7.25 diff --git a/app/code/community/Meanbee/Royalmail/data/internationallettertrackedsigned_eu.csv b/app/code/community/Meanbee/Royalmail/data/internationallettertrackedsigned_eu.csv new file mode 100644 index 0000000..d82240c --- /dev/null +++ b/app/code/community/Meanbee/Royalmail/data/internationallettertrackedsigned_eu.csv @@ -0,0 +1,3 @@ +10,1.00 +20,1.00 +100,1.52 diff --git a/app/code/community/Meanbee/Royalmail/data/internationallettertrackedsigned_wz.csv b/app/code/community/Meanbee/Royalmail/data/internationallettertrackedsigned_wz.csv new file mode 100644 index 0000000..d376a4f --- /dev/null +++ b/app/code/community/Meanbee/Royalmail/data/internationallettertrackedsigned_wz.csv @@ -0,0 +1,3 @@ +20,6.28 +60,7.15 +100,8.45 \ No newline at end of file diff --git a/app/code/community/Meanbee/Royalmail/data/internationalltettereconomy.csv b/app/code/community/Meanbee/Royalmail/data/internationalltettereconomy.csv new file mode 100644 index 0000000..b7f6f76 --- /dev/null +++ b/app/code/community/Meanbee/Royalmail/data/internationalltettereconomy.csv @@ -0,0 +1,3 @@ +10,1.00 +20,1.33 +100,2.25 diff --git a/app/code/community/Meanbee/Royalmail/data/internationalsigned_eu.csv b/app/code/community/Meanbee/Royalmail/data/internationalsigned_eu.csv new file mode 100644 index 0000000..500fa83 --- /dev/null +++ b/app/code/community/Meanbee/Royalmail/data/internationalsigned_eu.csv @@ -0,0 +1,9 @@ +100,8.2 +250,8.7 +500,10.15 +750,11.10 +1000,12.51 +1250,13.86 +1500,15.81 +1750,14.81 +2000,16.96 diff --git a/app/code/community/Meanbee/Royalmail/data/internationalsigned_wz1.csv b/app/code/community/Meanbee/Royalmail/data/internationalsigned_wz1.csv new file mode 100644 index 0000000..65c0bdd --- /dev/null +++ b/app/code/community/Meanbee/Royalmail/data/internationalsigned_wz1.csv @@ -0,0 +1,9 @@ +100,8.8 +250,9.75 +500,12.45 +750,14.55 +1000,17.20 +1250,18.90 +1500,20.60 +1750,21.55 +2000,23.25 diff --git a/app/code/community/Meanbee/Royalmail/data/internationalsigned_wz2.csv b/app/code/community/Meanbee/Royalmail/data/internationalsigned_wz2.csv new file mode 100644 index 0000000..b1ed441 --- /dev/null +++ b/app/code/community/Meanbee/Royalmail/data/internationalsigned_wz2.csv @@ -0,0 +1,9 @@ +100,9 +250,10.05 +500,12.9 +750,15.40 +1000,18.15 +1250,20.05 +1500,21.95 +1750,23.10 +2000,25.00 diff --git a/app/code/community/Meanbee/Royalmail/data/internationalstandard_europe.csv b/app/code/community/Meanbee/Royalmail/data/internationalstandard_europe.csv index 7240f11..05ce75a 100644 --- a/app/code/community/Meanbee/Royalmail/data/internationalstandard_europe.csv +++ b/app/code/community/Meanbee/Royalmail/data/internationalstandard_europe.csv @@ -1,9 +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 +100,3.45 +250,3.95 +500,5.50 +750,6.85 +1000,8.26 +1250,9.61 +1500,10.96 +1750,12.31 +2000,13.46 diff --git a/app/code/community/Meanbee/Royalmail/data/internationalstandard_wz1.csv b/app/code/community/Meanbee/Royalmail/data/internationalstandard_wz1.csv index b5e43e5..56efe68 100644 --- a/app/code/community/Meanbee/Royalmail/data/internationalstandard_wz1.csv +++ b/app/code/community/Meanbee/Royalmail/data/internationalstandard_wz1.csv @@ -1,9 +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 +100,4.10 +250,5.00 +500,7.70 +750,10.30 +1000,12.95 +1250,14.65 +1500,16.35 +1750,18.05 +2000,19.75 diff --git a/app/code/community/Meanbee/Royalmail/data/internationalstandard_wz2.csv b/app/code/community/Meanbee/Royalmail/data/internationalstandard_wz2.csv index 4cf80ba..10f926b 100644 --- a/app/code/community/Meanbee/Royalmail/data/internationalstandard_wz2.csv +++ b/app/code/community/Meanbee/Royalmail/data/internationalstandard_wz2.csv @@ -1,9 +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 +100,4.45 +250,5.45 +500,8.45 +750,11.15 +1000,13.90 +1250,15.90 +1500,17.70 +1750,19.60 +2000,21.50 diff --git a/app/code/community/Meanbee/Royalmail/data/internationaltracked_eu.csv b/app/code/community/Meanbee/Royalmail/data/internationaltracked_eu.csv index 22ec93b..0dd0457 100644 --- a/app/code/community/Meanbee/Royalmail/data/internationaltracked_eu.csv +++ b/app/code/community/Meanbee/Royalmail/data/internationaltracked_eu.csv @@ -1,9 +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 +100,9.84 +250,10.44 +500,12.18 +750,13.32 +1000,15.02 +1250,16.64 +1500,18.26 +1750,18.98 +2000,20.36 diff --git a/app/code/community/Meanbee/Royalmail/data/internationaltracked_noneu.csv b/app/code/community/Meanbee/Royalmail/data/internationaltracked_noneu.csv index 9c799aa..43e9031 100644 --- a/app/code/community/Meanbee/Royalmail/data/internationaltracked_noneu.csv +++ b/app/code/community/Meanbee/Royalmail/data/internationaltracked_noneu.csv @@ -1,9 +1,9 @@ 100,8.20 -250,8.75 +250,8.70 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 +750,11.10 +1000,12.51 +1250,13.86 +1500,15.21 +1750,15.81 +2000,16.96 diff --git a/app/code/community/Meanbee/Royalmail/data/internationaltracked_wz1.csv b/app/code/community/Meanbee/Royalmail/data/internationaltracked_wz1.csv index 4d6d26c..33c8f12 100644 --- a/app/code/community/Meanbee/Royalmail/data/internationaltracked_wz1.csv +++ b/app/code/community/Meanbee/Royalmail/data/internationaltracked_wz1.csv @@ -1,9 +1,9 @@ 100,8.80 -250,9.75 +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 +750,14.55 +1000,17.20 +1250,18.90 +1500,20.60 +1750,21.55 +2000,23.55 diff --git a/app/code/community/Meanbee/Royalmail/data/internationaltracked_wz2.csv b/app/code/community/Meanbee/Royalmail/data/internationaltracked_wz2.csv index 8e017bc..f3a66d0 100644 --- a/app/code/community/Meanbee/Royalmail/data/internationaltracked_wz2.csv +++ b/app/code/community/Meanbee/Royalmail/data/internationaltracked_wz2.csv @@ -1,9 +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 +750,15.40 +1000,18.15 +1250,20.05 +1500,21.95 +1750,23.10 +2000,25.00 diff --git a/app/code/community/Meanbee/Royalmail/data/internationaltrackedsigned_eu.csv b/app/code/community/Meanbee/Royalmail/data/internationaltrackedsigned_eu.csv new file mode 100644 index 0000000..fafde66 --- /dev/null +++ b/app/code/community/Meanbee/Royalmail/data/internationaltrackedsigned_eu.csv @@ -0,0 +1,9 @@ +100,8.2 +250,8.7 +500,10.15 +750,11.1 +1000,12.51 +1250,13.87 +1500,15.21 +1750,15.81 +2000,16.96 diff --git a/app/code/community/Meanbee/Royalmail/data/internationaltrackedsigned_wz1.csv b/app/code/community/Meanbee/Royalmail/data/internationaltrackedsigned_wz1.csv new file mode 100644 index 0000000..65c0bdd --- /dev/null +++ b/app/code/community/Meanbee/Royalmail/data/internationaltrackedsigned_wz1.csv @@ -0,0 +1,9 @@ +100,8.8 +250,9.75 +500,12.45 +750,14.55 +1000,17.20 +1250,18.90 +1500,20.60 +1750,21.55 +2000,23.25 diff --git a/app/code/community/Meanbee/Royalmail/data/internationaltrackedsigned_wz2.csv b/app/code/community/Meanbee/Royalmail/data/internationaltrackedsigned_wz2.csv new file mode 100644 index 0000000..b1ed441 --- /dev/null +++ b/app/code/community/Meanbee/Royalmail/data/internationaltrackedsigned_wz2.csv @@ -0,0 +1,9 @@ +100,9 +250,10.05 +500,12.9 +750,15.40 +1000,18.15 +1250,20.05 +1500,21.95 +1750,23.10 +2000,25.00 diff --git a/app/code/community/Meanbee/Royalmail/data/largeletter.csv b/app/code/community/Meanbee/Royalmail/data/largeletter.csv index 39e643e..ff5d2fc 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.93 -250,1.24 -500,1.65 -750,2.38 +100,0.95 +250,1.26 +500,1.68 +750,2.42 diff --git a/app/code/community/Meanbee/Royalmail/data/letter.csv b/app/code/community/Meanbee/Royalmail/data/letter.csv index 7f29ebb..e39fe68 100644 --- a/app/code/community/Meanbee/Royalmail/data/letter.csv +++ b/app/code/community/Meanbee/Royalmail/data/letter.csv @@ -1 +1 @@ -100,0.62 \ No newline at end of file +100,0.63 diff --git a/app/code/community/Meanbee/Royalmail/data/nextday1000.csv b/app/code/community/Meanbee/Royalmail/data/nextday1000.csv index 96010d3..ffcbdd2 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.40 -500,8.15 -1000,9.45 -2000,12.00 -10000,27.60 -20000,42.20 \ No newline at end of file +100,7.45 +500,8.25 +1000,9.55 +2000,11.00 +10000,26.60 +20000,41.20 diff --git a/app/code/community/Meanbee/Royalmail/data/nextday1000saturday.csv b/app/code/community/Meanbee/Royalmail/data/nextday1000saturday.csv new file mode 100644 index 0000000..af204c2 --- /dev/null +++ b/app/code/community/Meanbee/Royalmail/data/nextday1000saturday.csv @@ -0,0 +1,6 @@ +100,11.94 +500,12.90 +1000,14.46 +2000,17.40 +10000,36.12 +20000,53.64 diff --git a/app/code/community/Meanbee/Royalmail/data/nextday2500.csv b/app/code/community/Meanbee/Royalmail/data/nextday2500.csv index 5fc46e6..2377244 100644 --- a/app/code/community/Meanbee/Royalmail/data/nextday2500.csv +++ b/app/code/community/Meanbee/Royalmail/data/nextday2500.csv @@ -1,6 +1,6 @@ -100,9.40 -500,10.15 -1000,11.45 +100,9.45 +500,10.25 +1000,11.55 2000,14.00 10000,29.60 -20000,44.20 \ No newline at end of file +20000,44.20 diff --git a/app/code/community/Meanbee/Royalmail/data/nextday2500saturday.csv b/app/code/community/Meanbee/Royalmail/data/nextday2500saturday.csv new file mode 100644 index 0000000..85ac656 --- /dev/null +++ b/app/code/community/Meanbee/Royalmail/data/nextday2500saturday.csv @@ -0,0 +1,6 @@ +100,14.28 +500,15.18 +1000,16.74 +2000,19.80 +10000,38.52 +20000,56.04 \ 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 0ea4ee4..9a1cca4 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.40 -500,7.15 -1000,8.45 +100,6.45 +500,7.25 +1000,8.55 2000,11.00 10000,26.60 -20000,41.20 \ No newline at end of file +20000,41.20 diff --git a/app/code/community/Meanbee/Royalmail/data/nextday500saturday.csv b/app/code/community/Meanbee/Royalmail/data/nextday500saturday.csv new file mode 100644 index 0000000..c21e214 --- /dev/null +++ b/app/code/community/Meanbee/Royalmail/data/nextday500saturday.csv @@ -0,0 +1,6 @@ +100,10.74 +500,11.70 +1000,13.26 +2000,16.20 +10000,34.92 +20000,52.44 diff --git a/app/code/community/Meanbee/Royalmail/data/secondclass_largeletter.csv b/app/code/community/Meanbee/Royalmail/data/secondclass_largeletter.csv index 36dac64..3a17a92 100644 --- a/app/code/community/Meanbee/Royalmail/data/secondclass_largeletter.csv +++ b/app/code/community/Meanbee/Royalmail/data/secondclass_largeletter.csv @@ -1,4 +1,4 @@ -100,0.73 -250,1.17 -500,1.48 -750,2.01 +100,0.74 +250,1.19 +500,1.51 +750,2.05 diff --git a/app/code/community/Meanbee/Royalmail/data/secondclass_largeletter_signedfor.csv b/app/code/community/Meanbee/Royalmail/data/secondclass_largeletter_signedfor.csv new file mode 100644 index 0000000..888d237 --- /dev/null +++ b/app/code/community/Meanbee/Royalmail/data/secondclass_largeletter_signedfor.csv @@ -0,0 +1,4 @@ +100,2.05 +250,2.36 +500,2.78 +750,3.52 diff --git a/app/code/community/Meanbee/Royalmail/data/secondclass_letter.csv b/app/code/community/Meanbee/Royalmail/data/secondclass_letter.csv index afe323f..b6d326e 100644 --- a/app/code/community/Meanbee/Royalmail/data/secondclass_letter.csv +++ b/app/code/community/Meanbee/Royalmail/data/secondclass_letter.csv @@ -1 +1 @@ -100,0.53 +100,0.54 diff --git a/app/code/community/Meanbee/Royalmail/data/secondclass_letter_signedfor.csv b/app/code/community/Meanbee/Royalmail/data/secondclass_letter_signedfor.csv new file mode 100644 index 0000000..bf018fd --- /dev/null +++ b/app/code/community/Meanbee/Royalmail/data/secondclass_letter_signedfor.csv @@ -0,0 +1 @@ +100,1.64 diff --git a/app/code/community/Meanbee/Royalmail/data/secondclass_medium.csv b/app/code/community/Meanbee/Royalmail/data/secondclass_medium.csv index 70db5dd..eafe7ea 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.75 +1000,4.89 +2000,4.89 +5000,14.75 10000,20.25 20000,28.55 diff --git a/app/code/community/Meanbee/Royalmail/data/secondclass_medium_signedfor.csv b/app/code/community/Meanbee/Royalmail/data/secondclass_medium_signedfor.csv new file mode 100644 index 0000000..7794bcd --- /dev/null +++ b/app/code/community/Meanbee/Royalmail/data/secondclass_medium_signedfor.csv @@ -0,0 +1,5 @@ +1000,5.99 +2000,5.99 +5000,14.85 +10000,21.35 +20000,29.65 diff --git a/app/code/community/Meanbee/Royalmail/data/secondclass_small.csv b/app/code/community/Meanbee/Royalmail/data/secondclass_small.csv index ab95636..ac0b18f 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.80 -2000,3.80 \ No newline at end of file +1000,2.8 +2000,2.8 diff --git a/app/code/community/Meanbee/Royalmail/data/secondclass_small_signedfor.csv b/app/code/community/Meanbee/Royalmail/data/secondclass_small_signedfor.csv new file mode 100644 index 0000000..ab37ec9 --- /dev/null +++ b/app/code/community/Meanbee/Royalmail/data/secondclass_small_signedfor.csv @@ -0,0 +1,2 @@ +1000,3.9 +2000,3.9 diff --git a/app/code/community/Meanbee/Royalmail/etc/config.xml b/app/code/community/Meanbee/Royalmail/etc/config.xml index eefbc57..fdf4105 100644 --- a/app/code/community/Meanbee/Royalmail/etc/config.xml +++ b/app/code/community/Meanbee/Royalmail/etc/config.xml @@ -22,7 +22,7 @@ - 2.6.2 + 2.6.5 @@ -85,7 +85,7 @@ GB 0 0 - small + small