correios - Version 1.3.4

Version Notes

* Correção no cálculo de dimensão dos produtos

Download this release

Release Info

Developer Willian
Extension correios
Version 1.3.4
Comparing to
See all releases


Code changes from version 1.3.3 to 1.3.4

app/code/community/Storm/Correios/Helper/Data.php CHANGED
File without changes
app/code/community/Storm/Correios/Model/Adminhtml/Observer.php CHANGED
@@ -3,20 +3,20 @@
3
  * @category Storm
4
  * @package Storm_Correios
5
  * @copyright Copyright (c) 2013 Willian Cordeiro de Souza
6
- * @author Willian Cordeiro de Souza <williancordeirodesouza@gmail.com>
7
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
8
  */
9
- class Storm_Correios_Model_Adminhtml_Observer
10
- {
11
  /**
12
  * Check if there are errors in the module configuration
13
  * and requirements for the delivery method
14
  * work properly
15
- *
16
  * @param Varien_Event_Observer $observer
17
  * @return boolean
18
  */
19
- public function checkConfiguration(Varien_Event_Observer $observer)
20
  {
21
  try {
22
  if (!Mage::getSingleton('admin/session')->isLoggedIn()) {
@@ -26,7 +26,7 @@ class Storm_Correios_Model_Adminhtml_Observer
26
  if(!Mage::helper('adminnotification')->isModuleEnabled()) {
27
  return false;
28
  }
29
-
30
  if(!extension_loaded('soap')) {
31
  throw new Exception(Mage::helper('correios')->__('The extension of PHP Soap must be installed so that the module Correios to function properly.'));
32
  }
@@ -36,11 +36,11 @@ class Storm_Correios_Model_Adminhtml_Observer
36
  }
37
 
38
  return true;
39
- } catch(Exception $e) {
40
  $this->_addMessage($e->getMessage());
41
  }
42
  }
43
-
44
  protected function _addMessage($message)
45
  {
46
  $this->_getInbox()->getResource()->parse($this->_getInbox(), array(
@@ -51,13 +51,13 @@ class Storm_Correios_Model_Adminhtml_Observer
51
  'url' => '',
52
  )
53
  ));
54
-
55
  return $this;
56
  }
57
-
58
  /**
59
  * Gets the message model
60
- *
61
  * @return Mage_AdminNotification_Model_Inbox
62
  */
63
  protected function _getInbox()
3
  * @category Storm
4
  * @package Storm_Correios
5
  * @copyright Copyright (c) 2013 Willian Cordeiro de Souza
6
+ * @author Willian Cordeiro de Souza <williancordeirodesouza@gmail.com>
7
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
8
  */
9
+ class Storm_Correios_Model_Adminhtml_Observer
10
+ {
11
  /**
12
  * Check if there are errors in the module configuration
13
  * and requirements for the delivery method
14
  * work properly
15
+ *
16
  * @param Varien_Event_Observer $observer
17
  * @return boolean
18
  */
19
+ public function checkConfiguration(Varien_Event_Observer $observer)
20
  {
21
  try {
22
  if (!Mage::getSingleton('admin/session')->isLoggedIn()) {
26
  if(!Mage::helper('adminnotification')->isModuleEnabled()) {
27
  return false;
28
  }
29
+
30
  if(!extension_loaded('soap')) {
31
  throw new Exception(Mage::helper('correios')->__('The extension of PHP Soap must be installed so that the module Correios to function properly.'));
32
  }
36
  }
37
 
38
  return true;
39
+ } catch(Exception $e) {
40
  $this->_addMessage($e->getMessage());
41
  }
42
  }
43
+
44
  protected function _addMessage($message)
45
  {
46
  $this->_getInbox()->getResource()->parse($this->_getInbox(), array(
51
  'url' => '',
52
  )
53
  ));
54
+
55
  return $this;
56
  }
57
+
58
  /**
59
  * Gets the message model
60
+ *
61
  * @return Mage_AdminNotification_Model_Inbox
62
  */
63
  protected function _getInbox()
app/code/community/Storm/Correios/Model/Carrier/Package/Dimension.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  /**
3
  * @method Mage_Shipping_Model_Rate_Request getRequest()
4
  * @method Storm_Correios_Model_Carrier_Package_Dimension setError(Exception $error)
@@ -16,80 +17,82 @@ class Storm_Correios_Model_Carrier_Package_Dimension extends Varien_Object
16
  const PACKAGE_MAX_LENGTH = 105;
17
  const PACKAGE_MIN_HEIGHT = 2;
18
  const PACKAGE_MAX_HEIGHT = 105;
19
- const PACKAGE_MIN_WIDTH = 11;
20
  const PACKAGE_MAX_WIDTH = 105;
21
  const PACKAGE_MAX_SUM = 200;
22
-
23
  /**
24
  * Assign requisition
25
- *
26
  * @param Mage_Shipping_Model_Rate_Request $request
27
  * @return Storm_Correios_Model_Carrier_Package_Dimension
28
  */
29
  public function setRequest(Mage_Shipping_Model_Rate_Request $request)
30
  {
31
- foreach($request->getAllItems() as $item) {
32
- $this->setWidth($item->getProduct()->getPackageWidth() + $this->getWidth())
33
- ->setHeight($item->getProduct()->getPackageHeight() + $this->getHeight())
34
- ->setLength($item->getProduct()->getPackageLength() + $this->getLength());
35
- }
36
-
37
- if($this->getWidth() < self::PACKAGE_MIN_WIDTH) {
38
- $this->setWidth(self::PACKAGE_MIN_WIDTH);
39
- }
40
-
41
- if($this->getHeight() < self::PACKAGE_MIN_HEIGHT) {
42
- $this->setHeight(self::PACKAGE_MIN_HEIGHT);
43
- }
44
-
45
- if($this->getLength() < self::PACKAGE_MIN_LENGTH) {
46
- $this->setLength(self::PACKAGE_MIN_LENGTH);
47
- }
48
-
49
- $this->setData('request', $request);
50
- return $this;
51
- }
52
-
 
 
53
  /**
54
  * Checks if the dimensions of packages
55
  * products are valid
56
- *
57
  * @return boolean
58
  * @throws Mage_Shipping_Exception
59
  */
60
  public function isValid()
61
  {
62
- try {
63
- if($this->getWidth() > self::PACKAGE_MAX_WIDTH) {
64
- throw new Mage_Shipping_Exception($this->_getHelper()->__('The width of the products is greater than %d cm', self::PACKAGE_MAX_WIDTH));
65
- }
66
 
67
- if($this->getHeight() > self::PACKAGE_MAX_HEIGHT) {
68
- throw new Mage_Shipping_Exception($this->_getHelper()->__('The heigth of the products is greater than %d cm', self::PACKAGE_MAX_HEIGHT));
69
- }
70
 
71
- if($this->getLength() > self::PACKAGE_MAX_LENGTH) {
72
- throw new Mage_Shipping_Exception($this->_getHelper()->__('The length of the products is greater than %d cm', self::PACKAGE_MAX_LENGTH));
73
- }
74
-
75
- if(($this->getWidth() + $this->getHeigth() + $this->getLength()) > self::PACKAGE_MAX_SUM) {
76
- throw new Mage_Shipping_Exception($this->_getHelper()->__('The dimensions of the products have passed the limit of of %d cm', self::PACKAGE_MAX_SUM));
77
- }
78
- } catch(Mage_Shipping_Exception $error) {
79
- $this->setError($error);
80
- return false;
81
- }
82
-
83
- return true;
84
  }
85
-
86
  /**
87
  * Gets the helper module's main
88
- *
89
  * @return Storm_Correios_Helper_Data
90
  */
91
  protected function _getHelper()
92
  {
93
- return Mage::helper('correios');
94
  }
95
  }
1
  <?php
2
+
3
  /**
4
  * @method Mage_Shipping_Model_Rate_Request getRequest()
5
  * @method Storm_Correios_Model_Carrier_Package_Dimension setError(Exception $error)
17
  const PACKAGE_MAX_LENGTH = 105;
18
  const PACKAGE_MIN_HEIGHT = 2;
19
  const PACKAGE_MAX_HEIGHT = 105;
20
+ const PACKAGE_MIN_WIDTH = 11;
21
  const PACKAGE_MAX_WIDTH = 105;
22
  const PACKAGE_MAX_SUM = 200;
23
+
24
  /**
25
  * Assign requisition
26
+ *
27
  * @param Mage_Shipping_Model_Rate_Request $request
28
  * @return Storm_Correios_Model_Carrier_Package_Dimension
29
  */
30
  public function setRequest(Mage_Shipping_Model_Rate_Request $request)
31
  {
32
+ foreach ($request->getAllItems() as $item) {
33
+ $cubic = ceil(pow(($item->getProduct()->getPackageWidth() * $item->getProduct()->getPackageHeight() * $item->getProduct()->getPackageLength()) * $item->getQty(), 1/3));
34
+
35
+ $this->setHeight($cubic + $this->getHeight())
36
+ ->setWidth($cubic + $this->getWidth())
37
+ ->setLength($cubic + $this->getLength());
38
+ }
39
+
40
+ if ($this->getWidth() < self::PACKAGE_MIN_WIDTH) {
41
+ $this->setWidth(self::PACKAGE_MIN_WIDTH);
42
+ }
43
+
44
+ if ($this->getHeight() < self::PACKAGE_MIN_HEIGHT) {
45
+ $this->setHeight(self::PACKAGE_MIN_HEIGHT);
46
+ }
47
+
48
+ if ($this->getLength() < self::PACKAGE_MIN_LENGTH) {
49
+ $this->setLength(self::PACKAGE_MIN_LENGTH);
50
+ }
51
+
52
+ $this->setData('request', $request);
53
+ return $this;
54
+ }
55
+
56
  /**
57
  * Checks if the dimensions of packages
58
  * products are valid
59
+ *
60
  * @return boolean
61
  * @throws Mage_Shipping_Exception
62
  */
63
  public function isValid()
64
  {
65
+ try {
66
+ if ($this->getWidth() > self::PACKAGE_MAX_WIDTH) {
67
+ throw new Mage_Shipping_Exception($this->_getHelper()->__('The width of the products is greater than %d cm', self::PACKAGE_MAX_WIDTH));
68
+ }
69
 
70
+ if ($this->getHeight() > self::PACKAGE_MAX_HEIGHT) {
71
+ throw new Mage_Shipping_Exception($this->_getHelper()->__('The heigth of the products is greater than %d cm', self::PACKAGE_MAX_HEIGHT));
72
+ }
73
 
74
+ if ($this->getLength() > self::PACKAGE_MAX_LENGTH) {
75
+ throw new Mage_Shipping_Exception($this->_getHelper()->__('The length of the products is greater than %d cm', self::PACKAGE_MAX_LENGTH));
76
+ }
77
+
78
+ if (($this->getWidth() + $this->getHeigth() + $this->getLength()) > self::PACKAGE_MAX_SUM) {
79
+ throw new Mage_Shipping_Exception($this->_getHelper()->__('The dimensions of the products have passed the limit of of %d cm', self::PACKAGE_MAX_SUM));
80
+ }
81
+ } catch (Mage_Shipping_Exception $error) {
82
+ $this->setError($error);
83
+ return false;
84
+ }
85
+
86
+ return true;
87
  }
88
+
89
  /**
90
  * Gets the helper module's main
91
+ *
92
  * @return Storm_Correios_Helper_Data
93
  */
94
  protected function _getHelper()
95
  {
96
+ return Mage::helper('correios');
97
  }
98
  }
app/code/community/Storm/Correios/Model/Carrier/Shipping.php CHANGED
@@ -4,75 +4,80 @@
4
  * @category Storm
5
  * @package Storm_Correios
6
  * @copyright Copyright (c) 2013 Willian Cordeiro de Souza
7
- * @author Willian Cordeiro de Souza <williancordeirodesouza@gmail.com>
8
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
9
  */
10
  class Storm_Correios_Model_Carrier_Shipping extends Mage_Shipping_Model_Carrier_Abstract implements Mage_Shipping_Model_Carrier_Interface
11
  {
12
  const CODE = 'correios';
13
  const PACKAGE_WEIGHT_MAX = 30;
14
-
15
  protected $_code = self::CODE;
16
  protected $_clientRequest;
17
  protected $_dimension;
18
 
19
  /**
20
  * It does the calculation and returns shipping prices and terms (if enabled)
21
- *
22
  * @param Mage_Shipping_Model_Rate_Request $request
23
  * @return boolean
24
  */
25
  public function collectRates(Mage_Shipping_Model_Rate_Request $request)
26
- {
27
- $result = Mage::getModel('shipping/rate_result');
28
-
29
- try {
30
- if (!$this->_getHelper()->isEnabled()) {
31
- return false;
32
- }
33
-
34
- if(!$this->isValid($request)) {
 
 
 
 
35
  return false;
36
  }
37
-
38
- if(!$rates = $this->_doRequest($request)) {
39
- return false;
40
- }
41
-
42
- foreach($rates as $rate) {
43
  if ($rate->hasError()) {
44
- if($this->_getHelper()->getConfigData('showmethod')) {
45
  $this->_appendError($result, sprintf('%s: %s', $this->_getMethodTitle($rate), $rate->getErrorMessage()));
46
- }
47
  continue;
48
- }
49
 
50
  $method = Mage::getModel('shipping/rate_result_method');
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
 
58
  $result->append($method);
59
  }
60
- } catch(Exception $e) {
61
  $this->_appendError($result, $e->getMessage());
62
  return $result;
63
- }
64
-
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
- *
76
  * @param Mage_Shipping_Model_Rate_Result $result
77
  * @param string $message
78
  * @return Storm_Correios_Model_Carrier_Shipping
@@ -80,63 +85,63 @@ class Storm_Correios_Model_Carrier_Shipping extends Mage_Shipping_Model_Carrier_
80
  protected function _appendError(Mage_Shipping_Model_Rate_Result &$result, $message)
81
  {
82
  $this->_getHelper()->log($message);
83
-
84
  $error = Mage::getModel('shipping/rate_result_error');
85
  $error->setCarrier($this->_code)
86
- ->setCarrierTitle($this->getConfigData('title'))
87
- ->setErrorMessage($message);
88
-
89
  $result->append($error);
90
  return $this;
91
  }
92
 
93
  /**
94
  * Assign data received request by webservice
95
- *
96
  * @param array $request
97
  * @return Storm_Correios_Model_Carrier_Shipping
98
  */
99
  public function setRequest(array $request)
100
  {
101
- $this->_request = $request;
102
- return $this;
103
  }
104
 
105
  /**
106
  * Gets the data from the webservice request
107
- *
108
  * @return array
109
  */
110
  public function getRequest()
111
  {
112
- return $this->_request;
113
  }
114
 
115
  /**
116
  * Checks if all details are correct
117
  * to perform the calculation of shipping
118
- *
119
  * @param Mage_Shipping_Model_Rate_Request $request
120
  * @return boolean
121
  */
122
  public function isValid(Mage_Shipping_Model_Rate_Request $request)
123
  {
124
- if(!extension_loaded('soap')) {
125
  throw new Mage_Shipping_Exception($this->_getHelper()->__('You must to install PHP Soap extension to use shipping method Correios.'));
126
  return false;
127
  }
128
-
129
- if (!$this->_getHelper()->isValidPostcode($request->getDestPostcode())) {
130
- throw new Mage_Shipping_Exception($this->_getHelper()->__('Please, enter the postcode correctly.'));
131
  return false;
132
- }
133
-
134
- if($request->getPackageWeight() > self::PACKAGE_WEIGHT_MAX) {
135
  throw new Mage_Shipping_Exception($this->_getHelper()->__('The package weight exceeds the weight limit.'));
136
  return false;
137
  }
138
 
139
- return true;
140
  }
141
 
142
  /**
@@ -147,72 +152,72 @@ class Storm_Correios_Model_Carrier_Shipping extends Mage_Shipping_Model_Carrier_
147
  */
148
  public function getAllowedMethods()
149
  {
150
- return array(
151
- $this->_code => $this->getConfigData('name')
152
- );
153
  }
154
 
155
  /**
156
  * Returns all methods of delivery of the module
157
  * with their respective titles
158
- *
159
  * @return array
160
  */
161
  public function getShippingMethods()
162
  {
163
- $configs = explode(',', $this->getConfigData('methods'));
164
- $methods = array();
165
- foreach ($configs as $code) {
166
- if (!$title = $this->_getHelper()->getMethodTitle($code)) {
167
- continue;
168
- }
169
 
170
- $methods[$code] = $title;
171
- }
172
 
173
- return $methods;
174
  }
175
 
176
  /**
177
  * Gets the delivery method with the lowest price
178
- *
179
  * @param Varien_Object $rates
180
  * @return Varien_Data
181
  */
182
  public function getLowerPriceMethod(Varien_Object $rates)
183
  {
184
- $bestMethod = null;
185
- foreach ($rates as $rate) {
186
- if($rate->hasError() || $rate->getPrice() <= 0) {
187
- continue;
188
- }
189
-
190
- if (is_null($bestMethod)) {
191
- $bestMethod = $rate;
192
- continue;
193
- }
194
-
195
- if ($bestMethod->getPrice() > $rate->getPrice()) {
196
- $bestMethod = $rate;
197
- }
198
- }
199
-
200
- return $bestMethod;
201
  }
202
-
203
  /**
204
  * Reports that the shipping tracking to is available
205
- *
206
  * @return boolean
207
  */
208
  public function isTrackingAvailable()
209
  {
210
  return true;
211
  }
212
-
213
  /**
214
  * Returns information from the post office tracker
215
- *
216
  * @param string $tracking
217
  * @return Mage_Shipping_Model_Tracking_Result|boolean
218
  */
@@ -220,117 +225,117 @@ class Storm_Correios_Model_Carrier_Shipping extends Mage_Shipping_Model_Carrier_
220
  {
221
  $model = Mage::getModel('correios/carrier_shipping_tracking');
222
  $model->setTrackingValue($tracking);
223
-
224
  $result = $model->request();
225
- if($result instanceof Mage_Shipping_Model_Tracking_Result){
226
- if ($trackings = $result->getAllTrackings()) {
227
  return $trackings[0];
228
  }
229
- } elseif(is_string($result) && !empty($result)) {
230
  return $result;
231
  }
232
-
233
  return false;
234
  }
235
-
236
  /**
237
  * Makes a request to the webservice of Correios
238
  * Returns the values ​​in array form
239
- *
240
  * @param Mage_Shipping_Model_Rate_Request $request
241
  * @return boolean|array
242
  */
243
  protected function _doRequest(Mage_Shipping_Model_Rate_Request $request)
244
  {
245
- /* @var $client Storm_Correios_Model_Carrier_Webservice */
246
- $client = Mage::getModel('correios/carrier_webservice');
247
- $client->setShippingRequest($request);
248
-
249
- if(!$requestData = $client->request()) {
250
- return false;
251
- }
252
-
253
- $this->_setClientRequest($requestData);
254
- return $requestData;
255
  }
256
-
257
  /**
258
  * Assign the result of the request made ​​from webservice
259
- *
260
  * @param Varien_Object $request
261
  * @return Storm_Correios_Model_Carrier_Shipping
262
  */
263
  protected function _setClientRequest(array $request)
264
  {
265
- $this->_clientRequest = $request;
266
- return $this;
267
  }
268
-
269
  /**
270
  * Gets the result of the request of the webservice
271
- *
272
  * @return Varien_Object
273
  */
274
  protected function _getClientRequest()
275
  {
276
- return $this->_clientRequest;
277
  }
278
 
279
  /**
280
  * Gets the title of the delivery method
281
  * with or without delivery
282
- *
283
  * @param Varien_Object $method
284
  * @param bool $includeDeliveryTime
285
  * @return string
286
  */
287
  protected function _getMethodTitle(Varien_Object $method, $includeDeliveryTime = false)
288
  {
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;
300
  }
301
 
302
  /**
303
  * Gets the final price of the freight
304
  * Follows the rules of free shipping
305
- *
306
  * @param Varien_Object $method
307
  * @return boolean|int|float
308
  */
309
  protected function _getFinalPrice(Varien_Object $method, Mage_Shipping_Model_Rate_Request $request)
310
  {
311
- $freeMethod = $this->getConfigData('free_shipping_method');
312
-
313
- if ($method->hasError() || $method->getPrice() <= 0) {
314
- return false;
315
- }
316
-
317
- if ($request->getFreeShipping() === true) {
318
- if ($freeMethod == 'lower-price') {
319
- if ($bestMethod = $this->getLowerPriceMethod($this->_getClientRequest())) {
320
- if ($bestMethod->getCode() == $method->getCode()) {
321
- return 0;
322
- }
323
- }
324
- }
325
-
326
- if ($freeMethod == $method->getCode()) {
327
- return 0;
328
- }
329
- }
330
-
331
  $finalPrice = $method->getPrice();
332
-
333
- if($handlingFee = $this->getConfigData('handling_fee')) {
334
  switch ($this->getConfigData('handling_type')) {
335
  case 'F':
336
  $finalPrice += $handlingFee;
@@ -340,17 +345,17 @@ class Storm_Correios_Model_Carrier_Shipping extends Mage_Shipping_Model_Carrier_
340
  break;
341
  }
342
  }
343
-
344
- return $finalPrice;
345
- }
346
-
347
  /**
348
  * Returns the Helper main module
349
- *
350
  * @return Storm_Correios_Helper_Data
351
  */
352
  protected function _getHelper()
353
  {
354
- return Mage::helper('correios');
355
  }
356
  }
4
  * @category Storm
5
  * @package Storm_Correios
6
  * @copyright Copyright (c) 2013 Willian Cordeiro de Souza
7
+ * @author Willian Cordeiro de Souza <williancordeirodesouza@gmail.com>
8
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
9
  */
10
  class Storm_Correios_Model_Carrier_Shipping extends Mage_Shipping_Model_Carrier_Abstract implements Mage_Shipping_Model_Carrier_Interface
11
  {
12
  const CODE = 'correios';
13
  const PACKAGE_WEIGHT_MAX = 30;
14
+
15
  protected $_code = self::CODE;
16
  protected $_clientRequest;
17
  protected $_dimension;
18
 
19
  /**
20
  * It does the calculation and returns shipping prices and terms (if enabled)
21
+ *
22
  * @param Mage_Shipping_Model_Rate_Request $request
23
  * @return boolean
24
  */
25
  public function collectRates(Mage_Shipping_Model_Rate_Request $request)
26
+ {
27
+ $result = Mage::getModel('shipping/rate_result');
28
+
29
+ try {
30
+ if (!$this->_getHelper()->isEnabled()) {
31
+ return false;
32
+ }
33
+
34
+ if (!$this->isValid($request)) {
35
+ return false;
36
+ }
37
+
38
+ if (!$rates = $this->_doRequest($request)) {
39
  return false;
40
  }
41
+
42
+ foreach ($rates as $rate) {
 
 
 
 
43
  if ($rate->hasError()) {
44
+ if ($this->_getHelper()->getConfigData('showmethod')) {
45
  $this->_appendError($result, sprintf('%s: %s', $this->_getMethodTitle($rate), $rate->getErrorMessage()));
46
+ }
47
  continue;
48
+ }
49
 
50
  $method = Mage::getModel('shipping/rate_result_method');
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
 
58
  $result->append($method);
59
  }
60
+ } catch (Exception $e) {
61
  $this->_appendError($result, $e->getMessage());
62
  return $result;
63
+ }
64
+
65
+ return $result;
66
  }
67
+
68
+ /**
69
+ * Check if can show delivery time to customer
70
+ *
71
+ * @return bool
72
+ */
73
  protected function _canShowDeliverytime()
74
  {
75
+ return (bool)$this->_getHelper()->getConfigData('show_deliverytime');
76
  }
77
+
78
  /**
79
  * Adds the error message in the result
80
+ *
81
  * @param Mage_Shipping_Model_Rate_Result $result
82
  * @param string $message
83
  * @return Storm_Correios_Model_Carrier_Shipping
85
  protected function _appendError(Mage_Shipping_Model_Rate_Result &$result, $message)
86
  {
87
  $this->_getHelper()->log($message);
88
+
89
  $error = Mage::getModel('shipping/rate_result_error');
90
  $error->setCarrier($this->_code)
91
+ ->setCarrierTitle($this->getConfigData('title'))
92
+ ->setErrorMessage($message);
93
+
94
  $result->append($error);
95
  return $this;
96
  }
97
 
98
  /**
99
  * Assign data received request by webservice
100
+ *
101
  * @param array $request
102
  * @return Storm_Correios_Model_Carrier_Shipping
103
  */
104
  public function setRequest(array $request)
105
  {
106
+ $this->_request = $request;
107
+ return $this;
108
  }
109
 
110
  /**
111
  * Gets the data from the webservice request
112
+ *
113
  * @return array
114
  */
115
  public function getRequest()
116
  {
117
+ return $this->_request;
118
  }
119
 
120
  /**
121
  * Checks if all details are correct
122
  * to perform the calculation of shipping
123
+ *
124
  * @param Mage_Shipping_Model_Rate_Request $request
125
  * @return boolean
126
  */
127
  public function isValid(Mage_Shipping_Model_Rate_Request $request)
128
  {
129
+ if (!extension_loaded('soap')) {
130
  throw new Mage_Shipping_Exception($this->_getHelper()->__('You must to install PHP Soap extension to use shipping method Correios.'));
131
  return false;
132
  }
133
+
134
+ if (!$this->_getHelper()->isValidPostcode($request->getDestPostcode())) {
135
+ throw new Mage_Shipping_Exception($this->_getHelper()->__('Please, enter the postcode correctly.'));
136
  return false;
137
+ }
138
+
139
+ if ($request->getPackageWeight() > self::PACKAGE_WEIGHT_MAX) {
140
  throw new Mage_Shipping_Exception($this->_getHelper()->__('The package weight exceeds the weight limit.'));
141
  return false;
142
  }
143
 
144
+ return true;
145
  }
146
 
147
  /**
152
  */
153
  public function getAllowedMethods()
154
  {
155
+ return array(
156
+ $this->_code => $this->getConfigData('name')
157
+ );
158
  }
159
 
160
  /**
161
  * Returns all methods of delivery of the module
162
  * with their respective titles
163
+ *
164
  * @return array
165
  */
166
  public function getShippingMethods()
167
  {
168
+ $configs = explode(',', $this->getConfigData('methods'));
169
+ $methods = array();
170
+ foreach ($configs as $code) {
171
+ if (!$title = $this->_getHelper()->getMethodTitle($code)) {
172
+ continue;
173
+ }
174
 
175
+ $methods[$code] = $title;
176
+ }
177
 
178
+ return $methods;
179
  }
180
 
181
  /**
182
  * Gets the delivery method with the lowest price
183
+ *
184
  * @param Varien_Object $rates
185
  * @return Varien_Data
186
  */
187
  public function getLowerPriceMethod(Varien_Object $rates)
188
  {
189
+ $bestMethod = null;
190
+ foreach ($rates as $rate) {
191
+ if ($rate->hasError() || $rate->getPrice() <= 0) {
192
+ continue;
193
+ }
194
+
195
+ if (is_null($bestMethod)) {
196
+ $bestMethod = $rate;
197
+ continue;
198
+ }
199
+
200
+ if ($bestMethod->getPrice() > $rate->getPrice()) {
201
+ $bestMethod = $rate;
202
+ }
203
+ }
204
+
205
+ return $bestMethod;
206
  }
207
+
208
  /**
209
  * Reports that the shipping tracking to is available
210
+ *
211
  * @return boolean
212
  */
213
  public function isTrackingAvailable()
214
  {
215
  return true;
216
  }
217
+
218
  /**
219
  * Returns information from the post office tracker
220
+ *
221
  * @param string $tracking
222
  * @return Mage_Shipping_Model_Tracking_Result|boolean
223
  */
225
  {
226
  $model = Mage::getModel('correios/carrier_shipping_tracking');
227
  $model->setTrackingValue($tracking);
228
+
229
  $result = $model->request();
230
+ if ($result instanceof Mage_Shipping_Model_Tracking_Result) {
231
+ if ($trackings = $result->getAllTrackings()) {
232
  return $trackings[0];
233
  }
234
+ } elseif (is_string($result) && !empty($result)) {
235
  return $result;
236
  }
237
+
238
  return false;
239
  }
240
+
241
  /**
242
  * Makes a request to the webservice of Correios
243
  * Returns the values ​​in array form
244
+ *
245
  * @param Mage_Shipping_Model_Rate_Request $request
246
  * @return boolean|array
247
  */
248
  protected function _doRequest(Mage_Shipping_Model_Rate_Request $request)
249
  {
250
+ /* @var $client Storm_Correios_Model_Carrier_Webservice */
251
+ $client = Mage::getModel('correios/carrier_webservice');
252
+ $client->setShippingRequest($request);
253
+
254
+ if (!$requestData = $client->request()) {
255
+ return false;
256
+ }
257
+
258
+ $this->_setClientRequest($requestData);
259
+ return $requestData;
260
  }
261
+
262
  /**
263
  * Assign the result of the request made ​​from webservice
264
+ *
265
  * @param Varien_Object $request
266
  * @return Storm_Correios_Model_Carrier_Shipping
267
  */
268
  protected function _setClientRequest(array $request)
269
  {
270
+ $this->_clientRequest = $request;
271
+ return $this;
272
  }
273
+
274
  /**
275
  * Gets the result of the request of the webservice
276
+ *
277
  * @return Varien_Object
278
  */
279
  protected function _getClientRequest()
280
  {
281
+ return $this->_clientRequest;
282
  }
283
 
284
  /**
285
  * Gets the title of the delivery method
286
  * with or without delivery
287
+ *
288
  * @param Varien_Object $method
289
  * @param bool $includeDeliveryTime
290
  * @return string
291
  */
292
  protected function _getMethodTitle(Varien_Object $method, $includeDeliveryTime = false)
293
  {
294
+ $title = $this->_getHelper()->getMethodTitle($method->getCode());
295
 
296
+ if ($includeDeliveryTime) {
297
+ if ($method->getDeliveryTime() > 1) {
298
  return $this->_getHelper()->__('%s (%d working days)', $title, $method->getDeliveryTime());
299
  } else {
300
+ return $this->_getHelper()->__('%s (%d working day)', $title, $method->getDeliveryTime());
301
  }
302
+ }
303
 
304
+ return $title;
305
  }
306
 
307
  /**
308
  * Gets the final price of the freight
309
  * Follows the rules of free shipping
310
+ *
311
  * @param Varien_Object $method
312
  * @return boolean|int|float
313
  */
314
  protected function _getFinalPrice(Varien_Object $method, Mage_Shipping_Model_Rate_Request $request)
315
  {
316
+ $freeMethod = $this->getConfigData('free_shipping_method');
317
+
318
+ if ($method->hasError() || $method->getPrice() <= 0) {
319
+ return false;
320
+ }
321
+
322
+ if ($request->getFreeShipping() === true) {
323
+ if ($freeMethod == 'lower-price') {
324
+ if ($bestMethod = $this->getLowerPriceMethod($this->_getClientRequest())) {
325
+ if ($bestMethod->getCode() == $method->getCode()) {
326
+ return 0;
327
+ }
328
+ }
329
+ }
330
+
331
+ if ($freeMethod == $method->getCode()) {
332
+ return 0;
333
+ }
334
+ }
335
+
336
  $finalPrice = $method->getPrice();
337
+
338
+ if ($handlingFee = $this->getConfigData('handling_fee')) {
339
  switch ($this->getConfigData('handling_type')) {
340
  case 'F':
341
  $finalPrice += $handlingFee;
345
  break;
346
  }
347
  }
348
+
349
+ return $finalPrice;
350
+ }
351
+
352
  /**
353
  * Returns the Helper main module
354
+ *
355
  * @return Storm_Correios_Helper_Data
356
  */
357
  protected function _getHelper()
358
  {
359
+ return Mage::helper('correios');
360
  }
361
  }
app/code/community/Storm/Correios/Model/Carrier/Shipping/Tracking.php CHANGED
File without changes
app/code/community/Storm/Correios/Model/Carrier/Webservice.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  /**
3
  * @category Storm
4
  * @package Storm_Correios
@@ -29,14 +30,14 @@ class Storm_Correios_Model_Carrier_Webservice
29
  )
30
  ));
31
 
32
- if(!$this->_getHelper()->getConfigData('shipping_methods')) {
33
  throw new Exception($this->_getHelper()->__('You must to select some shipping method.'));
34
  }
35
 
36
  $this->setParam('nCdEmpresa', $this->_getHelper()->getConfigData('account_code'))
37
- ->setParam('sDsSenha', $this->_getHelper()->getConfigData('account_password'))
38
- ->setParam('nCdServico', $this->_getHelper()->getConfigData('shipping_methods'))
39
- ->setParam('sCepOrigem', Mage::getStoreConfig('shipping/origin/postcode'));
40
  }
41
 
42
  /**
@@ -47,7 +48,7 @@ class Storm_Correios_Model_Carrier_Webservice
47
  */
48
  public function getClient()
49
  {
50
- return $this->_client;
51
  }
52
 
53
  /**
@@ -60,8 +61,8 @@ class Storm_Correios_Model_Carrier_Webservice
60
  */
61
  public function setParam($name, $value)
62
  {
63
- $this->_params[$name] = $value;
64
- return $this;
65
  }
66
 
67
  /**
@@ -71,7 +72,7 @@ class Storm_Correios_Model_Carrier_Webservice
71
  */
72
  public function getParams()
73
  {
74
- return $this->_params;
75
  }
76
 
77
  /**
@@ -82,11 +83,11 @@ class Storm_Correios_Model_Carrier_Webservice
82
  */
83
  public function getParam($key)
84
  {
85
- if (isset($this->_params[$key])) {
86
- return $this->_params[$key];
87
- }
88
 
89
- return false;
90
  }
91
 
92
  /**
@@ -97,26 +98,26 @@ class Storm_Correios_Model_Carrier_Webservice
97
  */
98
  public function setShippingRequest(Mage_Shipping_Model_Rate_Request $request)
99
  {
100
- $dimension = Mage::getModel('correios/carrier_package_dimension');
101
- $dimension->setRequest($request);
102
-
103
- $this->setParam('sCepDestino', $request->getDestPostcode())
104
- ->setParam('nVlPeso', $request->getPackageWeight())
105
- ->setParam('nCdFormato', 1)
106
- ->setParam('nVlComprimento', $dimension->getLength())
107
- ->setParam('nVlAltura', $dimension->getHeight())
108
- ->setParam('nVlLargura', $dimension->getWidth())
109
- ->setParam('nVlDiametro', 0)
110
- ->setParam('sCdMaoPropria', $this->_getHelper()->getConfigData('own_hands') ? 'S' : 'N')
111
- ->setParam('nVlValorDeclarado', 0)
112
- ->setParam('sCdAvisoRecebimento', $this->_getHelper()->getConfigData('receipt_warning') ? 'S' : 'N');
113
-
114
- if($this->_getHelper()->getConfigData('stated_value')) {
115
  $this->setParam('nVlValorDeclarado', $request->getPackageValue());
116
  }
117
 
118
- $this->_request = $request;
119
- return $this;
120
  }
121
 
122
  /**
@@ -126,7 +127,7 @@ class Storm_Correios_Model_Carrier_Webservice
126
  */
127
  public function getShippingRequest()
128
  {
129
- return $this->_request;
130
  }
131
 
132
  /**
@@ -136,35 +137,35 @@ class Storm_Correios_Model_Carrier_Webservice
136
  */
137
  public function request()
138
  {
139
- if(!$request = $this->getClient()->CalcPrecoPrazo($this->getParams())) {
140
- return false;
141
- }
142
 
143
- if(!$request = $request->CalcPrecoPrazoResult) {
144
- return false;
145
- }
146
 
147
- if(!$request = $request->Servicos) {
148
- return false;
149
- }
150
 
151
- if(!$request = $request->cServico) {
152
- return false;
153
- }
154
 
155
  $result = array();
156
 
157
- if(is_array($request)) {
158
- foreach($request as $methodData) {
159
  $result[] = $this->_convertWebserviceValues($methodData);
160
  }
161
- } elseif(isset($request->Codigo)) {
162
  $result[] = $this->_convertWebserviceValues($request);
163
  } else {
164
  throw new Exception(Mage::helper('correios')->__('Cannot be possible to estimate shipping from Correios.'));
165
  }
166
 
167
- return $result;
168
  }
169
 
170
  /**
@@ -174,7 +175,7 @@ class Storm_Correios_Model_Carrier_Webservice
174
  */
175
  protected function _getHelper()
176
  {
177
- return Mage::helper('correios');
178
  }
179
 
180
  /**
@@ -186,20 +187,20 @@ class Storm_Correios_Model_Carrier_Webservice
186
  */
187
  private function _convertWebserviceValues(stdClass $data)
188
  {
189
- $result = new Varien_Object();
190
- $result->setCode($data->Codigo);
191
 
192
- if($data->Erro != 0) {
193
  $result->setError($data->Erro)
194
- ->setErrorMessage($data->MsgErro);
195
 
196
  return $result;
197
  }
198
 
199
- $result->setPrice($this->_getHelper()->convertToFloat($data->Valor))
200
- ->setDeliveryTime($data->PrazoEntrega + intval($this->_getHelper()->getConfigData('add_delivery_time')))
201
- ->setHomeDelivery($data->EntregaDomiciliar == 'S' ? true : false)
202
- ->setSaturdayDelivery($data->EntregaSabado == 'S' ? true : false);
203
 
204
  return $result;
205
  }
1
  <?php
2
+
3
  /**
4
  * @category Storm
5
  * @package Storm_Correios
30
  )
31
  ));
32
 
33
+ if (!$this->_getHelper()->getConfigData('shipping_methods')) {
34
  throw new Exception($this->_getHelper()->__('You must to select some shipping method.'));
35
  }
36
 
37
  $this->setParam('nCdEmpresa', $this->_getHelper()->getConfigData('account_code'))
38
+ ->setParam('sDsSenha', $this->_getHelper()->getConfigData('account_password'))
39
+ ->setParam('nCdServico', $this->_getHelper()->getConfigData('shipping_methods'))
40
+ ->setParam('sCepOrigem', Mage::getStoreConfig('shipping/origin/postcode'));
41
  }
42
 
43
  /**
48
  */
49
  public function getClient()
50
  {
51
+ return $this->_client;
52
  }
53
 
54
  /**
61
  */
62
  public function setParam($name, $value)
63
  {
64
+ $this->_params[$name] = $value;
65
+ return $this;
66
  }
67
 
68
  /**
72
  */
73
  public function getParams()
74
  {
75
+ return $this->_params;
76
  }
77
 
78
  /**
83
  */
84
  public function getParam($key)
85
  {
86
+ if (isset($this->_params[$key])) {
87
+ return $this->_params[$key];
88
+ }
89
 
90
+ return false;
91
  }
92
 
93
  /**
98
  */
99
  public function setShippingRequest(Mage_Shipping_Model_Rate_Request $request)
100
  {
101
+ $dimension = Mage::getModel('correios/carrier_package_dimension');
102
+ $dimension->setRequest($request);
103
+
104
+ $this->setParam('sCepDestino', $request->getDestPostcode())
105
+ ->setParam('nVlPeso', $request->getPackageWeight())
106
+ ->setParam('nCdFormato', 1)
107
+ ->setParam('nVlComprimento', $dimension->getLength())
108
+ ->setParam('nVlAltura', $dimension->getHeight())
109
+ ->setParam('nVlLargura', $dimension->getWidth())
110
+ ->setParam('nVlDiametro', 0)
111
+ ->setParam('sCdMaoPropria', $this->_getHelper()->getConfigData('own_hands') ? 'S' : 'N')
112
+ ->setParam('nVlValorDeclarado', 0)
113
+ ->setParam('sCdAvisoRecebimento', $this->_getHelper()->getConfigData('receipt_warning') ? 'S' : 'N');
114
+
115
+ if ($this->_getHelper()->getConfigData('stated_value')) {
116
  $this->setParam('nVlValorDeclarado', $request->getPackageValue());
117
  }
118
 
119
+ $this->_request = $request;
120
+ return $this;
121
  }
122
 
123
  /**
127
  */
128
  public function getShippingRequest()
129
  {
130
+ return $this->_request;
131
  }
132
 
133
  /**
137
  */
138
  public function request()
139
  {
140
+ if (!$request = $this->getClient()->CalcPrecoPrazo($this->getParams())) {
141
+ return false;
142
+ }
143
 
144
+ if (!$request = $request->CalcPrecoPrazoResult) {
145
+ return false;
146
+ }
147
 
148
+ if (!$request = $request->Servicos) {
149
+ return false;
150
+ }
151
 
152
+ if (!$request = $request->cServico) {
153
+ return false;
154
+ }
155
 
156
  $result = array();
157
 
158
+ if (is_array($request)) {
159
+ foreach ($request as $methodData) {
160
  $result[] = $this->_convertWebserviceValues($methodData);
161
  }
162
+ } elseif (isset($request->Codigo)) {
163
  $result[] = $this->_convertWebserviceValues($request);
164
  } else {
165
  throw new Exception(Mage::helper('correios')->__('Cannot be possible to estimate shipping from Correios.'));
166
  }
167
 
168
+ return $result;
169
  }
170
 
171
  /**
175
  */
176
  protected function _getHelper()
177
  {
178
+ return Mage::helper('correios');
179
  }
180
 
181
  /**
187
  */
188
  private function _convertWebserviceValues(stdClass $data)
189
  {
190
+ $result = new Varien_Object();
191
+ $result->setCode($data->Codigo);
192
 
193
+ if ($data->Erro != 0) {
194
  $result->setError($data->Erro)
195
+ ->setErrorMessage($data->MsgErro);
196
 
197
  return $result;
198
  }
199
 
200
+ $result->setPrice($this->_getHelper()->convertToFloat($data->Valor))
201
+ ->setDeliveryTime($data->PrazoEntrega + intval($this->_getHelper()->getConfigData('add_delivery_time')))
202
+ ->setHomeDelivery($data->EntregaDomiciliar == 'S' ? true : false)
203
+ ->setSaturdayDelivery($data->EntregaSabado == 'S' ? true : false);
204
 
205
  return $result;
206
  }
app/code/community/Storm/Correios/Model/Catalog/Resource/Setup.php CHANGED
File without changes
app/code/community/Storm/Correios/Model/Source/FreeMethods.php CHANGED
File without changes
app/code/community/Storm/Correios/Model/Source/Methods.php CHANGED
File without changes
app/code/community/Storm/Correios/etc/config.xml CHANGED
File without changes
app/code/community/Storm/Correios/etc/system.xml CHANGED
File without changes
app/code/community/Storm/Correios/sql/correios_setup/mysql4-install-0.1.0.php CHANGED
File without changes
app/etc/modules/Storm_Correios.xml CHANGED
File without changes
app/locale/pt_BR/Storm_Correios.csv CHANGED
@@ -1,4 +1,4 @@
1
- "Without contract","Sem contrato"
2
  "With contract","Com contrato"
3
  "Shipping methods","Métodos de entrega"
4
  "Others","Outros"
1
+ "Without contract","Sem contrato"
2
  "With contract","Com contrato"
3
  "Shipping methods","Métodos de entrega"
4
  "Others","Outros"
package.xml CHANGED
@@ -1,31 +1,30 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>correios</name>
4
- <version>1.3.3</version>
5
  <stability>stable</stability>
6
  <license>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.&#xD;
11
- As seguintes fun&#xE7;&#xF5;es est&#xE3;o dispon&#xED;ves:&#xD;
12
- &#xD;
13
- * Entrega com Sedex, Sedex a cobrar, Sedex 10, Sedex hoje, Pac, e-Sedex, e-Sedex priorit&#xE1;rio e e-Sedex express.&#xD;
14
- * Configura&#xE7;&#xF5;es para comerciantes com contrato com os Correios com pre&#xE7;o diferenciado.&#xD;
15
- * Rastreador de objeto em tempo real.&#xD;
16
- * Escolha do m&#xE9;todo de frete gr&#xE1;tis inteligente ( segue regras de promo&#xE7;&#xE3;o ).&#xD;
17
- * Possibilidade de adicionar dias ao prazo de entrega.&#xD;
18
- * Possibilidade de adicionar taxa de manuseio fixa ou percentual.&#xD;
19
- * Configura&#xE7;&#xE3;o e instala&#xE7;&#xE3;o f&#xE1;cil e intu&#xED;tiva.&#xD;
20
- &#xD;
 
21
  This module is available only to Brazil.</description>
22
- <notes>- Exibi&#xE7;&#xE3;o de alerta ao n&#xE3;o selecionar nenhum m&#xE9;todo de entrega.&#xD;
23
- - M&#xE9;todo de entrega padr&#xE3;o selecionados na instala&#xE7;&#xE3;o do m&#xF3;dulo&#xD;
24
- </notes>
25
  <authors><author><name>Willian</name><user>willsouza</user><email>williancordeirodesouza@gmail.com</email></author></authors>
26
- <date>2014-01-22</date>
27
- <time>23:36:45</time>
28
- <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="801b6e31dd5b6e33de4f5db4fa65714b"/></dir><dir name="Carrier"><dir name="Package"><file name="Dimension.php" hash="88d12d19a36e753c94f30c08431e9c45"/></dir><dir name="Shipping"><file name="Tracking.php" hash="97c09a03c9bc77ded9e01099887ecb67"/></dir><file name="Shipping.php" hash="e8d22369e1d5e185585684774711776b"/><file name="Webservice.php" hash="d876bf2bf01ef22319f79c57a5dabd8d"/></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="e781224a3dbd9007877e4ab0f710bc0d"/><file name="system.xml" hash="7fc9af5f08e42d25f0fad5b93a1694da"/></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="a538e33954855283dd4ca3c83ffeb4ea"/></dir></target><target name="mageetc"><dir name="modules"><file name="Storm_Correios.xml" hash="93aa3a9938657131b77fa2a2e60abd71"/></dir></target></contents>
29
  <compatible/>
30
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
31
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>correios</name>
4
+ <version>1.3.4</version>
5
  <stability>stable</stability>
6
  <license>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>* Corre&#xE7;&#xE3;o no c&#xE1;lculo de dimens&#xE3;o dos produtos</notes>
 
 
24
  <authors><author><name>Willian</name><user>willsouza</user><email>williancordeirodesouza@gmail.com</email></author></authors>
25
+ <date>2014-05-02</date>
26
+ <time>23:24:14</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="200870678c607ae75bef43f7f5d19569"/></dir><dir name="Carrier"><dir name="Package"><file name="Dimension.php" hash="5e835a94891276aee3286c87668ae957"/></dir><dir name="Shipping"><file name="Tracking.php" hash="97c09a03c9bc77ded9e01099887ecb67"/></dir><file name="Shipping.php" hash="148978df8ff1c28c1769cf7734818800"/><file name="Webservice.php" hash="6223f35a2722f22d15386b2b84237528"/></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="e781224a3dbd9007877e4ab0f710bc0d"/><file name="system.xml" hash="7fc9af5f08e42d25f0fad5b93a1694da"/></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="mageetc"><dir name="modules"><file name="Storm_Correios.xml" hash="93aa3a9938657131b77fa2a2e60abd71"/></dir></target><target name="magelocale"><dir name="pt_BR"><file name="Storm_Correios.csv" hash="a6f14dd49a4de226a70939c093cd0755"/></dir></target></contents>
28
  <compatible/>
29
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
30
  </package>