Version Notes
* Arregla la tabla de precios
* Agrega un campo en la configuracion para agregar algun costo fijo
CHANGES:
->U app/code/community/Nacex/Shipping/Model/Carrier/Naxgab.php
->U app/code/community/Nacex/Shipping/Model/Carrier/Naxjow.php
->U app/code/community/Nacex/Shipping/Model/Standard/Data.php
->U app/code/community/Nacex/Shipping/etc/system.xml
->U app/code/community/Nacex/Shipping/etc/config.xml
Download this release
Release Info
Developer | Magento Core Team |
Extension | Shipping_Nacex |
Version | 1.0.12 |
Comparing to | |
See all releases |
Code changes from version 1.0.11 to 1.0.12
- app/code/community/Nacex/Shipping/Model/Carrier/Naxgab.php +7 -3
- app/code/community/Nacex/Shipping/Model/Carrier/Naxjow.php +7 -3
- app/code/community/Nacex/Shipping/Model/Standard/Data.php +8 -13
- app/code/community/Nacex/Shipping/etc/config.xml +2 -0
- app/code/community/Nacex/Shipping/etc/system.xml +16 -0
- package.xml +11 -6
app/code/community/Nacex/Shipping/Model/Carrier/Naxgab.php
CHANGED
@@ -96,12 +96,14 @@ class Nacex_Shipping_Model_Carrier_Naxgab extends Mage_Shipping_Model_Carrier_Ab
|
|
96 |
if($destCountry == "ES") {
|
97 |
try {
|
98 |
$this->_servicio = Mage::getSingleton('nacex/standard_data')->setServicio($this->_frompcode,$this->_topcode);
|
99 |
-
$_params = array(
|
|
|
|
|
|
|
|
|
100 |
$datosPrecio = Mage::getSingleton('nacex/standard_data')->getPrecio($_params);
|
101 |
$shippingPrice = $datosPrecio['price'];
|
102 |
// set the handling fee type....
|
103 |
-
$calculateHandlingFee = $this->getConfigData('handling_type');
|
104 |
-
$handlingFee = $this->getConfigData('handling_fee');
|
105 |
if ($this->getConfigData('handling_type') == 'F') {
|
106 |
$shippingPrice += $this->getConfigData('handling_fee');
|
107 |
} else {
|
@@ -109,6 +111,8 @@ class Nacex_Shipping_Model_Carrier_Naxgab extends Mage_Shipping_Model_Carrier_Ab
|
|
109 |
$shippingPrice += $handlingFee;
|
110 |
}
|
111 |
|
|
|
|
|
112 |
$rate = Mage::getModel('shipping/rate_result_method');
|
113 |
$rate->setCarrier($this->_code);
|
114 |
$rate->setCarrierTitle($this->getConfigData('title'));
|
96 |
if($destCountry == "ES") {
|
97 |
try {
|
98 |
$this->_servicio = Mage::getSingleton('nacex/standard_data')->setServicio($this->_frompcode,$this->_topcode);
|
99 |
+
$_params = array(
|
100 |
+
'servicio'=>$this->_servicio,
|
101 |
+
'sweight'=>$this->_sweight,
|
102 |
+
'code'=>$this->_code
|
103 |
+
);
|
104 |
$datosPrecio = Mage::getSingleton('nacex/standard_data')->getPrecio($_params);
|
105 |
$shippingPrice = $datosPrecio['price'];
|
106 |
// set the handling fee type....
|
|
|
|
|
107 |
if ($this->getConfigData('handling_type') == 'F') {
|
108 |
$shippingPrice += $this->getConfigData('handling_fee');
|
109 |
} else {
|
111 |
$shippingPrice += $handlingFee;
|
112 |
}
|
113 |
|
114 |
+
$shippingPrice += $this->getConfigData('xtra');
|
115 |
+
|
116 |
$rate = Mage::getModel('shipping/rate_result_method');
|
117 |
$rate->setCarrier($this->_code);
|
118 |
$rate->setCarrierTitle($this->getConfigData('title'));
|
app/code/community/Nacex/Shipping/Model/Carrier/Naxjow.php
CHANGED
@@ -96,12 +96,14 @@ class Nacex_Shipping_Model_Carrier_Naxjow extends Mage_Shipping_Model_Carrier_Ab
|
|
96 |
if($destCountry == "ES") {
|
97 |
try {
|
98 |
$this->_servicio = Mage::getSingleton('nacex/standard_data')->setServicio($this->_frompcode,$this->_topcode);
|
99 |
-
$_params = array(
|
|
|
|
|
|
|
|
|
100 |
$datosPrecio = Mage::getSingleton('nacex/standard_data')->getPrecio($_params);
|
101 |
$shippingPrice = $datosPrecio['price'];
|
102 |
// set the handling fee type....
|
103 |
-
$calculateHandlingFee = $this->getConfigData('handling_type');
|
104 |
-
$handlingFee = $this->getConfigData('handling_fee');
|
105 |
if ($this->getConfigData('handling_type') == 'F') {
|
106 |
$shippingPrice += $this->getConfigData('handling_fee');
|
107 |
} else {
|
@@ -109,6 +111,8 @@ class Nacex_Shipping_Model_Carrier_Naxjow extends Mage_Shipping_Model_Carrier_Ab
|
|
109 |
$shippingPrice += $handlingFee;
|
110 |
}
|
111 |
|
|
|
|
|
112 |
$rate = Mage::getModel('shipping/rate_result_method');
|
113 |
$rate->setCarrier($this->_code);
|
114 |
$rate->setCarrierTitle($this->getConfigData('title'));
|
96 |
if($destCountry == "ES") {
|
97 |
try {
|
98 |
$this->_servicio = Mage::getSingleton('nacex/standard_data')->setServicio($this->_frompcode,$this->_topcode);
|
99 |
+
$_params = array(
|
100 |
+
'servicio'=>$this->_servicio,
|
101 |
+
'sweight'=>$this->_sweight,
|
102 |
+
'code'=>$this->_code
|
103 |
+
);
|
104 |
$datosPrecio = Mage::getSingleton('nacex/standard_data')->getPrecio($_params);
|
105 |
$shippingPrice = $datosPrecio['price'];
|
106 |
// set the handling fee type....
|
|
|
|
|
107 |
if ($this->getConfigData('handling_type') == 'F') {
|
108 |
$shippingPrice += $this->getConfigData('handling_fee');
|
109 |
} else {
|
111 |
$shippingPrice += $handlingFee;
|
112 |
}
|
113 |
|
114 |
+
$shippingPrice += $this->getConfigData('xtra');
|
115 |
+
|
116 |
$rate = Mage::getModel('shipping/rate_result_method');
|
117 |
$rate->setCarrier($this->_code);
|
118 |
$rate->setCarrierTitle($this->getConfigData('title'));
|
app/code/community/Nacex/Shipping/Model/Standard/Data.php
CHANGED
@@ -26,10 +26,9 @@ class Nacex_Shipping_Model_Standard_Data {
|
|
26 |
*/
|
27 |
public function setServicio($_frompcode,$_topcode){
|
28 |
$code_store = substr($_frompcode,0,2);
|
|
|
29 |
$servicio = '';
|
30 |
-
|
31 |
-
// PARA LA TIENDA EN BALEARES
|
32 |
-
case '07':
|
33 |
if($this->getRegion($code_store,$_topcode)){
|
34 |
// PRECIO INTRAISLAS
|
35 |
return 'INTRAISLAS';
|
@@ -37,14 +36,13 @@ class Nacex_Shipping_Model_Standard_Data {
|
|
37 |
// PRECIO NACIONAL PARA TODA ESPA�A
|
38 |
return 'NACIONAL_BALEARES';
|
39 |
}
|
40 |
-
|
41 |
// PARA LA TIENDA EN EL RESTO DE ESPA�A
|
42 |
-
|
43 |
-
if($_frompcode == $_topcode){
|
44 |
// PRECIO PROVINCIAL
|
45 |
return 'PROVINCIAL';
|
46 |
} else {
|
47 |
-
$id_region = $this->getRegion($_topcode,$
|
48 |
if($id_region == true){
|
49 |
// PRECIO REGIONAL PARA PROVINCIAS DE LA MISMA REGION
|
50 |
return 'REGIONAL';
|
@@ -53,7 +51,6 @@ class Nacex_Shipping_Model_Standard_Data {
|
|
53 |
return 'NACIONAL';
|
54 |
}
|
55 |
}
|
56 |
-
break;
|
57 |
}
|
58 |
}
|
59 |
|
@@ -111,11 +108,11 @@ class Nacex_Shipping_Model_Standard_Data {
|
|
111 |
$params['shipping_method'] = 'BAG';
|
112 |
$params['price'] = 7.11;
|
113 |
} elseif(($sweight > '2000') && ($sweight <='5000')){
|
114 |
-
$params['price'] =
|
115 |
} elseif(($sweight > '5000') && ($sweight <='10000')){
|
116 |
-
$params['price'] =
|
117 |
} else {
|
118 |
-
$params['price'] =
|
119 |
$peso=$sweight - 10000;
|
120 |
$params['price'] += (ceil($peso / 5000)) * 3.62;
|
121 |
}
|
@@ -171,8 +168,6 @@ class Nacex_Shipping_Model_Standard_Data {
|
|
171 |
} catch (Exception $e) {
|
172 |
Mage::logException($e);
|
173 |
}
|
174 |
-
// Agrega el iva mas un Euro
|
175 |
-
$params['price'] = ($params['price'] * 1.16) + 1;
|
176 |
switch($code){
|
177 |
case 'naxgab':
|
178 |
// En caso de ida y vuelta duplica el valor
|
26 |
*/
|
27 |
public function setServicio($_frompcode,$_topcode){
|
28 |
$code_store = substr($_frompcode,0,2);
|
29 |
+
$_topcode = substr($_topcode,0,2);
|
30 |
$servicio = '';
|
31 |
+
if($code_store == '07' || substr($_topcode,0,2) == '07'){
|
|
|
|
|
32 |
if($this->getRegion($code_store,$_topcode)){
|
33 |
// PRECIO INTRAISLAS
|
34 |
return 'INTRAISLAS';
|
36 |
// PRECIO NACIONAL PARA TODA ESPA�A
|
37 |
return 'NACIONAL_BALEARES';
|
38 |
}
|
39 |
+
} else {
|
40 |
// PARA LA TIENDA EN EL RESTO DE ESPA�A
|
41 |
+
if($code_store == $_topcode){
|
|
|
42 |
// PRECIO PROVINCIAL
|
43 |
return 'PROVINCIAL';
|
44 |
} else {
|
45 |
+
$id_region = $this->getRegion($_topcode,$code_store);
|
46 |
if($id_region == true){
|
47 |
// PRECIO REGIONAL PARA PROVINCIAS DE LA MISMA REGION
|
48 |
return 'REGIONAL';
|
51 |
return 'NACIONAL';
|
52 |
}
|
53 |
}
|
|
|
54 |
}
|
55 |
}
|
56 |
|
108 |
$params['shipping_method'] = 'BAG';
|
109 |
$params['price'] = 7.11;
|
110 |
} elseif(($sweight > '2000') && ($sweight <='5000')){
|
111 |
+
$params['price'] = 8.76;
|
112 |
} elseif(($sweight > '5000') && ($sweight <='10000')){
|
113 |
+
$params['price'] = 11.78;
|
114 |
} else {
|
115 |
+
$params['price'] = 11.78;
|
116 |
$peso=$sweight - 10000;
|
117 |
$params['price'] += (ceil($peso / 5000)) * 3.62;
|
118 |
}
|
168 |
} catch (Exception $e) {
|
169 |
Mage::logException($e);
|
170 |
}
|
|
|
|
|
171 |
switch($code){
|
172 |
case 'naxgab':
|
173 |
// En caso de ida y vuelta duplica el valor
|
app/code/community/Nacex/Shipping/etc/config.xml
CHANGED
@@ -61,6 +61,7 @@
|
|
61 |
<max_order_value>0</max_order_value>
|
62 |
<weight_units>1</weight_units>
|
63 |
<handling_fee>0</handling_fee>
|
|
|
64 |
<specificerrmsg>This shipping method is currently unavailable. If you would like to ship using this shipping method, please contact us.</specificerrmsg>
|
65 |
</spainpost>
|
66 |
<naxgab>
|
@@ -72,6 +73,7 @@
|
|
72 |
<max_order_value>0</max_order_value>
|
73 |
<weight_units>1</weight_units>
|
74 |
<handling_fee>0</handling_fee>
|
|
|
75 |
<specificerrmsg>This shipping method is currently unavailable. If you would like to ship using this shipping method, please contact us.</specificerrmsg>
|
76 |
</naxgab>
|
77 |
</carriers>
|
61 |
<max_order_value>0</max_order_value>
|
62 |
<weight_units>1</weight_units>
|
63 |
<handling_fee>0</handling_fee>
|
64 |
+
<xtra>0</xtra>
|
65 |
<specificerrmsg>This shipping method is currently unavailable. If you would like to ship using this shipping method, please contact us.</specificerrmsg>
|
66 |
</spainpost>
|
67 |
<naxgab>
|
73 |
<max_order_value>0</max_order_value>
|
74 |
<weight_units>1</weight_units>
|
75 |
<handling_fee>0</handling_fee>
|
76 |
+
<xtra>0</xtra>
|
77 |
<specificerrmsg>This shipping method is currently unavailable. If you would like to ship using this shipping method, please contact us.</specificerrmsg>
|
78 |
</naxgab>
|
79 |
</carriers>
|
app/code/community/Nacex/Shipping/etc/system.xml
CHANGED
@@ -62,6 +62,14 @@
|
|
62 |
<show_in_website>1</show_in_website>
|
63 |
<show_in_store>1</show_in_store>
|
64 |
</handling_fee>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
65 |
<max_order_value translate="label">
|
66 |
<label>Maximum Order Value</label>
|
67 |
<frontend_type>text</frontend_type>
|
@@ -164,6 +172,14 @@
|
|
164 |
<show_in_website>1</show_in_website>
|
165 |
<show_in_store>1</show_in_store>
|
166 |
</handling_fee>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
167 |
<max_order_value translate="label">
|
168 |
<label>Maximum Order Value</label>
|
169 |
<frontend_type>text</frontend_type>
|
62 |
<show_in_website>1</show_in_website>
|
63 |
<show_in_store>1</show_in_store>
|
64 |
</handling_fee>
|
65 |
+
<xtra translate="label">
|
66 |
+
<label>Extra amount</label>
|
67 |
+
<frontend_type>text</frontend_type>
|
68 |
+
<sort_order>45</sort_order>
|
69 |
+
<show_in_default>1</show_in_default>
|
70 |
+
<show_in_website>1</show_in_website>
|
71 |
+
<show_in_store>1</show_in_store>
|
72 |
+
</xtra>
|
73 |
<max_order_value translate="label">
|
74 |
<label>Maximum Order Value</label>
|
75 |
<frontend_type>text</frontend_type>
|
172 |
<show_in_website>1</show_in_website>
|
173 |
<show_in_store>1</show_in_store>
|
174 |
</handling_fee>
|
175 |
+
<xtra translate="label">
|
176 |
+
<label>Extra amount</label>
|
177 |
+
<frontend_type>text</frontend_type>
|
178 |
+
<sort_order>45</sort_order>
|
179 |
+
<show_in_default>1</show_in_default>
|
180 |
+
<show_in_website>1</show_in_website>
|
181 |
+
<show_in_store>1</show_in_store>
|
182 |
+
</xtra>
|
183 |
<max_order_value translate="label">
|
184 |
<label>Maximum Order Value</label>
|
185 |
<frontend_type>text</frontend_type>
|
package.xml
CHANGED
@@ -1,21 +1,26 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Shipping_Nacex</name>
|
4 |
-
<version>1.0.
|
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>* Arregla
|
|
|
12 |
|
13 |
<b>CHANGES:</b>
|
14 |
-
->U app/code/community/Nacex/Shipping/Model/
|
|
|
|
|
|
|
|
|
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-
|
17 |
-
<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="
|
19 |
<compatible/>
|
20 |
<dependencies/>
|
21 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Shipping_Nacex</name>
|
4 |
+
<version>1.0.12</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>* Arregla la tabla de precios
|
12 |
+
* Agrega un campo en la configuracion para agregar algun costo fijo
|
13 |
|
14 |
<b>CHANGES:</b>
|
15 |
+
->U app/code/community/Nacex/Shipping/Model/Carrier/Naxgab.php
|
16 |
+
->U app/code/community/Nacex/Shipping/Model/Carrier/Naxjow.php
|
17 |
+
->U app/code/community/Nacex/Shipping/Model/Standard/Data.php
|
18 |
+
->U app/code/community/Nacex/Shipping/etc/system.xml
|
19 |
+
->U app/code/community/Nacex/Shipping/etc/config.xml</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-22</date>
|
22 |
+
<time>11:35:44</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="833f06ca33f1e000857de8ce04e89367"/><file name="system.xml" hash="4a997c1e444081730b0d92d8650ba6ea"/></dir><dir name="Helper"><file name="Data.php" hash="8b06d6514b9924564f9078dd15cedc00"/></dir><dir name="Model"><dir name="Carrier"><file name="Naxgab.php" hash="5ea60bd35a004e75aad511d0368a32f6"/><file name="Naxjow.php" hash="0724162d724577c3d49a83e007958a4e"/></dir><dir name="Standard"><file name="Data.php" hash="da2384b612235af97c19af1c36e0a336"/><file name="Weightunits.php" hash="3222717edd1948d4a793f7136d5f1868"/></dir></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>
|