Owebia_Shipping_2 - Version 2.4.1

Version Notes

[2.4.1 - 24 août 2011]
Modification légère du code php pour éviter un plantage avec certaines versions d'eAccelerator (cache php)
$row = null;
$this->addMessage('info',$row,null,'Ignored lines %s','

'.trim($config_string).'
');
au lieu de ;
$this->addMessage('info',$row=null,null,'Ignored lines %s','
'.trim($config_string).'
');
(cf http://www.magentocommerce.com/boards/viewthread/233202/)
Ajout des variables de debug "info.server.os" et "info.server.software"
Ajout de la possibilité de récupérer la valeur minimum ou maximum de la quantité (ex: "{max product.quantity}")

Download this release

Release Info

Developer Magento Core Team
Extension Owebia_Shipping_2
Version 2.4.1
Comparing to
See all releases


Code changes from version 2.4.0 to 2.4.1

app/code/community/Owebia/Shipping2/Model/Carrier/AbstractOwebiaShipping.php CHANGED
@@ -15,7 +15,7 @@
15
  *
16
  * @category Owebia
17
  * @package Owebia_Shipping2
18
- * @copyright Copyright (c) 2008-10 Owebia (http://www.owebia.com/)
19
  * @author Antoine Lemoine
20
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
21
  */
15
  *
16
  * @category Owebia
17
  * @package Owebia_Shipping2
18
+ * @copyright Copyright (c) 2008-11 Owebia (http://www.owebia.com/)
19
  * @author Antoine Lemoine
20
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
21
  */
app/code/community/Owebia/Shipping2/changelog CHANGED
@@ -1,3 +1,13 @@
 
 
 
 
 
 
 
 
 
 
1
  [2.4.0 - 27 juin 2011]
2
  Correction d'un bug lorsque plusieurs produits identiques avec des options diff�rentes sont pr�sents dans le panier (la valeur de l'option �tait toujours �gale � celle du premier produit)
3
  Ajout de la possibilit� d'utiliser les expressions r�guli�res dans les champs "destination" et "origin"
1
+ [2.4.1 - 24 ao�t 2011]
2
+ Modification l�g�re du code php pour �viter un plantage avec certaines versions d'eAccelerator (cache php)
3
+ $row = null;
4
+ $this->addMessage('info',$row,null,'Ignored lines %s','<div class="code">'.trim($config_string).'</div>');
5
+ au lieu de ;
6
+ $this->addMessage('info',$row=null,null,'Ignored lines %s','<div class="code">'.trim($config_string).'</div>');
7
+ (cf http://www.magentocommerce.com/boards/viewthread/233202/)
8
+ Ajout des variables de debug "info.server.os" et "info.server.software"
9
+ Ajout de la possibilit� de r�cup�rer la valeur minimum ou maximum de la quantit� (ex: "{max product.quantity}")
10
+
11
  [2.4.0 - 27 juin 2011]
12
  Correction d'un bug lorsque plusieurs produits identiques avec des options diff�rentes sont pr�sents dans le panier (la valeur de l'option �tait toujours �gale � celle du premier produit)
13
  Ajout de la possibilit� d'utiliser les expressions r�guli�res dans les champs "destination" et "origin"
app/code/community/Owebia/Shipping2/controllers/AjaxController.php CHANGED
@@ -417,7 +417,7 @@ class Owebia_Shipping2_AjaxController extends Owebia_Shipping2_Controller_Abstra
417
  $output = $this->__('{os2editor.help.'.$_POST['input'].'}');
418
  if ($_POST['input']=='changelog') {
419
  $changelog = @file_get_contents($this->getModulePath('changelog'));
420
- $output = str_replace('{changelog}',mb_convert_encoding($changelog,'UTF-8','ISO-8859-1'),$output);
421
  }
422
  echo $output;
423
  exit;
417
  $output = $this->__('{os2editor.help.'.$_POST['input'].'}');
418
  if ($_POST['input']=='changelog') {
419
  $changelog = @file_get_contents($this->getModulePath('changelog'));
420
+ $output = str_replace('{changelog}',htmlspecialchars(mb_convert_encoding($changelog,'UTF-8','ISO-8859-1'), ENT_QUOTES, 'UTF-8'),$output);
421
  }
422
  echo $output;
423
  exit;
app/code/community/Owebia/Shipping2/includes/OwebiaShippingHelper.php CHANGED
@@ -14,7 +14,7 @@
14
  * to license@magentocommerce.com so we can send you a copy immediately.
15
  *
16
  * @category Owebia
17
- * @copyright Copyright (c) 2008-10 Owebia (http://www.owebia.com)
18
  * @author Antoine Lemoine
19
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
  */
@@ -74,6 +74,8 @@ class OwebiaShippingHelper
74
  public static function getDefaultProcessData() {
75
  $timestamp = time();
76
  $properties = array(
 
 
77
  'info.php.version' => PHP_VERSION,
78
  'info.magento.version' => '',
79
  'info.module.version' => '',
@@ -478,13 +480,15 @@ class OwebiaShippingHelper
478
  }
479
 
480
  while (preg_match("/{(count) products(?: where ([^}]+))?}/i",$formula,$result)
481
- || preg_match("/{(sum|min|max|count distinct) product\.(attribute|option|stock)\.([a-z0-9_+-]+)(?: where ([^}]+))?}/i",$formula,$result)) {
 
 
 
482
  $original = $result[0];
483
  if ($use_cache && isset($this->_expression_cache[$original])) {
484
  $replacement = $this->_expression_cache[$original];
485
  self::debug(' get cached expression <span class="osh-replacement">'.$original.'</span> = <span class="osh-formula">'.$replacement.'</span>');
486
- }
487
- else {
488
  $replacement = $this->_processProductProperty($process['cart.products'],$result);
489
  if ($use_cache) $this->setCache($result[0],$replacement);
490
  }
@@ -783,7 +787,8 @@ class OwebiaShippingHelper
783
  if ($before!==false && trim($before)!='') {
784
  $config_string = substr($config_string,strlen($before));
785
  $this->_addIgnoredLines(trim($before));
786
- $this->addMessage('info',$row=null,null,'Ignored lines %s','<div class="code">'.trim($before).'</div>');
 
787
  }
788
 
789
  $config_string = str_replace($block[0], '', $config_string);
@@ -1011,7 +1016,8 @@ class OwebiaShippingHelper
1011
  }
1012
  if (trim($config_string)!='') {
1013
  $this->_addIgnoredLines(trim($config_string));
1014
- $this->addMessage('info',$row=null,null,'Ignored lines %s','<div class="code">'.trim($config_string).'</div>');
 
1015
  }
1016
  }
1017
 
@@ -1180,17 +1186,26 @@ class OwebiaShippingHelper
1180
  $key = $property_regex_result[0];
1181
  if (!isset($properties[$key])) $properties[$key] = $property_regex_result;
1182
  }
 
 
 
 
 
1183
 
1184
  foreach ($products as $product) {
1185
  if (isset($conditions) && $conditions!='') {
1186
  $formula = $conditions;
1187
  foreach ($properties as $property) {
1188
- $value = $this->_getProductProperty(
1189
- $product,
1190
- $tmp_property_type = $property[1],
1191
- $tmp_property_name = $property[2],
1192
- $get_by_id = isset($property[3]) && $property[3]=='id'
1193
- );
 
 
 
 
1194
  //$formula = $this->replace($property[0],$value,$formula);
1195
  $from = $property[0];
1196
  $to = is_string($value) || empty($value) ? "'".$value."'" : $value;
@@ -1206,7 +1221,11 @@ class OwebiaShippingHelper
1206
  if ($operation=='count') {
1207
  $return_value = (isset($return_value) ? $return_value : 0) + $product->getQuantity();
1208
  } else {
1209
- $value = $this->_getProductProperty($product,$property_type,$property_name);
 
 
 
 
1210
  switch ($operation) {
1211
  case 'min':
1212
  if (!isset($return_value) || $value<$return_value) $return_value = $value;
14
  * to license@magentocommerce.com so we can send you a copy immediately.
15
  *
16
  * @category Owebia
17
+ * @copyright Copyright (c) 2008-11 Owebia (http://www.owebia.com)
18
  * @author Antoine Lemoine
19
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
  */
74
  public static function getDefaultProcessData() {
75
  $timestamp = time();
76
  $properties = array(
77
+ 'info.server.os' => PHP_OS,
78
+ 'info.server.software' => $_SERVER['SERVER_SOFTWARE'],
79
  'info.php.version' => PHP_VERSION,
80
  'info.magento.version' => '',
81
  'info.module.version' => '',
480
  }
481
 
482
  while (preg_match("/{(count) products(?: where ([^}]+))?}/i",$formula,$result)
483
+ // || preg_match("/{(sum|min|max|count distinct) product\.(?(attribute|option|stock)\.([a-z0-9_+-]+)|(quantity))(?: where ([^}]+))?}/i",$formula,$result)) {
484
+ || preg_match("/{(sum|min|max|count distinct) product\.(attribute|option|stock)\.([a-z0-9_+-]+)(?: where ([^}]+))?}/i",$formula,$result)
485
+ || preg_match("/{(sum|min|max|count distinct) product\.(quantity)()(?: where ([^}]+))?}/i",$formula,$result)
486
+ ) {
487
  $original = $result[0];
488
  if ($use_cache && isset($this->_expression_cache[$original])) {
489
  $replacement = $this->_expression_cache[$original];
490
  self::debug(' get cached expression <span class="osh-replacement">'.$original.'</span> = <span class="osh-formula">'.$replacement.'</span>');
491
+ } else {
 
492
  $replacement = $this->_processProductProperty($process['cart.products'],$result);
493
  if ($use_cache) $this->setCache($result[0],$replacement);
494
  }
787
  if ($before!==false && trim($before)!='') {
788
  $config_string = substr($config_string,strlen($before));
789
  $this->_addIgnoredLines(trim($before));
790
+ $row = null;
791
+ $this->addMessage('info',$row,null,'Ignored lines %s','<div class="code">'.trim($before).'</div>');
792
  }
793
 
794
  $config_string = str_replace($block[0], '', $config_string);
1016
  }
1017
  if (trim($config_string)!='') {
1018
  $this->_addIgnoredLines(trim($config_string));
1019
+ $row = null;
1020
+ $this->addMessage('info',$row,null,'Ignored lines %s','<div class="code">'.trim($config_string).'</div>');
1021
  }
1022
  }
1023
 
1186
  $key = $property_regex_result[0];
1187
  if (!isset($properties[$key])) $properties[$key] = $property_regex_result;
1188
  }
1189
+ preg_match_all('/product\.(quantity)/i',$conditions,$properties_regex_result,PREG_SET_ORDER);
1190
+ foreach ($properties_regex_result as $property_regex_result) {
1191
+ $key = $property_regex_result[0];
1192
+ if (!isset($properties[$key])) $properties[$key] = $property_regex_result;
1193
+ }
1194
 
1195
  foreach ($products as $product) {
1196
  if (isset($conditions) && $conditions!='') {
1197
  $formula = $conditions;
1198
  foreach ($properties as $property) {
1199
+ if ($property[1]=='quantity') {
1200
+ $value = $product->getQuantity();
1201
+ } else {
1202
+ $value = $this->_getProductProperty(
1203
+ $product,
1204
+ $tmp_property_type = $property[1],
1205
+ $tmp_property_name = $property[2],
1206
+ $get_by_id = isset($property[3]) && $property[3]=='id'
1207
+ );
1208
+ }
1209
  //$formula = $this->replace($property[0],$value,$formula);
1210
  $from = $property[0];
1211
  $to = is_string($value) || empty($value) ? "'".$value."'" : $value;
1221
  if ($operation=='count') {
1222
  $return_value = (isset($return_value) ? $return_value : 0) + $product->getQuantity();
1223
  } else {
1224
+ if ($property_type=='quantity') {
1225
+ $value = $product->getQuantity();
1226
+ } else {
1227
+ $value = $this->_getProductProperty($product,$property_type,$property_name);
1228
+ }
1229
  switch ($operation) {
1230
  case 'min':
1231
  if (!isset($return_value) || $value<$return_value) $return_value = $value;
app/locale/fr_FR/Owebia_Shipping2.csv CHANGED
@@ -567,6 +567,7 @@ Liste des préfixes possibles :
567
  Liste des propriétés possibles :
568
  </p>
569
  <ul>
 
570
  <li><b>product.attribute.* :</b> attribut<br/>Liste d'attributs intéressants :
571
  <ul>
572
  <li><b>sku :</b> la référence</li>
567
  Liste des propriétés possibles :
568
  </p>
569
  <ul>
570
+ <li class=""new""><b>product.quantity :</b> quantité de l'article dans le panier</li>
571
  <li><b>product.attribute.* :</b> attribut<br/>Liste d'attributs intéressants :
572
  <ul>
573
  <li><b>sku :</b> la référence</li>
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Owebia_Shipping_2</name>
4
- <version>2.4.0</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.opensource.org/licenses/osl-3.0.php">Open Software License (OSL 3.0)</license>
7
  <channel>community</channel>
@@ -10,17 +10,19 @@
10
  <description>[EN] This module provides 3 shipping modes configurable with a very flexible syntax. The first method of delivery allows by default the management of Colissimo, Chronopost and Export 3J.
11
 
12
  [FR] Ce module met &#xE0; disposition 3 modes de livraison configurables avec une syntaxe tr&#xE8;s souple. Le premier mode de livraison permet par d&#xE9;faut la gestion des modes de livraison Colissimo, Chronopost et Export 3J.</description>
13
- <notes>[2.4.0 - 27 juin 2011]
14
- Correction d'un bug lorsque plusieurs produits identiques avec des options diff&#xE9;rentes sont pr&#xE9;sents dans le panier (la valeur de l'option &#xE9;tait toujours &#xE9;gale &#xE0; celle du premier produit)
15
- Ajout de la possibilit&#xE9; d'utiliser les expressions r&#xE9;guli&#xE8;res dans les champs "destination" et "origin"
16
- Ajout de la variable {car.weight.for-charge}
17
- Mise &#xE0; jour de la documentation en fran&#xE7;ais
18
- Mise &#xE0; jour de l'&#xE9;diteur
19
- Correction d'un bug de l'&#xE9;diteur lorsqu'on &#xE9;ditait une destination puis qu'on cliquait sur Annuler</notes>
 
 
20
  <authors><author><name>owebia</name><user>auto-converted</user><email>antoine.lemoine@owebia.com</email></author></authors>
21
- <date>2011-06-27</date>
22
- <time>14:59:41</time>
23
- <contents><target name="magelocale"><dir name="en_US"><file name="Owebia_Shipping2.csv" hash="4267e8feae738a7e06d06eed97d414fc"/></dir><dir name="fr_FR"><file name="Owebia_Shipping2.csv" hash="1a542f4ec3253e6ab8f2f2949da683b6"/></dir></target><target name="mage"><dir name="js"><dir name="owebia"><dir name="shipping2"><file name="os2editor.css" hash="1c1b01fcf4971a50e730ad0588c0eb5b"/><file name="os2editor.js" hash="83f8726e9d8dc2edf8f9f00bb29d9045"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Owebia_Shipping2.xml" hash="586171bce13c5fb46298a7033f62bab6"/><file name="Owebia_Shipping_2.xml" hash="2f84a53934b37c860e25bc0c6217467f"/></dir></target><target name="magecommunity"><dir name="Owebia"><dir name="Shipping2"><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Form"><dir name="Field"><file name="Config.php" hash="b121bfb0d699d50440762146b135b319"/></dir></dir></dir></dir></dir></dir><dir name="Controller"><file name="Abstract.php" hash="c2cbd0a032ca5665b31e0cfcdc1638ec"/></dir><dir name="controllers"><dir name="Checkout"><file name="CartController.php" hash="ef72b286e9adda29f1dfd68ad0fa42ec"/></dir><file name="AjaxController.php" hash="9855dc8c9950cbe1b5af1662a8f7d096"/></dir><dir name="etc"><file name="adminhtml.xml" hash="2a52eee2531db2e285716c9523c7cbf6"/><file name="config.xml" hash="64dcbdf449fe9592c16707172808e8cb"/><file name="system.xml" hash="c09780f68357ca1caf28b51fda4772eb"/></dir><dir name="includes"><dir name="cache"><file name="countries" hash="6b1a5494b6dddcc65f2946dbf0226c29"/></dir><file name="OS2_AddressFilter.php" hash="659c7155951b8415a963dfb778c782e5"/><file name="OS2_CustomerGroup.php" hash="c3aaf48316869ce51491c7e3af73f565"/><file name="OwebiaShippingHelper.php" hash="886cdc3ddefd661c223720e57797900c"/></dir><dir name="Model"><dir name="Carrier"><file name="AbstractOwebiaShipping.php" hash="89153068a0b94f21ea9d0a2e63787f63"/><file name="OwebiaShipping1.php" hash="e74757493b646425af9342b43997ff4e"/><file name="OwebiaShipping2.php" hash="cd9b8722ae65702f14435518f2c31af8"/><file name="OwebiaShipping3.php" hash="89d069078172aacc5b298e0bf68e575b"/></dir></dir><file name="changelog" hash="cee32cd6088245f075bf842e56e766d2"/></dir></dir></target></contents>
24
  <compatible/>
25
  <dependencies/>
26
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Owebia_Shipping_2</name>
4
+ <version>2.4.1</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.opensource.org/licenses/osl-3.0.php">Open Software License (OSL 3.0)</license>
7
  <channel>community</channel>
10
  <description>[EN] This module provides 3 shipping modes configurable with a very flexible syntax. The first method of delivery allows by default the management of Colissimo, Chronopost and Export 3J.
11
 
12
  [FR] Ce module met &#xE0; disposition 3 modes de livraison configurables avec une syntaxe tr&#xE8;s souple. Le premier mode de livraison permet par d&#xE9;faut la gestion des modes de livraison Colissimo, Chronopost et Export 3J.</description>
13
+ <notes>[2.4.1 - 24 ao&#xFB;t 2011]
14
+ Modification l&#xE9;g&#xE8;re du code php pour &#xE9;viter un plantage avec certaines versions d'eAccelerator (cache php)
15
+ $row = null;
16
+ $this-&gt;addMessage('info',$row,null,'Ignored lines %s','&lt;div class="code"&gt;'.trim($config_string).'&lt;/div&gt;');
17
+ au lieu de ;
18
+ $this-&gt;addMessage('info',$row=null,null,'Ignored lines %s','&lt;div class="code"&gt;'.trim($config_string).'&lt;/div&gt;');
19
+ (cf http://www.magentocommerce.com/boards/viewthread/233202/)
20
+ Ajout des variables de debug "info.server.os" et "info.server.software"
21
+ Ajout de la possibilit&#xE9; de r&#xE9;cup&#xE9;rer la valeur minimum ou maximum de la quantit&#xE9; (ex: "{max product.quantity}")</notes>
22
  <authors><author><name>owebia</name><user>auto-converted</user><email>antoine.lemoine@owebia.com</email></author></authors>
23
+ <date>2011-08-24</date>
24
+ <time>09:46:29</time>
25
+ <contents><target name="magelocale"><dir name="en_US"><file name="Owebia_Shipping2.csv" hash="4267e8feae738a7e06d06eed97d414fc"/></dir><dir name="fr_FR"><file name="Owebia_Shipping2.csv" hash="b8fa6dd7e21d4919b199417782d72778"/></dir></target><target name="mage"><dir name="js"><dir name="owebia"><dir name="shipping2"><file name="os2editor.css" hash="1c1b01fcf4971a50e730ad0588c0eb5b"/><file name="os2editor.js" hash="83f8726e9d8dc2edf8f9f00bb29d9045"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Owebia_Shipping2.xml" hash="586171bce13c5fb46298a7033f62bab6"/><file name="Owebia_Shipping_2.xml" hash="2f84a53934b37c860e25bc0c6217467f"/></dir></target><target name="magecommunity"><dir name="Owebia"><dir name="Shipping2"><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Form"><dir name="Field"><file name="Config.php" hash="b121bfb0d699d50440762146b135b319"/></dir></dir></dir></dir></dir></dir><dir name="Controller"><file name="Abstract.php" hash="c2cbd0a032ca5665b31e0cfcdc1638ec"/></dir><dir name="controllers"><dir name="Checkout"><file name="CartController.php" hash="ef72b286e9adda29f1dfd68ad0fa42ec"/></dir><file name="AjaxController.php" hash="eac44348f2fccf6d1cd18483c006c57e"/></dir><dir name="etc"><file name="adminhtml.xml" hash="2a52eee2531db2e285716c9523c7cbf6"/><file name="config.xml" hash="64dcbdf449fe9592c16707172808e8cb"/><file name="system.xml" hash="c09780f68357ca1caf28b51fda4772eb"/></dir><dir name="includes"><dir name="cache"><file name="countries" hash="6b1a5494b6dddcc65f2946dbf0226c29"/></dir><file name="OS2_AddressFilter.php" hash="659c7155951b8415a963dfb778c782e5"/><file name="OS2_CustomerGroup.php" hash="c3aaf48316869ce51491c7e3af73f565"/><file name="OwebiaShippingHelper.php" hash="b1b5008ebbeed9c90fec2d2a547f2d44"/></dir><dir name="Model"><dir name="Carrier"><file name="AbstractOwebiaShipping.php" hash="bd9398b9debaed2df6b8b08cfa003376"/><file name="OwebiaShipping1.php" hash="e74757493b646425af9342b43997ff4e"/><file name="OwebiaShipping2.php" hash="cd9b8722ae65702f14435518f2c31af8"/><file name="OwebiaShipping3.php" hash="89d069078172aacc5b298e0bf68e575b"/></dir></dir><file name="changelog" hash="de1513d4d9228288f3f6de8fd2e870fa"/></dir></dir></target></contents>
26
  <compatible/>
27
  <dependencies/>
28
  </package>