ColiPoste_La_Poste_So_Colissimo - Version 1.0.6

Version Notes

Lire le manuel d'installation

Download this release

Release Info

Developer Magento Core Team
Extension ColiPoste_La_Poste_So_Colissimo
Version 1.0.6
Comparing to
See all releases


Code changes from version 1.0.5 to 1.0.6

app/code/community/LaPoste/SoColissimoSimplicite/Model/Carrier/ShippingMethod.php CHANGED
@@ -136,6 +136,35 @@ class LaPoste_SoColissimoSimplicite_Model_Carrier_ShippingMethod
136
  }
137
  }
138
  break;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
139
  default:
140
  throw new Exception($helper->__('SoColissimo : la valeur de configuration "Type des frais de livraison" fourni "'.$amountBaseType.'" n\'est pas disponible'));
141
  break;
136
  }
137
  }
138
  break;
139
+ case 'per_amount':
140
+ $rules = json_decode($amountCalculation, true);
141
+ // si vide
142
+ if (is_null($rules) or empty($rules)) {
143
+ throw new Exception($helper->__('SoColissimo : la valeur de configuration "Calcul des frais de livraison" pour le type "tarif selon le sous-total" fournie "'.$amountCalculation.'" n\'est pas dans le bon format, exemple {"0":"3","50":"5","100":"8","250":"0"}'));
144
+ } else {
145
+ try {
146
+ //tri par montant décroissant
147
+ krsort($rules,SORT_NUMERIC);
148
+
149
+ //recuperation du sous total HT du panier
150
+ $totalAmount = $shippingAddress->getSubtotal();
151
+
152
+ //recherche du prix selon les fourchettes de tarifs donnees
153
+ $calculatedPrice = false;
154
+ foreach ($rules as $w => $p) {
155
+ if ($calculatedPrice === false) {
156
+ $calculatedPrice = $p;
157
+ }
158
+ $calculatedPrice = $p;
159
+ if ($w < $totalAmount) {
160
+ break;
161
+ }
162
+ }
163
+ } catch (Exception $e) {
164
+ throw new Exception($helper->__('SoColissimo : la valeur de configuration "Calcul des frais de livraison" pour le type "tarif selon le sous-total" fournie "'.$amountCalculation.'" n\'est pas dans le bon format, exemple {"0":"3","50":"5","100":"8","250":"0"}'));
165
+ }
166
+ }
167
+ break;
168
  default:
169
  throw new Exception($helper->__('SoColissimo : la valeur de configuration "Type des frais de livraison" fourni "'.$amountBaseType.'" n\'est pas disponible'));
170
  break;
app/code/community/LaPoste/SoColissimoSimplicite/Model/System/Config/Source/Shipping/Amountbasetype.php CHANGED
@@ -37,6 +37,9 @@ class LaPoste_SoColissimoSimplicite_Model_System_Config_Source_Shipping_Amountba
37
  array(
38
  'value'=>'per_weight',
39
  'label'=>Mage::helper('socolissimosimplicite')->__('Tarif selon poids')),
 
 
 
40
  );
41
  }
42
  }
37
  array(
38
  'value'=>'per_weight',
39
  'label'=>Mage::helper('socolissimosimplicite')->__('Tarif selon poids')),
40
+ array(
41
+ 'value'=>'per_amount',
42
+ 'label'=>Mage::helper('socolissimosimplicite')->__('Tarif selon sous-total du panier')),
43
  );
44
  }
45
  }
app/code/community/LaPoste/SoColissimoSimplicite/etc/system.xml CHANGED
@@ -141,6 +141,11 @@
141
  <code>{"</code>poids en kg<code>":"</code>tarif1<code>","</code>poids en kg<code>":"</code>tarif2<code>",</code>...<code>}</code><br />
142
  Le tarif est appliqué pour un poids supérieur ou égal au poids correspondant.<br />
143
  Exemple de conditions tarifaires selon le poids : <pre>{"0":"2.90","0.5":"4.50","5":"8","10":"14"}</pre>
 
 
 
 
 
144
  ]]>
145
  </comment>
146
  </amountcalculation>
141
  <code>{"</code>poids en kg<code>":"</code>tarif1<code>","</code>poids en kg<code>":"</code>tarif2<code>",</code>...<code>}</code><br />
142
  Le tarif est appliqué pour un poids supérieur ou égal au poids correspondant.<br />
143
  Exemple de conditions tarifaires selon le poids : <pre>{"0":"2.90","0.5":"4.50","5":"8","10":"14"}</pre>
144
+ Si <strong>tarif selon le sous-total du panier</strong>,
145
+ indiquer :<br />
146
+ <code>{"</code>montant<code>":"</code>tarif1<code>","</code>montant<code>":"</code>tarif2<code>",</code>...<code>}</code><br />
147
+ Le tarif est appliqué pour un montant supérieur ou égal au montant correspondant.<br />
148
+ Exemple de conditions tarifaires selon le montant : <pre>{"0":"3","50":"5","100":"8","250":"0"}</pre>
149
  ]]>
150
  </comment>
151
  </amountcalculation>
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>ColiPoste_La_Poste_So_Colissimo</name>
4
- <version>1.0.5</version>
5
  <stability>stable</stability>
6
  <license>GPL</license>
7
  <channel>community</channel>
@@ -20,9 +20,9 @@
20
  &lt;p&gt;R&amp;eacute;alisation par Smile.&lt;/p&gt;</description>
21
  <notes>Lire le manuel d'installation</notes>
22
  <authors><author><name>Berlioz</name><user>auto-converted</user><email>Aline.BERLIOZ@laposte.fr</email></author></authors>
23
- <date>2010-11-02</date>
24
- <time>16:19:20</time>
25
- <contents><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="socolissimosimplicite.xml" hash="e192bb74c6bbfce2cbcb8981c068f028"/></dir><dir name="template"><dir name="socolissimosimplicite"><dir name="form"><file name="failure.phtml" hash="7ef359d8037ba844f513ef2f7dbab93c"/></dir><dir name="onepage"><dir name="shipping_method"><dir name="available"><file name="default.phtml" hash="2bdafa2212776b9a4caa968dbe2bcbff"/><file name="socolissimosimplicite.phtml" hash="c904763758add06b6272ef8ff885bad9"/></dir><file name="available.phtml" hash="c4554f687752ccf1572b42d910c2976e"/></dir><file name="shipping_method.phtml" hash="294cbb06b60a6013cc85dd302543aafc"/></dir><file name="form.phtml" hash="5a5a4f6195e79e08797d63f618d5ac24"/></dir></dir></dir></dir></dir></target><target name="magelocale"><dir name="fr_FR"><file name="LaPoste_SoColissimoSimplicite.csv" hash="3b2a032525266c476fd3aec64aa81730"/></dir></target><target name="magecommunity"><dir name="LaPoste"><dir name="SoColissimoSimplicite"><dir name="Block"><dir name="Onepage"><dir name="Shipping"><dir name="Method"><dir name="Available"><file name="Item.php" hash="db3aeb1f3631ab238060532d754d6e0f"/></dir><file name="Available.php" hash="f87e3de8eb02e26142e2827a4cd855eb"/></dir></dir></dir><file name="Form.php" hash="fa23f5274d6d871bd84665d8aac33abc"/><file name="Onepage.php" hash="92cb8a36e4d641cd92cd2fbc78859876"/></dir><dir name="controllers"><file name="FormController.php" hash="61764d636e34db9f4a296532ad09c33e"/></dir><dir name="etc"><file name="config.xml" hash="f47431c49d437c24661874ebe7ecdf90"/><file name="system.xml" hash="16d1a33347d48c79c5d9e5e56b941d76"/></dir><dir name="Helper"><file name="Data.php" hash="071f9e214a69a27a259eb509fab77c3e"/></dir><dir name="Model"><dir name="Carrier"><file name="ShippingMethod.php" hash="45dea36317526f2ae19424070398f3c2"/></dir><dir name="Mysql4"><dir name="Transaction"><file name="Collection.php" hash="1460d058d25faef4cad2f9037449e0b0"/></dir><file name="Transaction.php" hash="ff3144312e5b109612429add23061085"/></dir><dir name="System"><dir name="Config"><dir name="Source"><dir name="Shipping"><file name="Amountbasetype.php" hash="c3dde687fbae69562b6dbeeecd7ea272"/></dir></dir></dir></dir><file name="Observer.php" hash="6065defe71691b2c3145bf6d74881821"/><file name="Transaction.php" hash="b8378ab4b5850cf3b982699c212d41b4"/></dir><dir name="sql"><dir name="socolissimosimplicite_setup"><file name="mysql4-install-1.0.0.php" hash="e811e69cb081e6d9ffc4b01ccb65b8d8"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="LaPoste_SoColissimoSimplicite.xml" hash="c4fb0c85f8e71d3cd5b37f869b1e6190"/></dir></target></contents>
26
  <compatible/>
27
  <dependencies/>
28
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>ColiPoste_La_Poste_So_Colissimo</name>
4
+ <version>1.0.6</version>
5
  <stability>stable</stability>
6
  <license>GPL</license>
7
  <channel>community</channel>
20
  &lt;p&gt;R&amp;eacute;alisation par Smile.&lt;/p&gt;</description>
21
  <notes>Lire le manuel d'installation</notes>
22
  <authors><author><name>Berlioz</name><user>auto-converted</user><email>Aline.BERLIOZ@laposte.fr</email></author></authors>
23
+ <date>2010-11-17</date>
24
+ <time>09:13:12</time>
25
+ <contents><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="socolissimosimplicite.xml" hash="e192bb74c6bbfce2cbcb8981c068f028"/></dir><dir name="template"><dir name="socolissimosimplicite"><dir name="form"><file name="failure.phtml" hash="7ef359d8037ba844f513ef2f7dbab93c"/></dir><dir name="onepage"><dir name="shipping_method"><dir name="available"><file name="default.phtml" hash="2bdafa2212776b9a4caa968dbe2bcbff"/><file name="socolissimosimplicite.phtml" hash="c904763758add06b6272ef8ff885bad9"/></dir><file name="available.phtml" hash="c4554f687752ccf1572b42d910c2976e"/></dir><file name="shipping_method.phtml" hash="294cbb06b60a6013cc85dd302543aafc"/></dir><file name="form.phtml" hash="5a5a4f6195e79e08797d63f618d5ac24"/></dir></dir></dir></dir></dir></target><target name="magelocale"><dir name="fr_FR"><file name="LaPoste_SoColissimoSimplicite.csv" hash="3b2a032525266c476fd3aec64aa81730"/></dir></target><target name="magecommunity"><dir name="LaPoste"><dir name="SoColissimoSimplicite"><dir name="Block"><dir name="Onepage"><dir name="Shipping"><dir name="Method"><dir name="Available"><file name="Item.php" hash="db3aeb1f3631ab238060532d754d6e0f"/></dir><file name="Available.php" hash="f87e3de8eb02e26142e2827a4cd855eb"/></dir></dir></dir><file name="Form.php" hash="fa23f5274d6d871bd84665d8aac33abc"/><file name="Onepage.php" hash="92cb8a36e4d641cd92cd2fbc78859876"/></dir><dir name="controllers"><file name="FormController.php" hash="61764d636e34db9f4a296532ad09c33e"/></dir><dir name="etc"><file name="config.xml" hash="f47431c49d437c24661874ebe7ecdf90"/><file name="system.xml" hash="c4209a53f789ddc2861059e36fdc98e3"/></dir><dir name="Helper"><file name="Data.php" hash="071f9e214a69a27a259eb509fab77c3e"/></dir><dir name="Model"><dir name="Carrier"><file name="ShippingMethod.php" hash="e8404717fa32b9bf5870cff8cdbc6ed5"/></dir><dir name="Mysql4"><dir name="Transaction"><file name="Collection.php" hash="1460d058d25faef4cad2f9037449e0b0"/></dir><file name="Transaction.php" hash="ff3144312e5b109612429add23061085"/></dir><dir name="System"><dir name="Config"><dir name="Source"><dir name="Shipping"><file name="Amountbasetype.php" hash="754357d9aaa6061a6b2411da89b2a6b7"/></dir></dir></dir></dir><file name="Observer.php" hash="6065defe71691b2c3145bf6d74881821"/><file name="Transaction.php" hash="b8378ab4b5850cf3b982699c212d41b4"/></dir><dir name="sql"><dir name="socolissimosimplicite_setup"><file name="mysql4-install-1.0.0.php" hash="e811e69cb081e6d9ffc4b01ccb65b8d8"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="LaPoste_SoColissimoSimplicite.xml" hash="c4fb0c85f8e71d3cd5b37f869b1e6190"/></dir></target></contents>
26
  <compatible/>
27
  <dependencies/>
28
  </package>