Owebia_Shipping_2 - Version 2.4.3

Version Notes

[2.4.3 - 11 octobre 2011]
Support de la variable {cart.coupon} depuis le backoffice de Magento (merci à mfoillard, CF: http://www.magentocommerce.com/boards/viewthread/262907/)
Correction d'un bug dans les opérations sum, count, min et max ($properties = array(); écrasait plusieurs fois les valeurs précédentes)

Download this release

Release Info

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


Code changes from version 2.4.2 to 2.4.3

app/code/community/Owebia/Shipping2/Model/Carrier/AbstractOwebiaShipping.php CHANGED
@@ -450,6 +450,17 @@ abstract class Owebia_Shipping2_Model_Carrier_AbstractOwebiaShipping extends Mag
450
  if (isset($customer_group_id2)) $customer_group_id = $customer_group_id2;
451
  }
452
  $customer_group_code = Mage::getSingleton('customer/group')->load($customer_group_id)->getCode();
 
 
 
 
 
 
 
 
 
 
 
453
 
454
  $properties = array_merge(array(
455
  'info.magento.version' => Mage::getVersion(),
@@ -459,7 +470,7 @@ abstract class Owebia_Shipping2_Model_Carrier_AbstractOwebiaShipping extends Mag
459
  'info.module.version' => (string)$mage_config->getNode('modules/Owebia_Shipping2/version'),
460
  'info.carrier.code' => $this->_code,
461
  'cart.weight.unit' => Mage::getStoreConfig('owebia/shipping/weight_unit'),
462
- 'cart.coupon' => Mage::getSingleton('checkout/session')->getQuote()->getCouponCode(),
463
  'customer.group.id' => $customer_group_id,
464
  'customer.group.code' => $customer_group_code,
465
  'store.id' => $store->getId(),
450
  if (isset($customer_group_id2)) $customer_group_id = $customer_group_id2;
451
  }
452
  $customer_group_code = Mage::getSingleton('customer/group')->load($customer_group_id)->getCode();
453
+
454
+ $coupon_code = null;
455
+ $session = Mage::getSingleton('checkout/session');
456
+ if ($session && ($quote = $session->getQuote()) && $quote->hasCouponCode() && $quote->getCouponCode()) {
457
+ $coupon_code = $quote->getCouponCode();
458
+ } else { // Pour les commandes depuis Adminhtml
459
+ $session = Mage::getSingleton('adminhtml/session_quote');
460
+ if ($session && ($quote = $session->getQuote()) && $quote->hasCouponCode() && $quote->getCouponCode()) {
461
+ $coupon_code = $quote->getCouponCode();
462
+ }
463
+ }
464
 
465
  $properties = array_merge(array(
466
  'info.magento.version' => Mage::getVersion(),
470
  'info.module.version' => (string)$mage_config->getNode('modules/Owebia_Shipping2/version'),
471
  'info.carrier.code' => $this->_code,
472
  'cart.weight.unit' => Mage::getStoreConfig('owebia/shipping/weight_unit'),
473
+ 'cart.coupon' => $coupon_code,
474
  'customer.group.id' => $customer_group_id,
475
  'customer.group.code' => $customer_group_code,
476
  'store.id' => $store->getId(),
app/code/community/Owebia/Shipping2/changelog CHANGED
@@ -1,3 +1,7 @@
 
 
 
 
1
  [2.4.2 - 07 octobre 2011]
2
  Support des nombres d�cimaux repr�sent�s sous la forme 5.3290705182E-15
3
  Modification de la licence du code source (MIT au lieu de OSL 3.0)
1
+ [2.4.3 - 11 octobre 2011]
2
+ Support de la variable {cart.coupon} depuis le backoffice de Magento (merci � mfoillard, CF: http://www.magentocommerce.com/boards/viewthread/262907/)
3
+ Correction d'un bug dans les op�rations sum, count, min et max ($properties = array(); �crasait plusieurs fois les valeurs pr�c�dentes)
4
+
5
  [2.4.2 - 07 octobre 2011]
6
  Support des nombres d�cimaux repr�sent�s sous la forme 5.3290705182E-15
7
  Modification de la licence du code source (MIT au lieu de OSL 3.0)
app/code/community/Owebia/Shipping2/includes/OwebiaShippingHelper.php CHANGED
@@ -411,7 +411,7 @@ class OwebiaShippingHelper
411
  protected function _preg_match_all($regexp, $input, &$result, $debug=false) {
412
  $regexp = $this->_prepare_regexp($regexp);
413
  if ($debug) $this->debug(' preg_match_all <span class="osh-replacement">'.$regexp.'</span>');
414
- preg_match_all($regexp, $input, $result, PREG_SET_ORDER);
415
  }
416
 
417
  protected function _prepareFormula($process, $row, $property_key, $formula_string, $is_checking, $use_cache=true)
@@ -1247,21 +1247,20 @@ class OwebiaShippingHelper
1247
  $this->debug(' <span class="osh-loop">start <span class="osh-replacement">'.$operation.'</span> <span class="osh-key">product</span>.<span class="osh-key">'.$property_type.'</span>.<span class="osh-key">'.$property_name.'</span> where <span class="osh-replacement">'.$conditions.'</span></span>');
1248
  $this->addDebugIndent();
1249
 
1250
- $this->_preg_match_all('/{PRODUCT_REGEX}\.({ATTRIBUTE_REGEX}|{OPTION_REGEX}|stock)\.([a-z0-9_+-]+)(?:\.(id))?/i', $conditions, $properties_regex_result);
1251
  $properties = array();
 
 
1252
  foreach ($properties_regex_result as $property_regex_result) {
1253
  $key = $property_regex_result[0];
1254
  if (!isset($properties[$key])) $properties[$key] = $property_regex_result;
1255
  }
1256
  $this->_preg_match_all('/{PRODUCT_REGEX}\.({CATEGORY_REGEX})(?:\.(id))?/i', $conditions, $properties_regex_result);
1257
- $properties = array();
1258
  foreach ($properties_regex_result as $property_regex_result) {
1259
  $key = $property_regex_result[0];
1260
  $property_regex_result[1] = 'category';
1261
  if (!isset($properties[$key])) $properties[$key] = $property_regex_result;
1262
  }
1263
  $this->_preg_match_all('/{PRODUCT_REGEX}\.({CATEGORIES_REGEX})(?:\.(id))?/i', $conditions, $properties_regex_result);
1264
- $properties = array();
1265
  foreach ($properties_regex_result as $property_regex_result) {
1266
  $key = $property_regex_result[0];
1267
  $property_regex_result[1] = 'categories';
411
  protected function _preg_match_all($regexp, $input, &$result, $debug=false) {
412
  $regexp = $this->_prepare_regexp($regexp);
413
  if ($debug) $this->debug(' preg_match_all <span class="osh-replacement">'.$regexp.'</span>');
414
+ $return = preg_match_all($regexp, $input, $result, PREG_SET_ORDER);
415
  }
416
 
417
  protected function _prepareFormula($process, $row, $property_key, $formula_string, $is_checking, $use_cache=true)
1247
  $this->debug(' <span class="osh-loop">start <span class="osh-replacement">'.$operation.'</span> <span class="osh-key">product</span>.<span class="osh-key">'.$property_type.'</span>.<span class="osh-key">'.$property_name.'</span> where <span class="osh-replacement">'.$conditions.'</span></span>');
1248
  $this->addDebugIndent();
1249
 
 
1250
  $properties = array();
1251
+
1252
+ $this->_preg_match_all('/{PRODUCT_REGEX}\.({ATTRIBUTE_REGEX}|{OPTION_REGEX}|stock)\.([a-z0-9_+-]+)(?:\.(id))?/i', $conditions, $properties_regex_result);
1253
  foreach ($properties_regex_result as $property_regex_result) {
1254
  $key = $property_regex_result[0];
1255
  if (!isset($properties[$key])) $properties[$key] = $property_regex_result;
1256
  }
1257
  $this->_preg_match_all('/{PRODUCT_REGEX}\.({CATEGORY_REGEX})(?:\.(id))?/i', $conditions, $properties_regex_result);
 
1258
  foreach ($properties_regex_result as $property_regex_result) {
1259
  $key = $property_regex_result[0];
1260
  $property_regex_result[1] = 'category';
1261
  if (!isset($properties[$key])) $properties[$key] = $property_regex_result;
1262
  }
1263
  $this->_preg_match_all('/{PRODUCT_REGEX}\.({CATEGORIES_REGEX})(?:\.(id))?/i', $conditions, $properties_regex_result);
 
1264
  foreach ($properties_regex_result as $property_regex_result) {
1265
  $key = $property_regex_result[0];
1266
  $property_regex_result[1] = 'categories';
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Owebia_Shipping_2</name>
4
- <version>2.4.2</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,23 +10,13 @@
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.2 - 07 octobre 2011]
14
- Support des nombres d&#xE9;cimaux repr&#xE9;sent&#xE9;s sous la forme 5.3290705182E-15
15
- Modification de la licence du code source (MIT au lieu de OSL 3.0)
16
- Mise &#xE0; jour des mentions de copyright et de licence
17
- Nettoyage du code source (suppression de lignes de code en commentaire)
18
- Initialisation des formules sum et count &#xE0; 0 au lieu de null (pour &#xE9;viter les erreurs de formule si aucun produit ne correpond)
19
- Ajout des alias "a" et "attr" pour "attribute", "o" et "opt" pour "option", "p" pour "product", "c" pour "cart", "s" pour "selection"
20
- Correction de la r&#xE9;cup&#xE9;ration des variables personnalis&#xE9;es : getValue('text') au lieu de getValue('plain')
21
- Support des cat&#xE9;gories
22
- product.categories dans les conditions de boucle foreach
23
- {product.category} et {product.category.id} comme variables dans les boucles foreach
24
- product.category, product.category.id, product.categories, product.categories.id dans les conditions des op&#xE9;rations sum, count, min et max
25
- Am&#xE9;lioration du debug</notes>
26
  <authors><author><name>owebia</name><user>auto-converted</user><email>antoine.lemoine@owebia.com</email></author></authors>
27
- <date>2011-10-07</date>
28
- <time>13:17:49</time>
29
- <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="cfbb6a96b517b1e00478556dd6fdfb6d"/></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="fcff55f860bfb743b34245e6ce2e5d5b"/></dir></dir></dir></dir></dir></dir><dir name="Controller"><file name="Abstract.php" hash="f8fa0d63caf4585e9ac42fae2e970a23"/></dir><dir name="controllers"><dir name="Checkout"><file name="CartController.php" hash="8c6ee136298e0e2dd0052143887282ce"/></dir><file name="AjaxController.php" hash="aec2cb9e8c7f0fb2ab0ffad1fa3bb43e"/></dir><dir name="etc"><file name="adminhtml.xml" hash="ed61385695adc726513ecb0d80b5471b"/><file name="config.xml" hash="dda5f94f1d8445d146663bd1bb6c7f30"/><file name="system.xml" hash="67f66b677ed950ecce17d8dc50ea1061"/></dir><dir name="includes"><dir name="cache"><file name="countries" hash="6b1a5494b6dddcc65f2946dbf0226c29"/></dir><file name="OS2_AddressFilter.php" hash="bb26bb2da522049ea6da82092503e35e"/><file name="OS2_CustomerGroup.php" hash="f39c69309ea1d268654917231834f802"/><file name="OwebiaShippingHelper.php" hash="05c5e36454e0fa7766aee6138fce5d24"/></dir><dir name="Model"><dir name="Carrier"><file name="AbstractOwebiaShipping.php" hash="260523801ddadfeed1a54665e5fd905f"/><file name="OwebiaShipping1.php" hash="2e6caa067fdfae4673b8f8db52f7a3fe"/><file name="OwebiaShipping2.php" hash="310917d67dcf22bed6cbf5adefb90bde"/><file name="OwebiaShipping3.php" hash="e8ecfbac4088df56c609b04e688cc04b"/></dir></dir><file name="changelog" hash="43f76b5ba7f389bfcabe3516faf2bd8a"/></dir></dir></target></contents>
30
  <compatible/>
31
  <dependencies/>
32
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Owebia_Shipping_2</name>
4
+ <version>2.4.3</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.3 - 11 octobre 2011]
14
+ Support de la variable {cart.coupon} depuis le backoffice de Magento (merci &#xE0; mfoillard, CF: http://www.magentocommerce.com/boards/viewthread/262907/)
15
+ Correction d'un bug dans les op&#xE9;rations sum, count, min et max ($properties = array(); &#xE9;crasait plusieurs fois les valeurs pr&#xE9;c&#xE9;dentes)</notes>
 
 
 
 
 
 
 
 
 
 
16
  <authors><author><name>owebia</name><user>auto-converted</user><email>antoine.lemoine@owebia.com</email></author></authors>
17
+ <date>2011-10-11</date>
18
+ <time>21:07:10</time>
19
+ <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="cfbb6a96b517b1e00478556dd6fdfb6d"/></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="fcff55f860bfb743b34245e6ce2e5d5b"/></dir></dir></dir></dir></dir></dir><dir name="Controller"><file name="Abstract.php" hash="f8fa0d63caf4585e9ac42fae2e970a23"/></dir><dir name="controllers"><dir name="Checkout"><file name="CartController.php" hash="8c6ee136298e0e2dd0052143887282ce"/></dir><file name="AjaxController.php" hash="aec2cb9e8c7f0fb2ab0ffad1fa3bb43e"/></dir><dir name="etc"><file name="adminhtml.xml" hash="ed61385695adc726513ecb0d80b5471b"/><file name="config.xml" hash="dda5f94f1d8445d146663bd1bb6c7f30"/><file name="system.xml" hash="67f66b677ed950ecce17d8dc50ea1061"/></dir><dir name="includes"><dir name="cache"><file name="countries" hash="6b1a5494b6dddcc65f2946dbf0226c29"/></dir><file name="OS2_AddressFilter.php" hash="bb26bb2da522049ea6da82092503e35e"/><file name="OS2_CustomerGroup.php" hash="f39c69309ea1d268654917231834f802"/><file name="OwebiaShippingHelper.php" hash="6204e21f60d277deecaa634e4c9f0b9d"/></dir><dir name="Model"><dir name="Carrier"><file name="AbstractOwebiaShipping.php" hash="79cfc20969de21f8d45a0adea9c71f2f"/><file name="OwebiaShipping1.php" hash="2e6caa067fdfae4673b8f8db52f7a3fe"/><file name="OwebiaShipping2.php" hash="310917d67dcf22bed6cbf5adefb90bde"/><file name="OwebiaShipping3.php" hash="e8ecfbac4088df56c609b04e688cc04b"/></dir></dir><file name="changelog" hash="185c1bc6a3e832a80a52973deb77552e"/></dir></dir></target></contents>
20
  <compatible/>
21
  <dependencies/>
22
  </package>