Owebia_Shipping_2 - Version 2.4.4

Version Notes

[2.4.4 - 30 novembre 2011]
Correction d'un bug avec l'utilisation de product.category.id
Ajout des valeurs memory_limit et memory_usage dans le debug

Download this release

Release Info

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


Code changes from version 2.4.3 to 2.4.4

app/code/community/Owebia/Shipping2/Model/Carrier/AbstractOwebiaShipping.php CHANGED
@@ -28,7 +28,7 @@ class Magento_Category implements OS_Category {
28
private $id;
29
private $loaded_category;
30
public function __construct($id) {
31
- $this->id = $id;
32
}
33
34
private function _loadCategory() {
28
private $id;
29
private $loaded_category;
30
public function __construct($id) {
31
+ $this->id = (int)$id;
32
}
33
34
private function _loadCategory() {
app/code/community/Owebia/Shipping2/changelog CHANGED
@@ -1,3 +1,7 @@
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)
1
+ [2.4.4 - 30 novembre 2011]
2
+ Correction d'un bug avec l'utilisation de product.category.id
3
+ Ajout des valeurs memory_limit et memory_usage dans le debug
4
+
5
[2.4.3 - 11 octobre 2011]
6
Support de la variable {cart.coupon} depuis le backoffice de Magento (merci � mfoillard, CF: http://www.magentocommerce.com/boards/viewthread/262907/)
7
Correction d'un bug dans les op�rations sum, count, min et max ($properties = array(); �crasait plusieurs fois les valeurs pr�c�dentes)
app/code/community/Owebia/Shipping2/etc/config.xml CHANGED
@@ -22,7 +22,7 @@
22
<config>
23
<modules>
24
<Owebia_Shipping2>
25
- <version>2.4.2</version>
26
<depends>
27
<Mage_Shipping />
28
</depends>
22
<config>
23
<modules>
24
<Owebia_Shipping2>
25
+ <version>2.4.4</version>
26
<depends>
27
<Mage_Shipping />
28
</depends>
app/code/community/Owebia/Shipping2/includes/OwebiaShippingHelper.php CHANGED
@@ -50,12 +50,30 @@ class OwebiaShippingHelper
50
'{s.',
51
);
52
53
public static function getDefaultProcessData() {
54
$timestamp = time();
55
$properties = array(
56
'info.server.os' => PHP_OS,
57
'info.server.software' => $_SERVER['SERVER_SOFTWARE'],
58
'info.php.version' => PHP_VERSION,
59
'info.module.version' => '',
60
'info.carrier.code' => '',
61
'cart.price-tax+discount' => 0,
@@ -598,7 +616,7 @@ class OwebiaShippingHelper
598
protected function _evalFormula($formula) {
599
if (is_bool($formula)) return $formula;
600
if (!preg_match('/^(?:E|floor|ceil|round|max|min|rand|pow|pi|sqrt|log|exp|abs|int|float|true|false|null|and|or|in|substr|strtolower'
601
- .'|in_array\(\'(?:[^\']*)\', *array\( *(?:(?:\'(?:[^\']+)\') *(?: *, *\'(?:[^\']+)\')* *)?\) *\)'
602
.'|\'[^\']*\'|[0-9,\'\.\-\(\)\*\/\?\:\+\<\>\=\&\|%! ])*#x2F;',$formula)) {
603
$errors = array(
604
PREG_NO_ERROR => 'PREG_NO_ERROR',
@@ -1244,7 +1262,9 @@ class OwebiaShippingHelper
1244
break;
1245
}
1246
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();
@@ -1284,7 +1304,8 @@ class OwebiaShippingHelper
1284
break;
1285
case 'category':
1286
$get_by_id = isset($property[2]) && $property[2]=='id';
1287
- $value = $get_by_id ? $category->getId() : $category->getName();
1288
break;
1289
case 'categories':
1290
$get_by_id = isset($property[2]) && $property[2]=='id';
50
'{s.',
51
);
52
53
+ public static function parseSize($size) {
54
+ $size = trim($size);
55
+ $last = strtolower($size[strlen($size)-1]);
56
+ switch ($last) {
57
+ case 'g': $size *= 1024;
58
+ case 'm': $size *= 1024;
59
+ case 'k': $size *= 1024;
60
+ }
61
+ return $size;
62
+ }
63
+
64
+ public static function formatSize($size) {
65
+ $unit = array('B','KB','MB','GB','TB','PB');
66
+ return @round($size/pow(1024,($i=floor(log($size,1024)))),2).' '.$unit[$i];
67
+ }
68
+
69
public static function getDefaultProcessData() {
70
$timestamp = time();
71
$properties = array(
72
'info.server.os' => PHP_OS,
73
'info.server.software' => $_SERVER['SERVER_SOFTWARE'],
74
'info.php.version' => PHP_VERSION,
75
+ 'info.memory.limit' => self::formatSize(self::parseSize(ini_get('memory_limit'))),
76
+ 'info.memory.usage' => self::formatSize(memory_get_usage(true)),
77
'info.module.version' => '',
78
'info.carrier.code' => '',
79
'cart.price-tax+discount' => 0,
616
protected function _evalFormula($formula) {
617
if (is_bool($formula)) return $formula;
618
if (!preg_match('/^(?:E|floor|ceil|round|max|min|rand|pow|pi|sqrt|log|exp|abs|int|float|true|false|null|and|or|in|substr|strtolower'
619
+ .'|in_array\((?:\'(?:[^\']*)\'|(?:[^\']*)), *array\( *(?:(?:\'(?:[^\']+)\'|(?:[^\']+)) *(?: *, *(?:\'(?:[^\']+)\'|(?:[^\']+)))* *)?\) *\)'
620
.'|\'[^\']*\'|[0-9,\'\.\-\(\)\*\/\?\:\+\<\>\=\&\|%! ])*#x2F;',$formula)) {
621
$errors = array(
622
PREG_NO_ERROR => 'PREG_NO_ERROR',
1262
break;
1263
}
1264
1265
+ $this->debug(' <span class="osh-loop">start <span class="osh-replacement">'.$operation.'</span> <span class="osh-key">product</span>'
1266
+ .(isset($property_type) ? '.<span class="osh-key">'.$property_type.'</span>.<span class="osh-key">'.$property_name.'</span>' : '')
1267
+ .' where <span class="osh-replacement">'.$conditions.'</span></span>');
1268
$this->addDebugIndent();
1269
1270
$properties = array();
1304
break;
1305
case 'category':
1306
$get_by_id = isset($property[2]) && $property[2]=='id';
1307
+ $category = $product->getCategory();
1308
+ $value = $category ? ($get_by_id ? $category->getId() : $category->getName()) : null;
1309
break;
1310
case 'categories':
1311
$get_by_id = isset($property[2]) && $property[2]=='id';
package.xml CHANGED
@@ -1,7 +1,7 @@
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,13 +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.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>
1
<?xml version="1.0"?>
2
<package>
3
<name>Owebia_Shipping_2</name>
4
+ <version>2.4.4</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.4 - 30 novembre 2011]
14
+ Correction d'un bug avec l'utilisation de product.category.id
15
+ Ajout des valeurs memory_limit et memory_usage dans le debug</notes>
16
<authors><author><name>owebia</name><user>auto-converted</user><email>antoine.lemoine@owebia.com</email></author></authors>
17
+ <date>2011-11-30</date>
18
+ <time>15:25:52</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="ba6820caf10b9a1af5ddf9b609b12649"/><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="233ac860a668941a8d7e1bbcba056ed3"/></dir><dir name="Model"><dir name="Carrier"><file name="AbstractOwebiaShipping.php" hash="fec2a7ad0a7d923b2f596162081d6294"/><file name="OwebiaShipping1.php" hash="2e6caa067fdfae4673b8f8db52f7a3fe"/><file name="OwebiaShipping2.php" hash="310917d67dcf22bed6cbf5adefb90bde"/><file name="OwebiaShipping3.php" hash="e8ecfbac4088df56c609b04e688cc04b"/></dir></dir><file name="changelog" hash="93cd414f9b219da1d129ba340ff3f1f7"/></dir></dir></target></contents>
20
<compatible/>
21
<dependencies/>
22
</package>