From 51c6e2384fe20cc0294daf511d83e446557e6b56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Gaillard?= Date: Mon, 18 Feb 2013 20:30:53 +0100 Subject: [PATCH 1/7] [-] FO: Fix display specific prices for combinations in product page #PSCFV-7807 --- themes/default/js/product.js | 28 ++++++++-------------------- 1 file changed, 8 insertions(+), 20 deletions(-) diff --git a/themes/default/js/product.js b/themes/default/js/product.js index 09b254fb1..19444cb97 100644 --- a/themes/default/js/product.js +++ b/themes/default/js/product.js @@ -303,10 +303,8 @@ function updateDisplay() var tax = (taxRate / 100) + 1; - var display_specific_price; if (selectedCombination.specific_price) { - display_specific_price = selectedCombination.specific_price['price']; if (selectedCombination['specific_price'].reduction_type == 'percentage') { $('#reduction_amount').hide(); @@ -322,11 +320,8 @@ function updateDisplay() } } else - { - display_specific_price = product_specific_price['price']; if (product_specific_price['reduction_type'] == 'percentage') $('#reduction_percent_display').html(product_specific_price['specific_price'].reduction_percent); - } if (product_specific_price['reduction_type'] != '' || selectedCombination['specific_price'].reduction_type != '') $('#discount_reduced_price,#old_price').show(); @@ -337,28 +332,21 @@ function updateDisplay() $('#reduction_percent').show(); else $('#reduction_percent').hide(); - if (display_specific_price) + if (product_specific_price['price'] || selectedCombination.specific_price['price']) $('#not_impacted_by_discount').show(); else $('#not_impacted_by_discount').hide(); - var taxExclPrice = (display_specific_price && display_specific_price >= 0 ? (specific_currency ? display_specific_price : display_specific_price * currencyRate) : priceTaxExclWithoutGroupReduction) + selectedCombination['price'] * currencyRate; - - if (display_specific_price) - productPriceWithoutReduction = priceTaxExclWithoutGroupReduction + selectedCombination['price'] * currencyRate; // Need to be global => no var + if (selectedCombination.specific_price['price'] && selectedCombination.specific_price['price'] >=0) + var taxExclPrice = (specific_currency ? selectedCombination.specific_price['price'] : selectedCombination.specific_price['price'] * currencyRate); + else + var taxExclPrice = priceTaxExclWithoutGroupReduction + (selectedCombination['price'] * currencyRate); if (!displayPrice && !noTaxForThisProduct) - { productPrice = taxExclPrice * tax; // Need to be global => no var - if (display_specific_price) - productPriceWithoutReduction = ps_round(productPriceWithoutReduction * tax, 2); - } else - { productPrice = ps_round(taxExclPrice, 2); // Need to be global => no var - if (display_specific_price) - productPriceWithoutReduction = ps_round(productPriceWithoutReduction, 2); - } + var reduction = 0; if (selectedCombination['specific_price'].reduction_price || selectedCombination['specific_price'].reduction_percent) @@ -375,6 +363,7 @@ function updateDisplay() if (product_specific_price.reduction_price && (displayPrice || noTaxForThisProduct)) reduction = ps_round(reduction / tax, 6); } + productPriceWithoutReduction = productPrice * group_reduction; productPrice -= reduction; @@ -385,7 +374,6 @@ function updateDisplay() productPrice += ecotaxAmount; productPriceWithoutReduction += ecotaxAmount; - //productPrice = ps_round(productPrice * currencyRate, 2); var our_price = ''; if (productPrice > 0) { our_price = formatCurrency(productPrice, currencyFormat, currencySign, currencyBlank); @@ -727,4 +715,4 @@ function checkUrl() window.location = url.substring(0, url.indexOf('#')); } } -} \ No newline at end of file +} From 9b85cb1f7668e44bbe1db9eac2c4016ae1834140 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Gaillard?= Date: Tue, 19 Feb 2013 14:45:25 +0100 Subject: [PATCH 2/7] // delete useless commented code --- classes/controller/FrontController.php | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/classes/controller/FrontController.php b/classes/controller/FrontController.php index ebdc7309a..68683207a 100755 --- a/classes/controller/FrontController.php +++ b/classes/controller/FrontController.php @@ -406,22 +406,6 @@ class FrontControllerCore extends Controller } public function postProcess() - { - /*// For retrocompatibility with versions before 1.5, preProcess support will be removed on next release - if (method_exists(get_class($this), 'preProcess')) - { - $reflection = new ReflectionClass($this); - if (!in_array($reflection->getMethod('preProcess')->class, array('FrontController', 'FrontControllerCore'))) - { - Tools::displayAsDeprecated('Method preProcess() is deprecated in controllers, use method postProcess() instead'); - $this->preProcess(); - } - }*/ - - //$this->preProcess(); - } - - public function preProcess() { } From e152366d49e76beb379f1091d9d61bd1e7aa92d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Gaillard?= Date: Tue, 19 Feb 2013 15:02:09 +0100 Subject: [PATCH 3/7] // small changes --- controllers/front/CompareController.php | 2 +- controllers/front/OrderOpcController.php | 2 +- controllers/front/StoresController.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/controllers/front/CompareController.php b/controllers/front/CompareController.php index 73e55b7ab..5317d6d75 100644 --- a/controllers/front/CompareController.php +++ b/controllers/front/CompareController.php @@ -55,7 +55,7 @@ class CompareControllerCore extends FrontController } else if (Tools::getValue('action') == 'remove') { - if (isset(self::$cookie->id_compare)) + if (isset($this->context->cookie->id_compare)) CompareProduct::removeCompareProduct((int)$this->context->cookie->id_compare, (int)Tools::getValue('id_product')); else die('0'); diff --git a/controllers/front/OrderOpcController.php b/controllers/front/OrderOpcController.php index 42254f911..e0ca928ca 100644 --- a/controllers/front/OrderOpcController.php +++ b/controllers/front/OrderOpcController.php @@ -323,7 +323,7 @@ class OrderOpcControllerCore extends ParentOrderController 'genders' => Gender::getGenders(), )); /* Call a hook to display more information on form */ - self::$smarty->assign(array( + $this->context->smarty->assign(array( 'HOOK_CREATE_ACCOUNT_FORM' => Hook::exec('displayCustomerAccountForm'), 'HOOK_CREATE_ACCOUNT_TOP' => Hook::exec('displayCustomerAccountFormTop') )); diff --git a/controllers/front/StoresController.php b/controllers/front/StoresController.php index 79666bc28..386e904a4 100644 --- a/controllers/front/StoresController.php +++ b/controllers/front/StoresController.php @@ -136,7 +136,7 @@ class StoresControllerCore extends FrontController } $smarty->assign('days_datas', $days_datas); $smarty->assign('id_country', $store['id_country']); - return self::$smarty->fetch(_PS_THEME_DIR_.'store_infos.tpl'); + return $this->context->smarty->fetch(_PS_THEME_DIR_.'store_infos.tpl'); } return false; } From 3eeca3537af5829042a2f22f9e1404eee031e4d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Gaillard?= Date: Tue, 19 Feb 2013 16:38:52 +0100 Subject: [PATCH 4/7] // fix 2 links in admincustomers view --- .../template/controllers/customers/helpers/view/view.tpl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/admin-dev/themes/default/template/controllers/customers/helpers/view/view.tpl b/admin-dev/themes/default/template/controllers/customers/helpers/view/view.tpl index 68b709244..c857ea137 100644 --- a/admin-dev/themes/default/template/controllers/customers/helpers/view/view.tpl +++ b/admin-dev/themes/default/template/controllers/customers/helpers/view/view.tpl @@ -77,7 +77,7 @@
@@ -154,7 +154,7 @@

{l s='Groups'} ({count($groups)}) - +

From 4ce88468df38a4fefde43e79059d5b44122e286c Mon Sep 17 00:00:00 2001 From: sLorenzini Date: Wed, 20 Feb 2013 10:00:18 +0100 Subject: [PATCH 5/7] [-] BO: improve payment module page + header --- admin-dev/themes/default/css/admin.css | 23 +++++++++++++------ .../controllers/modules/tab_module_line.tpl | 10 ++++---- .../template/helpers/modules_list/list.tpl | 4 ++-- 3 files changed, 23 insertions(+), 14 deletions(-) diff --git a/admin-dev/themes/default/css/admin.css b/admin-dev/themes/default/css/admin.css index ea6d4c7a7..9af0264c5 100644 --- a/admin-dev/themes/default/css/admin.css +++ b/admin-dev/themes/default/css/admin.css @@ -47,7 +47,7 @@ input.button[disabled=disabled]:hover{background-color:#FFF6D3} #header #header_infos{ position:relative; margin: 0; padding:0; height:60px; } #header #header_shopname {float: left; margin:10px 15px 0 10px;} #header #employee_box {float: right; display:block;} -#header #employee_infos {display:block; margin:10px 15px 0 10px;} +#header #employee_infos {display:block; margin:5px 15px 0 10px;} #header #employee_infos a{color:#BABABA; text-transform:capitalize;margin-right: 5px} #header #employee_infos a:hover {color:#fff;} #header #employee_infos .employee_name { float:left; color:#fff;padding: 0 20px 0 0;} @@ -518,20 +518,30 @@ form#product_form h4 { font-size:18px; font-weight:normal;} #moduleContainer ul.listing-grid-module li select { position:absolute; top:0; right:0px; } /*TAB MODULES LIST*/ + +#modules_list_container_tab #modules_list_container_content{ + list-style-type:none; + padding:0; + margin:0; + white-space: nowrap; + overflow: auto; +} +#modules_list_container_tab #modules_list_container_content li{display:inline-block;} #modules_list_container_tab table tr th { height:40px;} #modules_list_container_tab table tr td { font-size:12px; padding: 3px 3px 3px; border-top:1px solid #ccc; border-bottom:none;} #modules_list_container_tab table tr td tr td {border: none} #modules_list_container_tab table tr:first-child {border-top:1px solid #ccc} +#modules_list_container_tab table td.tab_modules_actions_row {border-top:1px solid #ccc} #modules_list_container_tab .imgm {width:32px;} -#modules_list_container_tab .moduleDesc { font-size:12px;} -#modules_list_container_tab .moduleDesc h3 { color:#3A6EA7;margin: 0;font-size: 1.1em;text-align: left} +#modules_list_container_tab .moduleDesc { font-size:12px;width: 240px;} +#modules_list_container_tab .moduleDesc h3 { color:#3A6EA7;margin: 0;font-size: 1.1em;text-align: left;white-space: normal;} #modules_list_container_tab .moduleDesc .metadata { float:left; display:block; margin:5px 0;} #modules_list_container_tab .moduleDesc .metadata dl { float:left; margin:0; padding-right:10px;} #modules_list_container_tab .moduleDesc .metadata dl dt, .moduleDesc .metadata dl dd { float:left; margin:0; padding:0;} #modules_list_container_tab .moduleDesc .metadata dl dd { padding-right:10px;} #modules_list_container_tab .moduleDesc .metadata dl dt { font-weight:bold; padding-right:5px;} -#modules_list_container_tab .moduleDesc p.desc { color:#666; font-family: Georgia; font-style: italic; font-size:12px; display:block; clear:both;text-align: left} -#modules_list_container_tab .setup {background-color:#6db300; font-weight:bold; font-size:10px; color:#fff; text-transform:uppercase; position:relative; padding:2px 3px; display: inline-block; border-radius:3px;} +#modules_list_container_tab .moduleDesc p.desc { color:#666; font-family: Georgia; font-style: italic; font-size:12px; text-align: left;white-space: normal;} +#modules_list_container_tab .setup {background-color:#6db300; font-weight:bold; font-size:10px; color:#fff; text-transform:uppercase; position:relative; padding:2px 10px; display: inline-block; border-radius:3px;} #modules_list_container_tab .row-actions-module {float: right;} #modules_list_container_tab .setup.non-install { background-color:#ec7000;} #modules_list_container_tab .setup.must-have { background-color: #ec7000;} @@ -545,7 +555,7 @@ form#product_form h4 { font-size:18px; font-weight:normal;} #modules_list_container_tab ul.listing-grid-module li select { position:absolute; top:0; right:0px; } .default_modules_list_display_type #modules_list_container_content li table tr td{border: none} -.default_modules_list_display_type #modules_list_container_content li table {border: solid 1px #ccc; height: 115px} +.default_modules_list_display_type #modules_list_container_content li table {border: solid 1px #ccc; height: 140px;} #modules_list_container_tab ul li {margin:5px;height:140px} /*MODULE POSITION*/ @@ -636,4 +646,3 @@ ul.listForm li {padding-bottom:3px;} background: linear-gradient(top, #ddd, #aaa); color: #666 } - diff --git a/admin-dev/themes/default/template/controllers/modules/tab_module_line.tpl b/admin-dev/themes/default/template/controllers/modules/tab_module_line.tpl index 3a0f76fff..756547ffc 100644 --- a/admin-dev/themes/default/template/controllers/modules/tab_module_line.tpl +++ b/admin-dev/themes/default/template/controllers/modules/tab_module_line.tpl @@ -26,12 +26,12 @@ - +
- - - - - + \ No newline at end of file diff --git a/admin-dev/themes/default/template/helpers/modules_list/list.tpl b/admin-dev/themes/default/template/helpers/modules_list/list.tpl index be4a815ac..edbf3166c 100644 --- a/admin-dev/themes/default/template/helpers/modules_list/list.tpl +++ b/admin-dev/themes/default/template/helpers/modules_list/list.tpl @@ -27,11 +27,17 @@
    {if count($modules_list)} - {foreach from=$modules_list item=module} -
  • - {include file='controllers/modules/tab_module_line.tpl' class_row={cycle values=",row alt"}} -
  • - {/foreach} +
  • + {counter start=1 assign="count"} + {foreach from=$modules_list item=module} + {include file='controllers/modules/tab_module_line.tpl' class_row={cycle values=",row alt"}} + {if $count %2 == 0} +
  • +
  • + {/if} + {counter} + {/foreach} +
  • {else}
{/if} From 755573184cb2e6898645c717204cfa09a0b069de Mon Sep 17 00:00:00 2001 From: sLorenzini Date: Wed, 20 Feb 2013 11:35:50 +0100 Subject: [PATCH 7/7] [-] BO: improve payment module page on IE --- admin-dev/themes/default/css/admin.css | 12 +++++++++--- .../template/controllers/modules/tab_module_line.tpl | 6 +++--- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/admin-dev/themes/default/css/admin.css b/admin-dev/themes/default/css/admin.css index 2bf39e7b8..301846673 100644 --- a/admin-dev/themes/default/css/admin.css +++ b/admin-dev/themes/default/css/admin.css @@ -528,7 +528,6 @@ form#product_form h4 { font-size:18px; font-weight:normal;} height: 335px; } #modules_list_container_tab #modules_list_container_content li{display:inline-block;} -#modules_list_container_tab table{ margin-bottom:15px} #modules_list_container_tab table tr th { height:40px;} #modules_list_container_tab table tr td { font-size:12px; padding: 3px 3px 3px; border-top:1px solid #ccc; border-bottom:none;} #modules_list_container_tab table tr td tr td {border: none} @@ -543,7 +542,7 @@ form#product_form h4 { font-size:18px; font-weight:normal;} #modules_list_container_tab .moduleDesc .metadata dl dd { padding-right:10px;} #modules_list_container_tab .moduleDesc .metadata dl dt { font-weight:bold; padding-right:5px;} #modules_list_container_tab .moduleDesc p.desc { color:#666; font-family: Georgia; font-style: italic; font-size:12px; text-align: left;white-space: normal;} -#modules_list_container_tab .setup {background-color:#6db300; font-weight:bold; font-size:10px; color:#fff; text-transform:uppercase; position:relative; padding:2px 10px; display: inline-block; border-radius:3px;} +#modules_list_container_tab .setup {background-color:#6db300; font-weight:bold; font-size:10px; color:#fff; text-transform:uppercase; padding:2px 10px; display: inline-block; border-radius:3px;} #modules_list_container_tab .row-actions-module {float: right;} #modules_list_container_tab .setup.non-install { background-color:#ec7000;} #modules_list_container_tab .setup.must-have { background-color: #ec7000;} @@ -557,9 +556,16 @@ form#product_form h4 { font-size:18px; font-weight:normal;} #modules_list_container_tab ul.listing-grid-module li select { position:absolute; top:0; right:0px; } .default_modules_list_display_type #modules_list_container_content li table tr td{border: none} -.default_modules_list_display_type #modules_list_container_content li table {border: solid 1px #ccc; height: 140px;} +.default_modules_list_display_type #modules_list_container_content li table {border: solid 1px #ccc; height: 140px;width: 100%;margin-bottom:15px} #modules_list_container_tab ul li {margin:5px;height:140px} + /******** ie7 ******/ + .ie7 #modules_list_container_tab #modules_list_container_content li{zoom:1;display:inline;} + .ie7 #modules_list_container_content li table {width: 21%;} + .ie7 #modules_list_container_content li table td .btn_right{width:100%;float:right;} + .ie7 #modules_list_container_content li table td .btn_right select{float:left;} + .ie7 #modules_list_container_content li table td a.button{display:block;float:right;} + /*MODULE POSITION*/ .blocLiveEdit { float:right; clear:right; background-color: #EBEDF4; border: 1px solid #C2C4D9;display: block; width:250px;} .blocLiveEdit h2 { background: transparent url('../img/live_edit.png') no-repeat scroll 10px 10px; height: 40px; line-height: 50px;margin: 0; padding: 0 10px; text-indent: 40px;} diff --git a/admin-dev/themes/default/template/controllers/modules/tab_module_line.tpl b/admin-dev/themes/default/template/controllers/modules/tab_module_line.tpl index 21b85efa5..4bbace5b9 100644 --- a/admin-dev/themes/default/template/controllers/modules/tab_module_line.tpl +++ b/admin-dev/themes/default/template/controllers/modules/tab_module_line.tpl @@ -26,7 +26,7 @@
+ +

{$module->displayName|truncate:40:'…'} {$module->version} @@ -47,7 +47,7 @@

+ {if isset($module->id) && $module->id gt 0 } {if $module->active} {l s='Enabled'} @@ -63,7 +63,7 @@ {/if} +
{if isset($module->type) && $module->type == 'addonsMustHave'} diff --git a/admin-dev/themes/default/template/helpers/modules_list/list.tpl b/admin-dev/themes/default/template/helpers/modules_list/list.tpl index 2bab32eb1..be4a815ac 100644 --- a/admin-dev/themes/default/template/helpers/modules_list/list.tpl +++ b/admin-dev/themes/default/template/helpers/modules_list/list.tpl @@ -25,10 +25,10 @@

{l s='Modules list'}

-
    +
      {if count($modules_list)} {foreach from=$modules_list item=module} -
    • +
    • {include file='controllers/modules/tab_module_line.tpl' class_row={cycle values=",row alt"}}
    • {/foreach} From ae9b78dc0f7c83a00937acba3f33c81b34519c65 Mon Sep 17 00:00:00 2001 From: sLorenzini Date: Wed, 20 Feb 2013 11:08:20 +0100 Subject: [PATCH 6/7] [-] BO: improve module payment page --- admin-dev/themes/default/css/admin.css | 4 +- .../controllers/modules/tab_module_line.tpl | 101 +++++++++--------- .../template/helpers/modules_list/list.tpl | 16 ++- 3 files changed, 65 insertions(+), 56 deletions(-) diff --git a/admin-dev/themes/default/css/admin.css b/admin-dev/themes/default/css/admin.css index 9af0264c5..2bf39e7b8 100644 --- a/admin-dev/themes/default/css/admin.css +++ b/admin-dev/themes/default/css/admin.css @@ -525,15 +525,17 @@ form#product_form h4 { font-size:18px; font-weight:normal;} margin:0; white-space: nowrap; overflow: auto; + height: 335px; } #modules_list_container_tab #modules_list_container_content li{display:inline-block;} +#modules_list_container_tab table{ margin-bottom:15px} #modules_list_container_tab table tr th { height:40px;} #modules_list_container_tab table tr td { font-size:12px; padding: 3px 3px 3px; border-top:1px solid #ccc; border-bottom:none;} #modules_list_container_tab table tr td tr td {border: none} #modules_list_container_tab table tr:first-child {border-top:1px solid #ccc} #modules_list_container_tab table td.tab_modules_actions_row {border-top:1px solid #ccc} #modules_list_container_tab .imgm {width:32px;} -#modules_list_container_tab .moduleDesc { font-size:12px;width: 240px;} +#modules_list_container_tab .moduleDesc { font-size:12px;width: 238px;} #modules_list_container_tab .moduleDesc h3 { color:#3A6EA7;margin: 0;font-size: 1.1em;text-align: left;white-space: normal;} #modules_list_container_tab .moduleDesc .metadata { float:left; display:block; margin:5px 0;} #modules_list_container_tab .moduleDesc .metadata dl { float:left; margin:0; padding-right:10px;} diff --git a/admin-dev/themes/default/template/controllers/modules/tab_module_line.tpl b/admin-dev/themes/default/template/controllers/modules/tab_module_line.tpl index 756547ffc..21b85efa5 100644 --- a/admin-dev/themes/default/template/controllers/modules/tab_module_line.tpl +++ b/admin-dev/themes/default/template/controllers/modules/tab_module_line.tpl @@ -25,57 +25,58 @@ *}
- - - - \ No newline at end of file + + + +
- - -
-

{$module->displayName|truncate:40:'…'} {$module->version} - -

-

- {if isset($module->description) && $module->description ne ''} - {$module->description|truncate:100:'…'} +

+ + + + + + + - - - - - -
+ + +
+

{$module->displayName|truncate:40:'…'} {$module->version} + +

+

+ {if isset($module->description) && $module->description ne ''} + {$module->description|truncate:100:'…'} + {else} +   + {/if} +

+
+
+ {if isset($module->id) && $module->id gt 0 } + {if $module->active} + {l s='Enabled'} {else} -   + {l s='Disabled'} {/if} -

- -
- {if isset($module->id) && $module->id gt 0 } - {if $module->active} - {l s='Enabled'} {else} - {l s='Disabled'} + {if isset($module->type) && $module->type == 'addonsMustHave'} + {l s='Must Have'} + {else} + {l s='Not installed'} + {/if} + {/if} - {else} - {if isset($module->type) && $module->type == 'addonsMustHave'} - {l s='Must Have'} - {else} - {l s='Not installed'} - {/if} - - {/if} - -
- {if isset($module->type) && $module->type == 'addonsMustHave'} - -   {displayPrice price=$module->price currency=$module->id_currency} - {else if !isset($module->not_on_disk)} - {$module->optionsHtml} - Valider - {else} - {l s='Install'} - {/if} -
-
-
+
+ {if isset($module->type) && $module->type == 'addonsMustHave'} + +   {displayPrice price=$module->price currency=$module->id_currency} + {else if !isset($module->not_on_disk)} + {$module->optionsHtml} + Valider + {else} + {l s='Install'} + {/if} +
+
+
{l s='No modules available in this section.'}
- +
-
@@ -63,8 +63,8 @@ {/if} -
+
+
{if isset($module->type) && $module->type == 'addonsMustHave'}   {displayPrice price=$module->price currency=$module->id_currency}