correios - Version 1.0.3

Version Notes

* Adicionada opção para não exibir o prazo de entrega

Download this release

Release Info

Developer Willian
Extension correios
Version 1.0.3
Comparing to
See all releases


Code changes from version 1.0.2 to 1.0.3

app/code/community/Storm/Correios/Model/Carrier/Shipping.php CHANGED
@@ -51,7 +51,7 @@ class Storm_Correios_Model_Carrier_Shipping extends Mage_Shipping_Model_Carrier_
51
  $method->setCarrier($this->_code)
52
  ->setCarrierTitle($this->getConfigData('title'))
53
  ->setMethod($rate->getCode())
54
- ->setMethodTitle($this->_getMethodTitle($rate, true))
55
  ->setCost($rate->getPrice())
56
  ->setPrice($this->_getFinalPrice($rate, $request));
57
 
@@ -65,6 +65,11 @@ class Storm_Correios_Model_Carrier_Shipping extends Mage_Shipping_Model_Carrier_
65
  return $result;
66
  }
67
 
 
 
 
 
 
68
  /**
69
  * Adds the error message in the result
70
  *
@@ -284,7 +289,11 @@ class Storm_Correios_Model_Carrier_Shipping extends Mage_Shipping_Model_Carrier_
284
  $title = $this->_getHelper()->getMethodTitle($method->getCode());
285
 
286
  if ($includeDeliveryTime) {
287
- return $this->_getHelper()->__('%s - %d working day(s)', $title, $method->getDeliveryTime());
 
 
 
 
288
  }
289
 
290
  return $title;
51
  $method->setCarrier($this->_code)
52
  ->setCarrierTitle($this->getConfigData('title'))
53
  ->setMethod($rate->getCode())
54
+ ->setMethodTitle($this->_getMethodTitle($rate, $this->_canShowDeliverytime()))
55
  ->setCost($rate->getPrice())
56
  ->setPrice($this->_getFinalPrice($rate, $request));
57
 
65
  return $result;
66
  }
67
 
68
+ protected function _canShowDeliverytime()
69
+ {
70
+ return (bool) $this->_getHelper()->getConfigData('show_deliverytime');
71
+ }
72
+
73
  /**
74
  * Adds the error message in the result
75
  *
289
  $title = $this->_getHelper()->getMethodTitle($method->getCode());
290
 
291
  if ($includeDeliveryTime) {
292
+ if($method->getDeliveryTime() > 1) {
293
+ return $this->_getHelper()->__('%s (%d working days)', $title, $method->getDeliveryTime());
294
+ } else {
295
+ return $this->_getHelper()->__('%s (%d working day)', $title, $method->getDeliveryTime());
296
+ }
297
  }
298
 
299
  return $title;
app/code/community/Storm/Correios/etc/config.xml CHANGED
@@ -94,8 +94,9 @@
94
  <name>Correios</name>
95
  <title>Correios</title>
96
  <debug_mode>0</debug_mode>
97
- <showmethod>1</showmethod>
98
  <free_shipping_method>no-free-shipping</free_shipping_method>
 
99
  </correios>
100
  </carriers>
101
  </default>
94
  <name>Correios</name>
95
  <title>Correios</title>
96
  <debug_mode>0</debug_mode>
97
+ <showmethod>1</showmethod>
98
  <free_shipping_method>no-free-shipping</free_shipping_method>
99
+ <show_deliverytime>1</show_deliverytime>
100
  </correios>
101
  </carriers>
102
  </default>
app/code/community/Storm/Correios/etc/system.xml CHANGED
@@ -115,11 +115,20 @@
115
  <show_in_website>1</show_in_website>
116
  <show_in_store>1</show_in_store>
117
  </showmethod>
 
 
 
 
 
 
 
 
 
118
  <handling_type translate="label">
119
  <label>Calculate Handling Fee</label>
120
  <frontend_type>select</frontend_type>
121
  <source_model>shipping/source_handlingType</source_model>
122
- <sort_order>12</sort_order>
123
  <show_in_default>1</show_in_default>
124
  <show_in_website>1</show_in_website>
125
  <show_in_store>0</show_in_store>
@@ -128,8 +137,8 @@
128
  <label>Handling Fee</label>
129
  <frontend_type>text</frontend_type>
130
  <comment><![CDATA[This value will be added on final price of shipping]]></comment>
131
- <validate>validate-number validate-zero-or-greater</validate>
132
- <sort_order>13</sort_order>
133
  <show_in_default>1</show_in_default>
134
  <show_in_website>1</show_in_website>
135
  <show_in_store>0</show_in_store>
115
  <show_in_website>1</show_in_website>
116
  <show_in_store>1</show_in_store>
117
  </showmethod>
118
+ <show_deliverytime>
119
+ <label>Show delivery time</label>
120
+ <frontend_type>select</frontend_type>
121
+ <source_model>adminhtml/system_config_source_yesno</source_model>
122
+ <sort_order>12</sort_order>
123
+ <show_in_default>1</show_in_default>
124
+ <show_in_website>1</show_in_website>
125
+ <show_in_store>1</show_in_store>
126
+ </show_deliverytime>
127
  <handling_type translate="label">
128
  <label>Calculate Handling Fee</label>
129
  <frontend_type>select</frontend_type>
130
  <source_model>shipping/source_handlingType</source_model>
131
+ <sort_order>13</sort_order>
132
  <show_in_default>1</show_in_default>
133
  <show_in_website>1</show_in_website>
134
  <show_in_store>0</show_in_store>
137
  <label>Handling Fee</label>
138
  <frontend_type>text</frontend_type>
139
  <comment><![CDATA[This value will be added on final price of shipping]]></comment>
140
+ <validate>validate-number</validate>
141
+ <sort_order>14</sort_order>
142
  <show_in_default>1</show_in_default>
143
  <show_in_website>1</show_in_website>
144
  <show_in_store>0</show_in_store>
app/locale/pt_BR/Storm_Correios.csv CHANGED
@@ -21,7 +21,8 @@
21
  "The heigth of the products is greater than %d cm","A altura dos produtos é maior do que %d cm"
22
  "The length of the products is greater than %d cm","O comprimento dos produtos é maior do que %d cm"
23
  "The dimensions of the products have passed the limit of of %d cm","As dimensões dos produtos passaram do limite de %d cm"
24
- "%s - %d working day(s)","%s - %d dia(s) útil(eis)"
 
25
  "Please, enter the postcode correctly.","Por favor, digite o código postal corretamente"
26
  "The package weight exceeds the weight limit.","O peso do pacote excede o peso limite."
27
  "Show method if not applicable","Mostrar método se não aplicável"
@@ -32,11 +33,12 @@
32
  "Handling Fee","Taxa de Manuseio"
33
  "Calculate Handling Fee","Cálculo de Taxa de Manuseio"
34
  "Fixed","Fixo"
35
- "Percent","Porcetagem"
36
  "Title","Título"
37
  "Enabled","Habilitado"
38
  "Yes","Sim"
39
  "No","Não"
40
  "This value will be added on final price of shipping","Este valor será adicionado no preço final do frete"
41
  "The extension of PHP Soap must be installed so that the module Correios to function properly.","A extensão do PHP Soap deve estar instalada para que o módulo dos Correios funcione corretamente."
42
- "You must to install PHP Soap extension to use shipping method Correios.","Você deve instalar a extensão Soap do PHP para usar o método de entrega dos Correios."
 
21
  "The heigth of the products is greater than %d cm","A altura dos produtos é maior do que %d cm"
22
  "The length of the products is greater than %d cm","O comprimento dos produtos é maior do que %d cm"
23
  "The dimensions of the products have passed the limit of of %d cm","As dimensões dos produtos passaram do limite de %d cm"
24
+ "%s (%d working days)","%s (%d dias úteis)"
25
+ "%s (%d working day)","%s (%d dia útil)"
26
  "Please, enter the postcode correctly.","Por favor, digite o código postal corretamente"
27
  "The package weight exceeds the weight limit.","O peso do pacote excede o peso limite."
28
  "Show method if not applicable","Mostrar método se não aplicável"
33
  "Handling Fee","Taxa de Manuseio"
34
  "Calculate Handling Fee","Cálculo de Taxa de Manuseio"
35
  "Fixed","Fixo"
36
+ "Percent","Porcentagem"
37
  "Title","Título"
38
  "Enabled","Habilitado"
39
  "Yes","Sim"
40
  "No","Não"
41
  "This value will be added on final price of shipping","Este valor será adicionado no preço final do frete"
42
  "The extension of PHP Soap must be installed so that the module Correios to function properly.","A extensão do PHP Soap deve estar instalada para que o módulo dos Correios funcione corretamente."
43
+ "You must to install PHP Soap extension to use shipping method Correios.","Você deve instalar a extensão Soap do PHP para usar o método de entrega dos Correios."
44
+ "Show delivery time","Mostrar o prazo de entrega"
package.xml CHANGED
@@ -1,44 +1,30 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>correios</name>
4
- <version>1.0.2</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">OSL 3.0</license>
7
  <channel>community</channel>
8
  <extends/>
9
- <summary>M&#xF3;dulo para o c&#xE1;lculo do valor e tempo estimado de transporte usando Webservice de Correios.</summary>
10
- <description>Novo m&#xF3;dulo dos correios desenvolvido para a vers&#xE3;o 1.7 com boas pr&#xE1;ticas de programa&#xE7;&#xE3;o.&#xD;
11
- O m&#xF3;dulo conta com os seguintes servi&#xE7;os para a op&#xE7;&#xE3;o de c&#xE1;lculo sem contrato com os Correios:&#xD;
12
- &#xD;
13
- - Sedex&#xD;
14
- - Sedex a cobrar&#xD;
15
- - Sedex 10&#xD;
16
- - Sedex hoje&#xD;
17
- - Pac&#xD;
18
- &#xD;
19
- Os seguintes servi&#xE7;os de entrega est&#xE3;o dispon&#xED;veis com contrato:&#xD;
20
- &#xD;
21
- - Sedex&#xD;
22
- - Sedex a cobrar&#xD;
23
- - Pac&#xD;
24
- - e-Sedex&#xD;
25
- - e-Sedex priorit&#xE1;rio&#xD;
26
- - e-Sedex express&#xD;
27
- &#xD;
28
- Fun&#xE7;&#xF5;es do m&#xF3;dulo:&#xD;
29
- &#xD;
30
- * Rastreador de objeto em tempo real&#xD;
31
- * Escolha do m&#xE9;todo de frete gr&#xE1;tis inteligente ( segue regras de promo&#xE7;&#xE3;o )&#xD;
32
- * Possibilidade de adicionar dias ao prazo de entrega&#xD;
33
- * F&#xE1;cil tradu&#xE7;&#xE3;o de todas as mensagens&#xD;
34
- * Configura&#xE7;&#xE3;o f&#xE1;cil e intu&#xED;tiva</description>
35
- <notes>* Verifica&#xE7;&#xE3;o da extens&#xE3;o PHP Soap&#xD;
36
- * Melhorada mensagem de prazo de entrega&#xD;
37
- * Adicionado link para wiki nas configura&#xE7;&#xF5;es</notes>
38
  <authors><author><name>Willian</name><user>willsouza</user><email>williancordeirodesouza@gmail.com</email></author></authors>
39
- <date>2013-04-25</date>
40
- <time>23:00:54</time>
41
- <contents><target name="magecommunity"><dir name="Storm"><dir name="Correios"><dir name="Helper"><file name="Data.php" hash="c0344a3cccf20787f115b24cacef68b7"/></dir><dir name="Model"><dir name="Adminhtml"><file name="Observer.php" hash="3e2d7ae7abb9dc2131f2a7868fd89d87"/></dir><dir name="Carrier"><dir name="Package"><file name="Dimension.php" hash="88d12d19a36e753c94f30c08431e9c45"/></dir><dir name="Shipping"><file name="Tracking.php" hash="6eb85dafb65d4d35bbf36a609905aae7"/></dir><file name="Shipping.php" hash="0e935cf432af23d09cec5223eea8e786"/><file name="Webservice.php" hash="79c7b0d57285e94b82b1c47521da3675"/></dir><dir name="Catalog"><dir name="Resource"><file name="Setup.php" hash="833a10b8bc912d3df9818f3b0f86d442"/></dir></dir><dir name="Source"><file name="FreeMethods.php" hash="67646bf270c42fa6fa8b79de336236b3"/><file name="Methods.php" hash="d9118016fe15471f813682385c95a93b"/></dir></dir><dir name="etc"><file name="config.xml" hash="98fa5dc22a115d1871a0ceef7c6b0c82"/><file name="system.xml" hash="18357e3ea97d3d5518e2e0b974037941"/></dir><dir name="sql"><dir name="correios_setup"><file name="mysql4-install-0.1.0.php" hash="dca339c0e46e4b9d116bc1eea9d09930"/></dir></dir></dir></dir></target><target name="magelocale"><dir name="pt_BR"><file name="Storm_Correios.csv" hash="2c9c04ccf7044d8f0ed9c93f314d47bc"/></dir></target><target name="mageetc"><dir name="modules"><file name="Storm_Correios.xml" hash="93aa3a9938657131b77fa2a2e60abd71"/></dir></target></contents>
42
  <compatible/>
43
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
44
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>correios</name>
4
+ <version>1.0.3</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">OSL 3.0</license>
7
  <channel>community</channel>
8
  <extends/>
9
+ <summary>M&#xF3;dulo de c&#xE1;lculo de frete e prazo de entrega dos Correios com Pac, Sedex, Sedex 10, Sedex Hoje e e-Sedex.</summary>
10
+ <description>M&#xF3;dulo para efetuar c&#xE1;lculo de frete e prazo de entrega dos Correios.&lt;br /&gt; &#xD;
11
+ As seguintes fun&#xE7;&#xF5;es est&#xE3;o dispon&#xED;ves:&lt;br /&gt;&lt;br /&gt;&#xD;
12
+ * Entrega com Sedex, Sedex a cobrar, Sedex 10, Sedex hoje, Pac, e-Sedex, e-Sedex priorit&#xE1;rio e e-Sedex express.&lt;br /&gt;&#xD;
13
+ * Confingura&#xE7;&#xF5;es para comerciantes com contrato com os Correios com pre&#xE7;o diferenciado.&lt;br /&gt;&#xD;
14
+ * Rastreador de objeto em tempo real.&lt;br /&gt;&#xD;
15
+ * Escolha do m&#xE9;todo de frete gr&#xE1;tis inteligente ( segue regras de promo&#xE7;&#xE3;o ).&lt;br /&gt;&#xD;
16
+ * Possibilidade de adicionar dias ao prazo de entrega.&lt;br /&gt; &#xD;
17
+ * Possibilidade de adicionar taxa de manuseio fixa ou percentual.&lt;br /&gt;&#xD;
18
+ * Configura&#xE7;&#xE3;o e instala&#xE7;&#xE3;o f&#xE1;cil e intu&#xED;tiva.&lt;br /&gt;&#xD;
19
+ &lt;br /&gt;&#xD;
20
+ Caso tenha d&#xFA;vida de como instalar e configurar o m&#xF3;dulo &lt;a href="https://bitbucket.org/willcs/correios/wiki"&gt;acesse nosso Wiki&lt;/a&gt;.&lt;br /&gt;&#xD;
21
+ &lt;hr /&gt;&#xD;
22
+ This module is available only to Brazil.</description>
23
+ <notes>* Adicionada op&#xE7;&#xE3;o para n&#xE3;o exibir o prazo de entrega</notes>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24
  <authors><author><name>Willian</name><user>willsouza</user><email>williancordeirodesouza@gmail.com</email></author></authors>
25
+ <date>2013-04-26</date>
26
+ <time>01:39:21</time>
27
+ <contents><target name="magecommunity"><dir name="Storm"><dir name="Correios"><dir name="Helper"><file name="Data.php" hash="c0344a3cccf20787f115b24cacef68b7"/></dir><dir name="Model"><dir name="Adminhtml"><file name="Observer.php" hash="3e2d7ae7abb9dc2131f2a7868fd89d87"/></dir><dir name="Carrier"><dir name="Package"><file name="Dimension.php" hash="88d12d19a36e753c94f30c08431e9c45"/></dir><dir name="Shipping"><file name="Tracking.php" hash="6eb85dafb65d4d35bbf36a609905aae7"/></dir><file name="Shipping.php" hash="bd6ee1f366902a4d202b48357fb3ca70"/><file name="Webservice.php" hash="79c7b0d57285e94b82b1c47521da3675"/></dir><dir name="Catalog"><dir name="Resource"><file name="Setup.php" hash="833a10b8bc912d3df9818f3b0f86d442"/></dir></dir><dir name="Source"><file name="FreeMethods.php" hash="67646bf270c42fa6fa8b79de336236b3"/><file name="Methods.php" hash="d9118016fe15471f813682385c95a93b"/></dir></dir><dir name="etc"><file name="config.xml" hash="2c44532bab3a88901458f87e0addb250"/><file name="system.xml" hash="e5873a80b24f0234ffe30194baf6765b"/></dir><dir name="sql"><dir name="correios_setup"><file name="mysql4-install-0.1.0.php" hash="dca339c0e46e4b9d116bc1eea9d09930"/></dir></dir></dir></dir></target><target name="magelocale"><dir name="pt_BR"><file name="Storm_Correios.csv" hash="614f83b94693fbb2e05f85ed6030d6d0"/></dir></target><target name="mageetc"><dir name="modules"><file name="Storm_Correios.xml" hash="93aa3a9938657131b77fa2a2e60abd71"/></dir></target></contents>
28
  <compatible/>
29
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
30
  </package>