From bb4866d31b99fdb10850fc550dd181ed09585d3e Mon Sep 17 00:00:00 2001 From: Pedro Teixeira Date: Mon, 30 Mar 2015 19:04:19 +0200 Subject: [PATCH] #68 Style and minor changes for the v4.4.0 release --- CHANGELOG.md | 17 +++- LICENSE | 2 +- README.md | 2 +- .../PedroTeixeira/Correios/Helper/Data.php | 2 +- .../PedroTeixeira/Correios/Model/Cache.php | 88 ++++++++--------- .../Correios/Model/Carrier/CorreiosMethod.php | 98 +++++++++---------- .../Model/Http/Client/Adapter/Socket.php | 23 ++--- .../Correios/Model/Source/CacheMode.php | 8 +- .../Correios/Model/Source/PostMethods.php | 6 +- .../Correios/Model/Source/WeightType.php | 2 +- .../PedroTeixeira/Correios/etc/config.xml | 17 ++-- .../PedroTeixeira/Correios/etc/system.xml | 20 +--- .../install-4.0.0.php | 2 +- .../install-4.4.0.php | 8 +- .../upgrade-4.0.0-4.1.0.php | 2 +- .../upgrade-4.1.0-4.2.0.php | 2 +- .../upgrade-4.2.0-4.3.0.php | 2 +- .../upgrade-4.3.0-4.4.0.php | 2 +- app/etc/modules/PedroTeixeira_Correios.xml | 2 +- 19 files changed, 152 insertions(+), 153 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9ea5790..60cc209 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,14 +1,29 @@ -# NEXT RELEASE +# v4.4.0 ### Bugfix - [#26](https://github.com/pedro-teixeira/correios/issues/26) Usar atributo para setar o carrier name e passar o encoding para htmlentities +- [#59](https://github.com/pedro-teixeira/correios/issues/59) Erro 99 Input string was not in a correct format +- [#42](https://github.com/pedro-teixeira/correios/issues/42) Peso Cúbico não Calculado no Backend +- [#40](https://github.com/pedro-teixeira/correios/issues/40) Corrige a leitura do valor de frete +- [#32](https://github.com/pedro-teixeira/correios/issues/32) Frete de mil reais exibido por 1 real +- [#21](https://github.com/pedro-teixeira/correios/issues/21) Problema com peso do eSEDEX ### Feature - [#14](https://github.com/pedro-teixeira/correios/issues/14) Adiciona CONTRIBUTING.md - [#7](https://github.com/pedro-teixeira/correios/issues/7) Adiciona badges - [#5](https://github.com/pedro-teixeira/correios/issues/5) Integração com Travis +- [#50](https://github.com/pedro-teixeira/correios/issues/50) Testado em Magento 1.9.1.0 +- [#47](https://github.com/pedro-teixeira/correios/issues/47) Serviços por Produto, Validação por Serviço, Grandes Formatos, Carta Registrada, Cache +- [#46](https://github.com/pedro-teixeira/correios/issues/46) Considerar Produtos Encaixados +- [#45](https://github.com/pedro-teixeira/correios/issues/45) Adicionar PAC Grandes Formatos aos Serviços de Postagem +- [#43](https://github.com/pedro-teixeira/correios/issues/43) Validação de Peso e Dimensões +- [#39](https://github.com/pedro-teixeira/correios/issues/39) Selecionar Serviços por Produto +- [#35](https://github.com/pedro-teixeira/correios/issues/35) Added support for modman installations +- [#17](https://github.com/pedro-teixeira/correios/issues/17) Integrar carta registrada +- [#16](https://github.com/pedro-teixeira/correios/issues/16) Implementar cache de respostas dos Coreios +- [#15](https://github.com/pedro-teixeira/correios/issues/15) Opção de dividir a entrega em mais de um pacote # v4.3.0 diff --git a/LICENSE b/LICENSE index 1c23901..6cdc2ad 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2010-2014 Pedro Teixeira +Copyright (c) 2010-2015 Pedro Teixeira Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 7a0f28c..7f9ac3e 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ Caso você prefira fazer a instalação manual, basta baixar a última versão d - Atualize o cache - Se você utiliza Flat Table, atualize sua Flat Table -## Instalando com [modman](https://github.com/colinmollenhour/modman): +## Instalando com [modman](https://github.com/colinmollenhour/modman) $ cd /path/to/magento $ modman init diff --git a/app/code/community/PedroTeixeira/Correios/Helper/Data.php b/app/code/community/PedroTeixeira/Correios/Helper/Data.php index c21496b..4c24f46 100644 --- a/app/code/community/PedroTeixeira/Correios/Helper/Data.php +++ b/app/code/community/PedroTeixeira/Correios/Helper/Data.php @@ -7,7 +7,7 @@ * @category PedroTeixeira * @package PedroTeixeira_Correios * @author Pedro Teixeira - * @copyright 2014 Pedro Teixeira (http://pedroteixeira.io) + * @copyright 2015 Pedro Teixeira (http://pedroteixeira.io) * @license http://opensource.org/licenses/MIT MIT * @link https://github.com/pedro-teixeira/correios */ diff --git a/app/code/community/PedroTeixeira/Correios/Model/Cache.php b/app/code/community/PedroTeixeira/Correios/Model/Cache.php index 8d4cb95..0d0a7f1 100644 --- a/app/code/community/PedroTeixeira/Correios/Model/Cache.php +++ b/app/code/community/PedroTeixeira/Correios/Model/Cache.php @@ -7,7 +7,7 @@ * @category PedroTeixeira * @package PedroTeixeira_Correios * @author Pedro Teixeira - * @copyright 2014 Pedro Teixeira (http://pedroteixeira.io) + * @copyright 2015 Pedro Teixeira (http://pedroteixeira.io) * @license http://opensource.org/licenses/MIT MIT * @link https://github.com/pedro-teixeira/correios */ @@ -20,14 +20,14 @@ class PedroTeixeira_Correios_Model_Cache * @var string */ protected $_code = 'pedroteixeira_correios'; - + /** * Core cache instance - * + * * @var Zend_Cache_Core */ private $_cache = null; - + /** * Retrieve cache instance. * @@ -50,14 +50,14 @@ protected function getZipTags() { $padLength = $this->getConfigData('cache_accuracy/zip'); $zipLength = $padLength - 1; - $tags = array(); - $tags[] = "ZIP_".str_pad(substr($this->getData('sCepDestino'), 0, $zipLength--), $padLength, '0'); - $tags[] = "ZIP_".str_pad(substr($this->getData('sCepDestino'), 0, $zipLength--), $padLength, '0'); - $tags[] = "ZIP_".str_pad(substr($this->getData('sCepDestino'), 0, $zipLength--), $padLength, '0'); - $tags[] = "ZIP_".str_pad(substr($this->getData('sCepDestino'), 0, $zipLength--), $padLength, '0'); + $tags = array(); + $tags[] = "ZIP_" . str_pad(substr($this->getData('sCepDestino'), 0, $zipLength--), $padLength, '0'); + $tags[] = "ZIP_" . str_pad(substr($this->getData('sCepDestino'), 0, $zipLength--), $padLength, '0'); + $tags[] = "ZIP_" . str_pad(substr($this->getData('sCepDestino'), 0, $zipLength--), $padLength, '0'); + $tags[] = "ZIP_" . str_pad(substr($this->getData('sCepDestino'), 0, $zipLength--), $padLength, '0'); return $tags; } - + /** * Retrieve Weight Tags * @@ -65,12 +65,12 @@ protected function getZipTags() */ protected function getWeightTags() { - $tags = array(); - $tags[] = "WEIGHT_".floor($this->getData('nVlPeso')); - $tags[] = "WEIGHT_".ceil($this->getData('nVlPeso')); + $tags = array(); + $tags[] = "WEIGHT_" . floor($this->getData('nVlPeso')); + $tags[] = "WEIGHT_" . ceil($this->getData('nVlPeso')); return $tags; } - + /** * Retrieve Size Tags * @@ -78,15 +78,15 @@ protected function getWeightTags() */ protected function getSizeTags() { - $tags = array(); - $type = ($this->getData('nVlAltura') < 40) ? 'REAL' : 'UNDEFINED'; + $tags = array(); + $type = ($this->getData('nVlAltura') < 40) ? 'REAL' : 'UNDEFINED'; $tags[] = "SIZE_{$type}"; return $tags; } - + /** * Retrieve Post Methods Tags - * + * * @return array */ protected function getPostMethodsTags() @@ -118,18 +118,18 @@ protected function getPostMethodsTags() */ protected function getCacheTags() { - $tags = array(); - $tags = array_merge($tags, $this->getPostMethodsTags()); - $tags = array_merge($tags, $this->getZipTags()); - $tags = array_merge($tags, $this->getWeightTags()); - $tags = array_merge($tags, $this->getSizeTags()); + $tags = array(); + $tags = array_merge($tags, $this->getPostMethodsTags()); + $tags = array_merge($tags, $this->getZipTags()); + $tags = array_merge($tags, $this->getWeightTags()); + $tags = array_merge($tags, $this->getSizeTags()); $tags[] = 'PEDROTEIXEIRA_CORREIOS'; return $tags; } /** * Return example: - * 41068x40096x81019_10_16_51030240 + * 41068x40096x81019_10_16_51030240 * * @return string */ @@ -143,7 +143,7 @@ protected function _getId() $cacheId = preg_replace("/[^[:alnum:]^_]/", "", $cacheId); return $cacheId; } - + /** * Retrieve the cache content. * @@ -152,7 +152,7 @@ protected function _getId() public function load() { $data = $this->loadById(); - if ( !$data ) { + if (!$data) { $data = $this->loadByTags(); } return $data; @@ -165,14 +165,14 @@ public function load() */ public function loadById() { - $id = $this->_getId(); + $id = $this->_getId(); $data = $this->getCache()->load($id); - if ( $data ) { + if ($data) { Mage::log("{$this->_code} [cache]: mode={$this->getConfigData('cache_mode')} status=hit"); } return $data; } - + /** * Iterates over the ZIP codes, and returns the closest match. * @@ -180,17 +180,17 @@ public function loadById() */ public function loadByTags() { - $data = false; + $data = false; $padLength = $this->getConfigData('cache_accuracy/zip'); - for ($i=1; $i<5; $i++) { - $zipTag = str_pad(substr($this->getData('sCepDestino'), 0, $padLength-$i), $padLength, '0'); - $tags = array(); - $tags = array_merge($tags, $this->getPostMethodsTags()); - $tags = array_merge($tags, $this->getWeightTags()); - $tags = array_merge($tags, $this->getSizeTags()); + for ($i = 1; $i < 5; $i++) { + $zipTag = str_pad(substr($this->getData('sCepDestino'), 0, $padLength - $i), $padLength, '0'); + $tags = array(); + $tags = array_merge($tags, $this->getPostMethodsTags()); + $tags = array_merge($tags, $this->getWeightTags()); + $tags = array_merge($tags, $this->getSizeTags()); $tags[] = 'PEDROTEIXEIRA_CORREIOS'; $tags[] = "ZIP_{$zipTag}"; - $keys = $this->getCache()->getIdsMatchingTags($tags); + $keys = $this->getCache()->getIdsMatchingTags($tags); if (count($keys)) { Mage::log("{$this->_code} [cache]: mode={$this->getConfigData('cache_mode')} status=hit tag=zip"); $data = $this->getCache()->load($keys[0]); @@ -210,8 +210,8 @@ public function loadByTags() protected function _isValidCache($data) { $response = Zend_Http_Response::fromString($data); - $content = $response->getBody(); - $pattern = $this->getConfigData('pattern_nocache'); + $content = $response->getBody(); + $pattern = $this->getConfigData('pattern_nocache'); if ($pattern != '' && preg_match($pattern, $content, $matches)) { return false; } @@ -225,7 +225,7 @@ protected function _isValidCache($data) } return true; } - + /** * Save Correios content, tags and expiration period. * @@ -240,19 +240,19 @@ public function save($data) if (!$this->_isValidCache($data)) { return false; // Invalid for the Cache only } - $id = $this->_getId(); + $id = $this->_getId(); $tags = $this->getCacheTags(); if ($this->getCache()->save($data, $id, $tags)) { Mage::log("{$this->_code} [cache]: mode={$this->getConfigData('cache_mode')} status=write key={$id}"); } return $this; } - + /** * Retrieve information from carrier configuration * * @param string $field Field - * + * * @return mixed */ public function getConfigData($field) @@ -260,7 +260,7 @@ public function getConfigData($field) if (empty($this->_code)) { return false; } - $path = 'carriers/'.$this->_code.'/'.$field; + $path = 'carriers/' . $this->_code . '/' . $field; return Mage::getStoreConfig($path); } } \ No newline at end of file diff --git a/app/code/community/PedroTeixeira/Correios/Model/Carrier/CorreiosMethod.php b/app/code/community/PedroTeixeira/Correios/Model/Carrier/CorreiosMethod.php index d7aadc4..2b4c23d 100644 --- a/app/code/community/PedroTeixeira/Correios/Model/Carrier/CorreiosMethod.php +++ b/app/code/community/PedroTeixeira/Correios/Model/Carrier/CorreiosMethod.php @@ -7,7 +7,7 @@ * @category PedroTeixeira * @package PedroTeixeira_Correios * @author Pedro Teixeira - * @copyright 2014 Pedro Teixeira (http://pedroteixeira.io) + * @copyright 2015 Pedro Teixeira (http://pedroteixeira.io) * @license http://opensource.org/licenses/MIT MIT * @link https://github.com/pedro-teixeira/correios */ @@ -131,7 +131,7 @@ protected function _getQuotes() if ($correiosReturn !== false) { $correiosReturn = $this->_addPostMethods($correiosReturn); - $existReturn = false; + $existReturn = false; foreach ($correiosReturn as $servicos) { @@ -141,11 +141,11 @@ protected function _getQuotes() continue; } - $stringPrice = (string) $servicos->Valor; - $stringPrice = str_replace('.', '', $stringPrice); - $stringPrice = str_replace(',', '.', $stringPrice); - $shippingPrice = floatval($stringPrice); - $shippingPrice *= pow(2, $this->_splitUp); + $stringPrice = (string) $servicos->Valor; + $stringPrice = str_replace('.', '', $stringPrice); + $stringPrice = str_replace(',', '.', $stringPrice); + $shippingPrice = floatval($stringPrice); + $shippingPrice *= pow(2, $this->_splitUp); $shippingDelivery = (int) $servicos->PrazoEntrega; if ($shippingPrice <= 0) { @@ -334,7 +334,7 @@ protected function _appendShippingReturn($shippingMethod, $shippingPrice = 0, $c if ($shippingMethod == $this->getConfigData('acobrar_code')) { $shippingData[0] = $shippingData[0] . ' ( R$' . number_format($shippingPrice, 2, ',', '.') . ' )'; - $shippingPrice = 0; + $shippingPrice = 0; } if ($this->getConfigFlag('prazo_entrega')) { @@ -439,8 +439,8 @@ protected function _generateVolumeWeight() foreach ($this->_postMethodsExplode as $key => $method) { $sizeMax = max($itemAltura, $itemLargura, $itemComprimento); $sumMax = ($itemAltura + $itemLargura + $itemComprimento); - $isValid = ($sizeMax <= $this->getConfigData("validate/serv_{$method}/max/size")); - $isValid &= ($sumMax <= $this->getConfigData("validate/serv_{$method}/max/sum")); + $isValid = ($sizeMax <= $this->getConfigData("validate/serv_{$method}/max/size")); + $isValid &= ($sumMax <= $this->getConfigData("validate/serv_{$method}/max/sum")); if (!$isValid) { unset($this->_postMethodsExplode[$key]); @@ -450,8 +450,8 @@ protected function _generateVolumeWeight() if (count($this->_postMethodsExplode) == 0) { return false; } - - $this->_postMethods = implode(',', $this->_postMethodsExplode); + + $this->_postMethods = implode(',', $this->_postMethodsExplode); $this->_postMethodsFixed = $this->_postMethods; } @@ -672,17 +672,17 @@ public function isZipCodeRequired($countryId = null) */ protected function _loadMidSize() { - $volumeFactor = $this->getConfigData('coeficiente_volume'); - $volumeTotal = $this->_volumeWeight * $volumeFactor; - $pow = round(pow((int) $volumeTotal, (1/3))); - $min = $this->getConfigData('midsize_min'); + $volumeFactor = $this->getConfigData('coeficiente_volume'); + $volumeTotal = $this->_volumeWeight * $volumeFactor; + $pow = round(pow((int) $volumeTotal, (1 / 3))); + $min = $this->getConfigData('midsize_min'); $this->_midSize = max($pow, $min); return $this; } /** * Validate post methods removing invalid services from quotation. - * + * * @return boolean|PedroTeixeira_Correios_Model_Carrier_CorreiosMethod */ protected function _removeInvalidServices() @@ -699,15 +699,15 @@ protected function _removeInvalidServices() } } - $isDivisible = (count($tmpMethods) == 0); + $isDivisible = (count($tmpMethods) == 0); $isLoopBreakable = (count($this->_postMethodsExplode) > 0); if ($isDivisible && $isLoopBreakable) { return $this->_splitPack(); } $this->_postMethodsExplode = $tmpMethods; - $this->_postMethods = implode(',', $this->_postMethodsExplode); - $this->_postMethodsFixed = $this->_postMethods; + $this->_postMethods = implode(',', $this->_postMethodsExplode); + $this->_postMethodsFixed = $this->_postMethods; return $this; } @@ -740,7 +740,7 @@ protected function _removeInvalidServices() protected function _addPostMethods($cServico) { $i = 0; - while ( !is_null($this->getConfigData("add_method_{$i}")) ) { + while (!is_null($this->getConfigData("add_method_{$i}"))) { $isValid = true; $isValid &= $this->_packageWeight >= $this->getConfigData("add_method_{$i}/from/weight"); $isValid &= $this->_packageWeight <= $this->getConfigData("add_method_{$i}/to/weight"); @@ -749,25 +749,25 @@ protected function _addPostMethods($cServico) $isValid &= $this->_toZip >= $this->getConfigData("add_method_{$i}/from/zip"); $isValid &= $this->_toZip <= $this->getConfigData("add_method_{$i}/to/zip"); - if ( $isValid ) { - $price = $this->getConfigData("add_method_{$i}/price"); - $days = $this->getConfigData("add_method_{$i}/days"); - $method = $this->getConfigData("add_method_{$i}/code"); + if ($isValid) { + $price = $this->getConfigData("add_method_{$i}/price"); + $days = $this->getConfigData("add_method_{$i}/days"); + $method = $this->getConfigData("add_method_{$i}/code"); foreach ($cServico as $servico) { if ($servico->Codigo == $method) { - $servico->Valor = number_format($price, 2, ',', ''); - $servico->PrazoEntrega = $days; + $servico->Valor = number_format($price, 2, ',', ''); + $servico->PrazoEntrega = $days; $servico->EntregaDomiciliar = 'S'; - $servico->EntregaSabado = 'S'; - $servico->Erro = '0'; - $servico->MsgErro = ''; + $servico->EntregaSabado = 'S'; + $servico->Erro = '0'; + $servico->MsgErro = ''; } } } $i++; } - + return $cServico; } @@ -789,37 +789,37 @@ protected function _addPostMethods($cServico) */ protected function _filterMethodByItemRestriction() { - if ( $this->getConfigFlag('filter_by_item') ) { + if ($this->getConfigFlag('filter_by_item')) { $items = Mage::getSingleton('checkout/cart')->getQuote()->getAllVisibleItems(); - + if (count($items) == 0) { $items = Mage::getSingleton('adminhtml/session_quote')->getQuote()->getAllVisibleItems(); } - + $intersection = $this->_postMethodsExplode; foreach ($items as $item) { - $product = Mage::getModel('catalog/product')->load($item->getProductId()); + $product = Mage::getModel('catalog/product')->load($item->getProductId()); $prodPostMethods = explode(',', $product->getData('postmethods')); $intersection = array_intersect($prodPostMethods, $intersection); } - + $this->_postMethodsExplode = $intersection; - $this->_postMethods = implode(',', $intersection); - $this->_postMethodsFixed = $this->_postMethods; + $this->_postMethods = implode(',', $intersection); + $this->_postMethodsFixed = $this->_postMethods; } - + return $this; } - + /** * Added a fit size for items in large quantities. * Means you can join items like two or more glasses, pots and vases. * The calc is applied only for height side. * Required attribute fit_size. Example: - * + * * code: fit_size * type: varchar - * + * * After you can set a fit size for all products and improve your sells * * @param Mage_Eav_Model_Entity_Abstract $item Order Item @@ -829,22 +829,22 @@ protected function _filterMethodByItemRestriction() protected function _getFitHeight($item) { $product = $item->getProduct(); - $height = $product->getData('volume_altura'); - $height = ($height > 0) ? $height : (int) $this->getConfigData('altura_padrao'); + $height = $product->getData('volume_altura'); + $height = ($height > 0) ? $height : (int) $this->getConfigData('altura_padrao'); $fitSize = (float) $product->getData('fit_size'); - + if ($item->getQty() > 1 && is_numeric($fitSize) && $fitSize > 0) { $totalSize = $height + ($fitSize * ($item->getQty() - 1)); - $height = $totalSize/$item->getQty(); + $height = $totalSize / $item->getQty(); } - + return $height; } - + /** * Splits the package in two parts. * If the package is already splited, each piece will be splited in two equal parts. - * + * * @return boolean|PedroTeixeira_Correios_Model_Carrier_CorreiosMethod */ protected function _splitPack() diff --git a/app/code/community/PedroTeixeira/Correios/Model/Http/Client/Adapter/Socket.php b/app/code/community/PedroTeixeira/Correios/Model/Http/Client/Adapter/Socket.php index 5af4048..fa1c71c 100644 --- a/app/code/community/PedroTeixeira/Correios/Model/Http/Client/Adapter/Socket.php +++ b/app/code/community/PedroTeixeira/Correios/Model/Http/Client/Adapter/Socket.php @@ -7,7 +7,7 @@ * @category PedroTeixeira * @package PedroTeixeira_Correios * @author Pedro Teixeira - * @copyright 2014 Pedro Teixeira (http://pedroteixeira.io) + * @copyright 2015 Pedro Teixeira (http://pedroteixeira.io) * @license http://opensource.org/licenses/MIT MIT * @link https://github.com/pedro-teixeira/correios */ @@ -17,18 +17,19 @@ class PedroTeixeira_Correios_Model_Http_Client_Adapter_Socket protected $_cache = null; protected $_params = null; protected $_code = 'pedroteixeira_correios'; + const CACHE_TYPE = 'pedroteixeira_correios'; - + /** * Connect to the remote server - * + * * @param string $host Host name * @param int $port Port number * @param bool $secure Secure flag - * + * * @return void */ - public function connect($host, $port=80, $secure=false) + public function connect($host, $port = 80, $secure = false) { if (Mage::app()->useCache(self::CACHE_TYPE)) { $mode = $this->getConfigData('cache_mode'); @@ -43,7 +44,7 @@ public function connect($host, $port=80, $secure=false) parent::connect($host, $port, $secure); } } - + /** * Send request to the remote server * @@ -52,7 +53,7 @@ public function connect($host, $port=80, $secure=false) * @param string $http_ver HTTP version * @param array $headers Headers * @param string $body Body - * + * * @return string Request as string */ public function write($method, $uri, $http_ver = '1.1', $headers = array(), $body = '') @@ -73,9 +74,9 @@ public function write($method, $uri, $http_ver = '1.1', $headers = array(), $bod /** * Read response from server - * + * * @see Zend_Http_Client_Adapter_Socket::read() - * + * * @return string */ public function read() @@ -110,7 +111,7 @@ public function read() } return $response; } - + /** * Retrieves the cache instance * @@ -136,7 +137,7 @@ public function getConfigData($field) if (empty($this->_code)) { return false; } - $path = 'carriers/'.$this->_code.'/'.$field; + $path = 'carriers/' . $this->_code . '/' . $field; return Mage::getStoreConfig($path); } } \ No newline at end of file diff --git a/app/code/community/PedroTeixeira/Correios/Model/Source/CacheMode.php b/app/code/community/PedroTeixeira/Correios/Model/Source/CacheMode.php index d7d6552..cec1fcc 100644 --- a/app/code/community/PedroTeixeira/Correios/Model/Source/CacheMode.php +++ b/app/code/community/PedroTeixeira/Correios/Model/Source/CacheMode.php @@ -7,7 +7,7 @@ * @category PedroTeixeira * @package PedroTeixeira_Correios * @author Pedro Teixeira - * @copyright 2014 Pedro Teixeira (http://pedroteixeira.io) + * @copyright 2015 Pedro Teixeira (http://pedroteixeira.io) * @license http://opensource.org/licenses/MIT MIT * @link https://github.com/pedro-teixeira/correios */ @@ -16,7 +16,7 @@ class PedroTeixeira_Correios_Model_Source_CacheMode extends Mage_Eav_Model_Entit const MODE_HTTP_PRIOR = 0; const MODE_CACHE_PRIOR = 1; const MODE_CACHE_ONLY = 2; - + /** * Get options for methods * @@ -33,9 +33,9 @@ public function toOptionArray() /** * Get options for input fields - * + * * @see Mage_Eav_Model_Entity_Attribute_Source_Interface::getAllOptions() - * + * * @return array */ public function getAllOptions() diff --git a/app/code/community/PedroTeixeira/Correios/Model/Source/PostMethods.php b/app/code/community/PedroTeixeira/Correios/Model/Source/PostMethods.php index 18110f5..bbd6652 100644 --- a/app/code/community/PedroTeixeira/Correios/Model/Source/PostMethods.php +++ b/app/code/community/PedroTeixeira/Correios/Model/Source/PostMethods.php @@ -7,7 +7,7 @@ * @category PedroTeixeira * @package PedroTeixeira_Correios * @author Pedro Teixeira - * @copyright 2014 Pedro Teixeira (http://pedroteixeira.io) + * @copyright 2015 Pedro Teixeira (http://pedroteixeira.io) * @license http://opensource.org/licenses/MIT MIT * @link https://github.com/pedro-teixeira/correios */ @@ -37,9 +37,9 @@ public function toOptionArray() /** * Get options for input fields - * + * * @see Mage_Eav_Model_Entity_Attribute_Source_Interface::getAllOptions() - * + * * @return array */ public function getAllOptions() diff --git a/app/code/community/PedroTeixeira/Correios/Model/Source/WeightType.php b/app/code/community/PedroTeixeira/Correios/Model/Source/WeightType.php index 498b8a4..a7279fc 100644 --- a/app/code/community/PedroTeixeira/Correios/Model/Source/WeightType.php +++ b/app/code/community/PedroTeixeira/Correios/Model/Source/WeightType.php @@ -7,7 +7,7 @@ * @category PedroTeixeira * @package PedroTeixeira_Correios * @author Pedro Teixeira - * @copyright 2014 Pedro Teixeira (http://pedroteixeira.io) + * @copyright 2015 Pedro Teixeira (http://pedroteixeira.io) * @license http://opensource.org/licenses/MIT MIT * @link https://github.com/pedro-teixeira/correios */ diff --git a/app/code/community/PedroTeixeira/Correios/etc/config.xml b/app/code/community/PedroTeixeira/Correios/etc/config.xml index f3e2c60..6c1f24c 100644 --- a/app/code/community/PedroTeixeira/Correios/etc/config.xml +++ b/app/code/community/PedroTeixeira/Correios/etc/config.xml @@ -7,7 +7,7 @@ * @category PedroTeixeira * @package PedroTeixeira_Correios * @author Pedro Teixeira - * @copyright 2014 Pedro Teixeira (http://pedroteixeira.io) + * @copyright 2015 Pedro Teixeira (http://pedroteixeira.io) * @license http://opensource.org/licenses/MIT MIT * @link https://github.com/pedro-teixeira/correios */ @@ -65,13 +65,13 @@ - - - - Banco de Cotações dos Correios. - PEDROTEIXEIRA_CORREIOS - - + + + + Banco de Cotações dos Correios. + PEDROTEIXEIRA_CORREIOS + + @@ -195,7 +195,6 @@ Houve um erro inesperado, por favor entre em contato. %s Valor de compra fora do permitido pelos Correios. Por favor entre em contato conosco. Por favor, corrija o CEP digitado, ele não está correto. - Peso dos produtos acima do permitido pelos Correios. Por favor entre em contato conosco. Lojista: O peso do produto deverá ser maior que zero. Se você está usando a media de peso como gramas, o peso mínimo é de 10 gramas. Lojista: Para calcular esse serviço você precisa ter contrato com os Correios. Esse método de envio está fora do ar. Por favor entre em contato conosco. diff --git a/app/code/community/PedroTeixeira/Correios/etc/system.xml b/app/code/community/PedroTeixeira/Correios/etc/system.xml index b6fbc31..1436bbc 100644 --- a/app/code/community/PedroTeixeira/Correios/etc/system.xml +++ b/app/code/community/PedroTeixeira/Correios/etc/system.xml @@ -7,7 +7,7 @@ * @category PedroTeixeira * @package PedroTeixeira_Correios * @author Pedro Teixeira - * @copyright 2014 Pedro Teixeira (http://pedroteixeira.io) + * @copyright 2015 Pedro Teixeira (http://pedroteixeira.io) * @license http://opensource.org/licenses/MIT MIT * @link https://github.com/pedro-teixeira/correios */ @@ -31,6 +31,7 @@

Lembre-se de configurar as "Definições de Envio" no menu ao lado esquerdo.

Para serviços que tenham em seu nome "Com Contrato", é necessário configurar o "Código Administrativo dos Correios" e "Senha Administrativa dos Correios".

Para utilizar as regras de desconto de frete, você deve configurar o "Serviço para entrega gratuita", lembre-se de habilitar o serviço.

+

Agradecimento especial para todos os contribuidores.

Pedro Teixeira [pedroteixeira.io ]



@@ -217,15 +218,6 @@ 1 1 - - - text - 150 - 1 - 1 - 1 - Utilize o mesmo formato de peso configurado no módulo, kilos ou gramas. - text @@ -276,14 +268,6 @@ 1 1 - - - textarea - 220 - 1 - 1 - 1 - textarea diff --git a/app/code/community/PedroTeixeira/Correios/sql/pedroteixeira_correios_setup/install-4.0.0.php b/app/code/community/PedroTeixeira/Correios/sql/pedroteixeira_correios_setup/install-4.0.0.php index fb4b488..807bdc7 100644 --- a/app/code/community/PedroTeixeira/Correios/sql/pedroteixeira_correios_setup/install-4.0.0.php +++ b/app/code/community/PedroTeixeira/Correios/sql/pedroteixeira_correios_setup/install-4.0.0.php @@ -7,7 +7,7 @@ * @category PedroTeixeira * @package PedroTeixeira_Correios * @author Pedro Teixeira - * @copyright 2014 Pedro Teixeira (http://pedroteixeira.io) + * @copyright 2015 Pedro Teixeira (http://pedroteixeira.io) * @license http://opensource.org/licenses/MIT MIT * @link https://github.com/pedro-teixeira/correios */ diff --git a/app/code/community/PedroTeixeira/Correios/sql/pedroteixeira_correios_setup/install-4.4.0.php b/app/code/community/PedroTeixeira/Correios/sql/pedroteixeira_correios_setup/install-4.4.0.php index 3edb7ed..9858da5 100644 --- a/app/code/community/PedroTeixeira/Correios/sql/pedroteixeira_correios_setup/install-4.4.0.php +++ b/app/code/community/PedroTeixeira/Correios/sql/pedroteixeira_correios_setup/install-4.4.0.php @@ -7,7 +7,7 @@ * @category PedroTeixeira * @package PedroTeixeira_Correios * @author Pedro Teixeira - * @copyright 2014 Pedro Teixeira (http://pedroteixeira.io) + * @copyright 2015 Pedro Teixeira (http://pedroteixeira.io) * @license http://opensource.org/licenses/MIT MIT * @link https://github.com/pedro-teixeira/correios */ @@ -28,7 +28,7 @@ 'type' => 'int', 'input' => 'text', 'apply_to' => 'simple,bundle,grouped,configurable', - 'note' => 'Comprimento da embalagem do produto (Para cálculo de PAC, mínimo de 16)' + 'note' => 'Comprimento da embalagem do produto (Para cálculo dos Correios)' ); $setup->addAttribute('catalog_product', $codigo, $config); @@ -42,7 +42,7 @@ 'type' => 'int', 'input' => 'text', 'apply_to' => 'simple,bundle,grouped,configurable', - 'note' => 'Altura da embalagem do produto (Para cálculo de PAC, mínimo de 2)' + 'note' => 'Altura da embalagem do produto (Para cálculo dos Correios)' ); $setup->addAttribute('catalog_product', $codigo, $config); @@ -56,7 +56,7 @@ 'type' => 'int', 'input' => 'text', 'apply_to' => 'simple,bundle,grouped,configurable', - 'note' => 'Largura da embalagem do produto (Para cálculo de PAC, mínimo de 11)' + 'note' => 'Largura da embalagem do produto (Para cálculo dos Correios)' ); $setup->addAttribute('catalog_product', $codigo, $config); diff --git a/app/code/community/PedroTeixeira/Correios/sql/pedroteixeira_correios_setup/upgrade-4.0.0-4.1.0.php b/app/code/community/PedroTeixeira/Correios/sql/pedroteixeira_correios_setup/upgrade-4.0.0-4.1.0.php index da4e582..25550eb 100644 --- a/app/code/community/PedroTeixeira/Correios/sql/pedroteixeira_correios_setup/upgrade-4.0.0-4.1.0.php +++ b/app/code/community/PedroTeixeira/Correios/sql/pedroteixeira_correios_setup/upgrade-4.0.0-4.1.0.php @@ -7,7 +7,7 @@ * @category PedroTeixeira * @package PedroTeixeira_Correios * @author Pedro Teixeira - * @copyright 2014 Pedro Teixeira (http://pedroteixeira.io) + * @copyright 2015 Pedro Teixeira (http://pedroteixeira.io) * @license http://opensource.org/licenses/MIT MIT * @link https://github.com/pedro-teixeira/correios */ diff --git a/app/code/community/PedroTeixeira/Correios/sql/pedroteixeira_correios_setup/upgrade-4.1.0-4.2.0.php b/app/code/community/PedroTeixeira/Correios/sql/pedroteixeira_correios_setup/upgrade-4.1.0-4.2.0.php index c4d2530..3ec8deb 100644 --- a/app/code/community/PedroTeixeira/Correios/sql/pedroteixeira_correios_setup/upgrade-4.1.0-4.2.0.php +++ b/app/code/community/PedroTeixeira/Correios/sql/pedroteixeira_correios_setup/upgrade-4.1.0-4.2.0.php @@ -7,7 +7,7 @@ * @category PedroTeixeira * @package PedroTeixeira_Correios * @author Pedro Teixeira - * @copyright 2014 Pedro Teixeira (http://pedroteixeira.io) + * @copyright 2015 Pedro Teixeira (http://pedroteixeira.io) * @license http://opensource.org/licenses/MIT MIT * @link https://github.com/pedro-teixeira/correios */ diff --git a/app/code/community/PedroTeixeira/Correios/sql/pedroteixeira_correios_setup/upgrade-4.2.0-4.3.0.php b/app/code/community/PedroTeixeira/Correios/sql/pedroteixeira_correios_setup/upgrade-4.2.0-4.3.0.php index 5024f71..0f189ac 100644 --- a/app/code/community/PedroTeixeira/Correios/sql/pedroteixeira_correios_setup/upgrade-4.2.0-4.3.0.php +++ b/app/code/community/PedroTeixeira/Correios/sql/pedroteixeira_correios_setup/upgrade-4.2.0-4.3.0.php @@ -7,7 +7,7 @@ * @category PedroTeixeira * @package PedroTeixeira_Correios * @author Pedro Teixeira - * @copyright 2014 Pedro Teixeira (http://pedroteixeira.io) + * @copyright 2015 Pedro Teixeira (http://pedroteixeira.io) * @license http://opensource.org/licenses/MIT MIT * @link https://github.com/pedro-teixeira/correios */ diff --git a/app/code/community/PedroTeixeira/Correios/sql/pedroteixeira_correios_setup/upgrade-4.3.0-4.4.0.php b/app/code/community/PedroTeixeira/Correios/sql/pedroteixeira_correios_setup/upgrade-4.3.0-4.4.0.php index 24b4103..3db5a14 100644 --- a/app/code/community/PedroTeixeira/Correios/sql/pedroteixeira_correios_setup/upgrade-4.3.0-4.4.0.php +++ b/app/code/community/PedroTeixeira/Correios/sql/pedroteixeira_correios_setup/upgrade-4.3.0-4.4.0.php @@ -7,7 +7,7 @@ * @category PedroTeixeira * @package PedroTeixeira_Correios * @author Pedro Teixeira - * @copyright 2014 Pedro Teixeira (http://pedroteixeira.io) + * @copyright 2015 Pedro Teixeira (http://pedroteixeira.io) * @license http://opensource.org/licenses/MIT MIT * @link https://github.com/pedro-teixeira/correios */ diff --git a/app/etc/modules/PedroTeixeira_Correios.xml b/app/etc/modules/PedroTeixeira_Correios.xml index d46459c..ff304d8 100644 --- a/app/etc/modules/PedroTeixeira_Correios.xml +++ b/app/etc/modules/PedroTeixeira_Correios.xml @@ -7,7 +7,7 @@ * @category PedroTeixeira * @package PedroTeixeira_Correios * @author Pedro Teixeira - * @copyright 2014 Pedro Teixeira (http://pedroteixeira.io) + * @copyright 2015 Pedro Teixeira (http://pedroteixeira.io) * @license http://opensource.org/licenses/MIT MIT * @link https://github.com/pedro-teixeira/correios */