From a7791efa9ba9d6f8e1f1a878d45517ce7583b6cf Mon Sep 17 00:00:00 2001 From: Veiote Date: Tue, 30 Jun 2015 10:33:24 -0300 Subject: [PATCH 1/6] Update config.xml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Atualização dos preços da carta comercial e carta comercial registrada. --- .../PedroTeixeira/Correios/etc/config.xml | 44 +++++++++---------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/app/code/community/PedroTeixeira/Correios/etc/config.xml b/app/code/community/PedroTeixeira/Correios/etc/config.xml index 6c1f24c..57a6f48 100644 --- a/app/code/community/PedroTeixeira/Correios/etc/config.xml +++ b/app/code/community/PedroTeixeira/Correios/etc/config.xml @@ -230,7 +230,7 @@ 10065 - 1.30 + 1.40 5 00000000 @@ -245,7 +245,7 @@ 10065 - 1.80 + 1.95 5 00000000 @@ -260,7 +260,7 @@ 10065 - 2.45 + 2.70 5 00000000 @@ -275,7 +275,7 @@ 10065 - 3.00 + 3.30 5 00000000 @@ -290,7 +290,7 @@ 10065 - 3.60 + 3.90 5 00000000 @@ -305,7 +305,7 @@ 10065 - 4.15 + 4.50 5 00000000 @@ -320,7 +320,7 @@ 10065 - 4.70 + 5.15 5 00000000 @@ -335,7 +335,7 @@ 10065 - 5.25 + 5.75 5 00000000 @@ -350,7 +350,7 @@ 10065 - 5.80 + 6.35 5 00000000 @@ -365,7 +365,7 @@ 10065 - 6.35 + 6.95 5 00000000 @@ -380,7 +380,7 @@ 10065 - 6.90 + 7.55 5 00000000 @@ -395,7 +395,7 @@ 10138 - 4.50 + 5.00 5 00000000 @@ -410,7 +410,7 @@ 10138 - 5.00 + 5.55 5 00000000 @@ -425,7 +425,7 @@ 10138 - 5.65 + 6.30 5 00000000 @@ -440,7 +440,7 @@ 10138 - 6.20 + 6.90 5 00000000 @@ -455,7 +455,7 @@ 10138 - 6.80 + 7.50 5 00000000 @@ -470,7 +470,7 @@ 10138 - 7.35 + 8.10 5 00000000 @@ -485,7 +485,7 @@ 10138 - 7.90 + 8.75 5 00000000 @@ -500,7 +500,7 @@ 10138 - 8.45 + 9.35 5 00000000 @@ -515,7 +515,7 @@ 10138 - 9.00 + 9.95 5 00000000 @@ -530,7 +530,7 @@ 10138 - 9.55 + 10.55 5 00000000 @@ -545,7 +545,7 @@ 10138 - 10.10 + 11.15 5 00000000 From 57c522b9a8067ba61c1de07bc22c4f4827fabd75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Corr=C3=AAa=20Gomes?= Date: Mon, 6 Jul 2015 12:35:57 -0300 Subject: [PATCH 2/6] =?UTF-8?q?Licen=C3=A7a=20utilizada=20vis=C3=ADvel=20n?= =?UTF-8?q?a=20documenta=C3=A7=C3=A3o.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 7f9ac3e..a3bf91f 100644 --- a/README.md +++ b/README.md @@ -241,3 +241,7 @@ find ./app -name "*.php" -exec php -l {} \; ``` *O Magento não segue nenhum code style, por isso compilei uma lista de checks no `ruleset.xml`.* + +## Licença + +MIT © [Pedro Teixeira](https://github.com/pedro-teixeira) From 9b62301289e34963d25901a42f2c8a123360bd64 Mon Sep 17 00:00:00 2001 From: Matheus Jardim B Date: Wed, 8 Jul 2015 13:58:12 -0300 Subject: [PATCH 3/6] adding support for recurring profile products --- .../Correios/Model/Carrier/CorreiosMethod.php | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/app/code/community/PedroTeixeira/Correios/Model/Carrier/CorreiosMethod.php b/app/code/community/PedroTeixeira/Correios/Model/Carrier/CorreiosMethod.php index 2b4c23d..9aac7d5 100644 --- a/app/code/community/PedroTeixeira/Correios/Model/Carrier/CorreiosMethod.php +++ b/app/code/community/PedroTeixeira/Correios/Model/Carrier/CorreiosMethod.php @@ -21,6 +21,7 @@ class PedroTeixeira_Correios_Model_Carrier_CorreiosMethod * @var string */ protected $_code = 'pedroteixeira_correios'; + protected $_isFixed = true; /** * _result property @@ -86,7 +87,10 @@ public function collectRates(Mage_Shipping_Model_Rate_Request $request) return $this->_result; } - // Fix weight + if ($this->_packageWeight == 0) { + $this->_packageWeight = $this->_getNominalWeight(); + } + if ($this->getConfigData('weight_type') == PedroTeixeira_Correios_Model_Source_WeightType::WEIGHT_GR) { $this->_packageWeight = number_format($this->_packageWeight / 1000, 2, '.', ''); } @@ -118,6 +122,22 @@ public function collectRates(Mage_Shipping_Model_Rate_Request $request) return $this->_result; } + protected function _getNominalWeight() + { + $weight = 0; + $quote = Mage::getSingleton('checkout/cart')->getQuote(); + if (count($quote->getAllVisibleItems()) == 0) { + $quote = Mage::getSingleton('adminhtml/session_quote')->getQuote(); + } + if ($quote->isNominal()) { + foreach ($quote->getAllVisibleItems() as $item) { + $product = Mage::getModel('catalog/product')->load($item->getProductId()); + $weight += $product->getWeight(); + } + } + return $weight; + } + /** * Get shipping quote * From 8a044894eafb520aad59af7f1b4ca470389058a7 Mon Sep 17 00:00:00 2001 From: Matheus Jardim B Date: Wed, 8 Jul 2015 14:52:35 -0300 Subject: [PATCH 4/6] adding missing documentation --- .../Correios/Model/Carrier/CorreiosMethod.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/code/community/PedroTeixeira/Correios/Model/Carrier/CorreiosMethod.php b/app/code/community/PedroTeixeira/Correios/Model/Carrier/CorreiosMethod.php index 9aac7d5..690cdeb 100644 --- a/app/code/community/PedroTeixeira/Correios/Model/Carrier/CorreiosMethod.php +++ b/app/code/community/PedroTeixeira/Correios/Model/Carrier/CorreiosMethod.php @@ -121,7 +121,12 @@ public function collectRates(Mage_Shipping_Model_Rate_Request $request) return $this->_result; } - + + /** + * Gets Nominal Weight + * + * @return number + */ protected function _getNominalWeight() { $weight = 0; From f396b133911d02e8baba82d78f988b8974e86597 Mon Sep 17 00:00:00 2001 From: Pedro Teixeira Date: Sat, 11 Jul 2015 18:14:59 +0200 Subject: [PATCH 5/6] =?UTF-8?q?Link=20para=20licenc=CC=A7a?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a3bf91f..84d58ea 100644 --- a/README.md +++ b/README.md @@ -244,4 +244,4 @@ find ./app -name "*.php" -exec php -l {} \; ## Licença -MIT © [Pedro Teixeira](https://github.com/pedro-teixeira) +[MIT](https://github.com/pedro-teixeira/correios/blob/master/LICENSE) © [Pedro Teixeira](https://pedroteixeira.io). From c38f378caad8828bde4ba5f09f45ae8a31800721 Mon Sep 17 00:00:00 2001 From: Pedro Teixeira Date: Sat, 11 Jul 2015 18:22:26 +0200 Subject: [PATCH 6/6] Atualiza popularity --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 84d58ea..67e42c9 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # PedroTeixeira_Correios -[![Build Status](http://img.shields.io/travis/pedro-teixeira/correios.svg?style=flat)](https://travis-ci.org/pedro-teixeira/correios) [![Magento Connect Popularity](http://img.shields.io/badge/popularity-17k-brightgreen.svg?style=flat)](http://www.magentocommerce.com/magento-connect/pedroteixeira-correios.html) [![MIT](http://img.shields.io/badge/license-MIT-blue.svg?style=flat)](https://github.com/pedro-teixeira/correios/blob/master/LICENSE) +[![Build Status](http://img.shields.io/travis/pedro-teixeira/correios.svg?style=flat)](https://travis-ci.org/pedro-teixeira/correios) [![Magento Connect Popularity](http://img.shields.io/badge/popularity-18k-brightgreen.svg?style=flat)](http://www.magentocommerce.com/magento-connect/pedroteixeira-correios.html) [![MIT](http://img.shields.io/badge/license-MIT-blue.svg?style=flat)](https://github.com/pedro-teixeira/correios/blob/master/LICENSE) > Módulo de frete para Magento com tracking