From 64764c4c1ea8df076ee04491babfd5829f50d4c7 Mon Sep 17 00:00:00 2001 From: vAugagneur Date: Tue, 5 Feb 2013 14:16:47 +0100 Subject: [PATCH 1/4] //added getWidthSize and getHeightSize method in tpl thanks to @PrestaEdit --- classes/Image.php | 12 ++++++++++++ config/smarty.config.inc.php | 3 +++ 2 files changed, 15 insertions(+) diff --git a/classes/Image.php b/classes/Image.php index 41e24bbe8..f2b749bf1 100644 --- a/classes/Image.php +++ b/classes/Image.php @@ -367,6 +367,18 @@ class ImageCore extends ObjectModel '); return self::$_cacheGetSize[$type]; } + + public static function getWidth($params, &$smarty) + { + $result = self::getSize($params['type']); + return $result['width']; + } + + public static function getHeight($params, &$smarty) + { + $result = self::getSize($params['type']); + return $result['height']; + } /** * Clear all images in tmp dir diff --git a/config/smarty.config.inc.php b/config/smarty.config.inc.php index 2ddefc55a..892a22dd3 100644 --- a/config/smarty.config.inc.php +++ b/config/smarty.config.inc.php @@ -80,6 +80,9 @@ smartyRegisterFunction($smarty, 'function', 'displayPrice', array('Tools', 'disp smartyRegisterFunction($smarty, 'modifier', 'convertAndFormatPrice', array('Product', 'convertAndFormatPrice')); // used twice smartyRegisterFunction($smarty, 'function', 'getAdminToken', array('Tools', 'getAdminTokenLiteSmarty')); smartyRegisterFunction($smarty, 'function', 'displayAddressDetail', array('AddressFormat', 'generateAddressSmarty')); +smartyRegisterFunction($smarty, 'function', 'getWidthSize', array('Image', 'getWidth')); +smartyRegisterFunction($smarty, 'function', 'getHeightSize', array('Image', 'getHeight')); + function smartyDieObject($params, &$smarty) { From 0052a9a94a4f78e7b1c2eac6e94a602283d23b3b Mon Sep 17 00:00:00 2001 From: Damien Metzger Date: Tue, 5 Feb 2013 15:02:29 +0100 Subject: [PATCH 2/4] [*] Core : added automatic conversion of ',' into '.' for floating values --- classes/ObjectModel.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/ObjectModel.php b/classes/ObjectModel.php index 29e48fe79..d0b70720d 100644 --- a/classes/ObjectModel.php +++ b/classes/ObjectModel.php @@ -389,7 +389,7 @@ abstract class ObjectModelCore return (int)$value; case self::TYPE_FLOAT : - return (float)$value; + return (float)str_replace(',', '.', $value); case self::TYPE_DATE : if (!$value) From d2ba246a087c316464ec384db0007bce55034f26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Gaillard?= Date: Tue, 5 Feb 2013 15:28:09 +0100 Subject: [PATCH 3/4] [-] BO: Don't display delete icon for order carts --- classes/controller/AdminController.php | 5 +++++ controllers/admin/AdminCartsController.php | 10 ++++++++++ 2 files changed, 15 insertions(+) diff --git a/classes/controller/AdminController.php b/classes/controller/AdminController.php index d7cc66f89..d5954f850 100644 --- a/classes/controller/AdminController.php +++ b/classes/controller/AdminController.php @@ -175,6 +175,9 @@ class AdminControllerCore extends Controller /** @var array required_fields to display in the Required Fields form */ public $required_fields = array(); + + /** @var Helper */ + protected $helper; /** * @var array actions to execute on multiple selections @@ -1635,6 +1638,8 @@ class AdminControllerCore extends Controller // For each action, try to add the corresponding skip elements list $helper->list_skip_actions = $this->list_skip_actions; + + $this->helper = $helper; } public function setMedia() diff --git a/controllers/admin/AdminCartsController.php b/controllers/admin/AdminCartsController.php index 8a99921a5..a0a85295e 100755 --- a/controllers/admin/AdminCartsController.php +++ b/controllers/admin/AdminCartsController.php @@ -746,4 +746,14 @@ class AdminCartsControllerCore extends AdminController { return ($echo == '0' ? Configuration::get('PS_SHOP_NAME') : $echo); } + + public function displayDeleteLink($token = null, $id, $name = null) + { + // don't display ordered carts + foreach ($this->_list as $row) + if ($row['id_cart'] == $id && isset($row['id_order']) && $row['id_order']) + return ; + + return $this->helper->displayDeleteLink($token, $id, $name); + } } From b53b7479aba0fce83b999a883114406d3894f7f6 Mon Sep 17 00:00:00 2001 From: sLorenzini Date: Tue, 5 Feb 2013 15:53:54 +0100 Subject: [PATCH 4/4] [-] FO: fixed bug rendering Problems in IE6 with default theme - #PSCFV-7628 --- modules/blockuserinfo/blockuserinfo.css | 6 +----- themes/default/modules/blockcart/blockcart.tpl | 4 ++-- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/modules/blockuserinfo/blockuserinfo.css b/modules/blockuserinfo/blockuserinfo.css index cb3f68e1b..235a1b271 100644 --- a/modules/blockuserinfo/blockuserinfo.css +++ b/modules/blockuserinfo/blockuserinfo.css @@ -13,11 +13,7 @@ } /* cart */ -#shopping_cart { - - - -} +.lt-ie6 #shopping_cart {width: 130px;} #shopping_cart a{ height: 15px; padding:15px 27px 10px 43px; diff --git a/themes/default/modules/blockcart/blockcart.tpl b/themes/default/modules/blockcart/blockcart.tpl index 3430c5e31..34320bd5b 100644 --- a/themes/default/modules/blockcart/blockcart.tpl +++ b/themes/default/modules/blockcart/blockcart.tpl @@ -44,11 +44,11 @@ var delete_txt = '{l s='Delete' mod='blockcart' js=1}';