Shipping_Nacex - Version 1.0.7

Version Notes

* Corrige el mensaje de error cuando el paquete tenia un valor de 0 (cero)

CHANGES:
->U app/code/community/Nacex/Shipping/Model/Carrier/Spainpost.php

Download this release

Release Info

Developer Magento Core Team
Extension Shipping_Nacex
Version 1.0.7
Comparing to
See all releases


Code changes from version 1.0.6 to 1.0.7

app/code/community/Nacex/Shipping/Model/Carrier/Spainpost.php CHANGED
@@ -49,12 +49,12 @@ class Nacex_Shipping_Model_Carrier_Spainpost extends Mage_Shipping_Model_Carrier
49
  $origCountry = Mage::getStoreConfig('shipping/origin/country_id', $this->getStore());
50
  $result = Mage::getModel('shipping/rate_result');
51
 
 
52
  if ($origCountry != "ES") {
53
  if($this->getConfigData('showmethod')){
54
- $error = Mage::getModel('shipping/rate_result_error');
55
- $error->setCarrier('spainpost');
56
- $error->setCarrierTitle($this->getConfigData('title'));
57
- $error->setErrorMessage($this->getConfigData('specificerrmsg'));
58
  $result->append($error);
59
  return $result;
60
  } else {
@@ -66,18 +66,28 @@ class Nacex_Shipping_Model_Carrier_Spainpost extends Mage_Shipping_Model_Carrier
66
  $packagevalue = $request->getBaseCurrency()->convert($request->getPackageValue(), $request->getPackageCurrency());
67
  $minorderval = (int)$this->getConfigData('min_order_value');
68
  $maxorderval = (int)$this->getConfigData('max_order_value');
69
- if($packagevalue <= $minorderval || (($maxorderval != '0') && $packagevalue >= $maxorderval)){
 
 
 
 
70
  if($this->getConfigData('showmethod')){
71
- $error = Mage::getModel('shipping/rate_result_error');
72
- $error->setCarrier('spainpost');
73
- $error->setCarrierTitle($this->getConfigData('title'));
74
  $currency = Mage::getStoreConfig(Mage_Directory_Model_Currency::XML_PATH_CURRENCY_BASE);
75
- $error->setErrorMessage(
76
- Mage::helper('nacex')->__('Package value should be between %s and %s',
77
- Mage::app()->getStore()->formatPrice($minorderval),
 
 
 
78
  Mage::app()->getStore()->formatPrice($maxorderval)
79
- )
80
- );
 
 
 
 
81
  $result->append($error);
82
  return $result;
83
  } else {
49
  $origCountry = Mage::getStoreConfig('shipping/origin/country_id', $this->getStore());
50
  $result = Mage::getModel('shipping/rate_result');
51
 
52
+ $error = Mage::getModel('shipping/rate_result_error');
53
  if ($origCountry != "ES") {
54
  if($this->getConfigData('showmethod')){
55
+ $error->setCarrier('spainpost')
56
+ ->setCarrierTitle($this->getConfigData('title'))
57
+ ->setErrorMessage($this->getConfigData('specificerrmsg'));
 
58
  $result->append($error);
59
  return $result;
60
  } else {
66
  $packagevalue = $request->getBaseCurrency()->convert($request->getPackageValue(), $request->getPackageCurrency());
67
  $minorderval = (int)$this->getConfigData('min_order_value');
68
  $maxorderval = (int)$this->getConfigData('max_order_value');
69
+ if(
70
+ /* EL PAQUETE ES MENOR O IGUAL AL MINIMO Y EL MINIMO ESTA HABILITADO*/
71
+ ($packagevalue <= $minorderval) && ($minorderval > 0) ||
72
+ /* EL PAQUETE ES MAYOR O IGUAL AL MAXIMO Y EL MAXIMO ESTA HABILITADO*/
73
+ (($maxorderval != 0) && ($packagevalue >= $maxorderval))){
74
  if($this->getConfigData('showmethod')){
75
+ $error->setCarrier('spainpost')
76
+ ->setCarrierTitle($this->getConfigData('title'));
 
77
  $currency = Mage::getStoreConfig(Mage_Directory_Model_Currency::XML_PATH_CURRENCY_BASE);
78
+ /* SI EL MINIMO Y EL MAXIMO ESTA HABILITADO*/
79
+ if($minorderval != 0 && $maxorderval != 0){
80
+ $errorMsg=Mage::helper('nacex')->__('Package value must be between %s and %s',Mage::app()->getStore()->formatPrice($minorderval),Mage::app()->getStore()->formatPrice($maxorderval));
81
+ /* SI EL MAXIMO ESTA HABILITADO*/
82
+ }elseif($maxorderval != 0){
83
+ $errorMsg=Mage::helper('nacex')->__('Package value must be less than %s',
84
  Mage::app()->getStore()->formatPrice($maxorderval)
85
+ );
86
+ /* SI EL MINIMO ESTA HABILITADO*/
87
+ }else{
88
+ $errorMsg=Mage::helper('nacex')->__('Package value must be higher than %s',Mage::app()->getStore()->formatPrice($minorderval));
89
+ }
90
+ $error->setErrorMessage($errorMsg);
91
  $result->append($error);
92
  return $result;
93
  } else {
app/code/community/Nacex/Shipping/etc/config.xml CHANGED
@@ -58,6 +58,7 @@
58
  <max_order_value>0</max_order_value>
59
  <weight_units>1</weight_units>
60
  <handling_fee>0</handling_fee>
 
61
  <specificerrmsg>This shipping method is currently unavailable. If you would like to ship using this shipping method, please contact us.</specificerrmsg>
62
  </spainpost>
63
  </carriers>
58
  <max_order_value>0</max_order_value>
59
  <weight_units>1</weight_units>
60
  <handling_fee>0</handling_fee>
61
+ <allowed_methods>NAXJOW,NAXGAB</allowed_methods>
62
  <specificerrmsg>This shipping method is currently unavailable. If you would like to ship using this shipping method, please contact us.</specificerrmsg>
63
  </spainpost>
64
  </carriers>
package.xml CHANGED
@@ -1,26 +1,21 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Shipping_Nacex</name>
4
- <version>1.0.6</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Metodo de envio para nacex</summary>
10
  <description>Metodo de envio para nacex</description>
11
- <notes>* Agrega la posibilidad de tomar un envio de ida y vuelta cobrando los dos.
12
 
13
  &lt;b&gt;CHANGES:&lt;/b&gt;
14
- -&gt;A app/code/community/Nacex/Shipping/Model/Methods.php
15
- -&gt;U app/code/community/Nacex/Shipping/etc/config.xml
16
- -&gt;U app/code/community/Nacex/Shipping/etc/system.xml
17
- -&gt;U app/code/community/Nacex/Shipping/Helper/Data.php
18
- -&gt;U app/code/community/Nacex/Shipping/Model/Carrier/Spainpost.php
19
- -&gt;U app/code/community/Nacex/Shipping/Model/Weightunits.php</notes>
20
  <authors><author><name>Manuel</name><user>auto-converted</user><email>manuelcanepa@gmail.com</email></author><author><name>Sophie</name><user>auto-converted</user><email>lalyostres@gmail.com</email></author></authors>
21
- <date>2008-12-11</date>
22
- <time>13:30:21</time>
23
- <contents><target name="mageetc"><dir name="modules"><file name="Nacex_Shipping.xml" hash="74bdf7f9847df2280af2666d8123d95b"/></dir></target><target name="magecommunity"><dir name="Nacex"><dir name="Shipping"><dir name="etc"><file name="config.xml" hash="2589b183cb670e7d08251bc7a986f2e1"/><file name="system.xml" hash="aa15dac5d59e960906c275aac8ba9957"/></dir><dir name="Helper"><file name="Data.php" hash="8b06d6514b9924564f9078dd15cedc00"/></dir><dir name="Model"><dir name="Carrier"><file name="Spainpost.php" hash="a9d2f1c85f0ab949b5d8300589dc301d"/></dir><file name="Methods.php" hash="0f44afc2f0faa9e6f5a22be7ee3f69c8"/><file name="Weightunits.php" hash="9cecbb70f7db3e1fcd84ec39060f1581"/></dir><dir name="sql"><dir name="shipping_setup"><file name="mysql4-install-0.1.0.php" hash="d614fdc964125e1ff642933cc8014583"/></dir></dir></dir></dir></target></contents>
24
  <compatible/>
25
  <dependencies/>
26
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Shipping_Nacex</name>
4
+ <version>1.0.7</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Metodo de envio para nacex</summary>
10
  <description>Metodo de envio para nacex</description>
11
+ <notes>* Corrige el mensaje de error cuando el paquete tenia un valor de 0 (cero)
12
 
13
  &lt;b&gt;CHANGES:&lt;/b&gt;
14
+ -&gt;U app/code/community/Nacex/Shipping/Model/Carrier/Spainpost.php</notes>
 
 
 
 
 
15
  <authors><author><name>Manuel</name><user>auto-converted</user><email>manuelcanepa@gmail.com</email></author><author><name>Sophie</name><user>auto-converted</user><email>lalyostres@gmail.com</email></author></authors>
16
+ <date>2008-12-15</date>
17
+ <time>12:29:55</time>
18
+ <contents><target name="mageetc"><dir name="modules"><file name="Nacex_Shipping.xml" hash="74bdf7f9847df2280af2666d8123d95b"/></dir></target><target name="magecommunity"><dir name="Nacex"><dir name="Shipping"><dir name="etc"><file name="config.xml" hash="228d8168d010bc7b6162ad40deaf7560"/><file name="system.xml" hash="aa15dac5d59e960906c275aac8ba9957"/></dir><dir name="Helper"><file name="Data.php" hash="8b06d6514b9924564f9078dd15cedc00"/></dir><dir name="Model"><dir name="Carrier"><file name="Spainpost.php" hash="5a9d0fc5c0d8fe382c2eb887164ab7e6"/></dir><file name="Methods.php" hash="0f44afc2f0faa9e6f5a22be7ee3f69c8"/><file name="Weightunits.php" hash="9cecbb70f7db3e1fcd84ec39060f1581"/></dir><dir name="sql"><dir name="shipping_setup"><file name="mysql4-install-0.1.0.php" hash="d614fdc964125e1ff642933cc8014583"/></dir></dir></dir></dir></target></contents>
19
  <compatible/>
20
  <dependencies/>
21
  </package>