diff --git a/modules/blockuserinfo/blockuserinfo.php b/modules/blockuserinfo/blockuserinfo.php index 649c616a..1acf02f2 100755 --- a/modules/blockuserinfo/blockuserinfo.php +++ b/modules/blockuserinfo/blockuserinfo.php @@ -30,7 +30,9 @@ if (!defined('_PS_VERSION_')) class BlockUserInfo extends Module { - public function __construct() + private $useTopUpper = true; + + public function __construct() { $this->name = 'blockuserinfo'; $this->tab = 'front_office_features'; @@ -46,9 +48,55 @@ class BlockUserInfo extends Module public function install() { - return (parent::install() AND $this->registerHook('top')); + return (parent::install() + && $this->registerHook('top') + && $this->registerHook('displayTopUpper') + ); } + /** + * Add content before header + * + * @param array $params + * @return string + */ + public function hookDisplayTopUpper($params) + { + if (!$this->active) { + return; + } + + global $smarty, $cookie, $cart; + + if (!$cookie->logged) { + return; + } + + $display_credits = true; + $sql = 'SELECT id_customer FROM `'._DB_PREFIX_.'customer_credits` WHERE id_customer = ' .(int) $cookie->id_customer; + if(Db::getInstance()->getValue($sql)){ + $display_credits = false; + } + + $sql = 'SELECT SUM(`discount_value`) FROM `'._DB_PREFIX_.'loyalty` WHERE `id_loyalty_state`=2 AND `id_discount`=0 AND `id_customer` = ' .(int) $cookie->id_customer; + $loyalties = Db::getInstance()->getValue($sql); + + $smarty->assign(array( + 'onlyForm' => !$this->useTopUpper, + 'display_credits' => $display_credits, + 'loyalties' => ($loyalties)?$loyalties:0, + 'cart' => $cart, + 'cart_qties' => $cart->nbProducts(), + 'logged' => $cookie->isLogged(), + 'customerName' => ($cookie->logged ? $cookie->customer_firstname.' '.$cookie->customer_lastname : false), + 'firstName' => ($cookie->logged ? $cookie->customer_firstname : false), + 'lastName' => ($cookie->logged ? $cookie->customer_lastname : false), + 'order_process' => Configuration::get('PS_ORDER_PROCESS_TYPE') ? 'order-opc' : 'order' + )); + + return $this->display(__FILE__, 'blockuserinfo.tpl'); + } + /** * Returns module content for header * @@ -59,19 +107,22 @@ class BlockUserInfo extends Module { if (!$this->active) return; + global $smarty, $cookie, $cart; $display_credits = true; - $sql = 'SELECT id_customer FROM `'._DB_PREFIX_.'customer_credits` WHERE id_customer = ' .(int) $cookie->id_customer; - if(Db::getInstance()->getValue($sql)){ - $display_credits = false; + if ($cookie->logged) { + $sql = 'SELECT id_customer FROM `'._DB_PREFIX_.'customer_credits` WHERE id_customer = ' .(int) $cookie->id_customer; + if(Db::getInstance()->getValue($sql)){ + $display_credits = false; + } + + $sql = 'SELECT SUM(`discount_value`) FROM `'._DB_PREFIX_.'loyalty` WHERE `id_loyalty_state`=2 AND `id_discount`=0 AND `id_customer` = ' .(int) $cookie->id_customer; + $loyalties = Db::getInstance()->getValue($sql); } - - - $sql = 'SELECT SUM(`discount_value`) FROM `'._DB_PREFIX_.'loyalty` WHERE `id_loyalty_state`=2 AND `id_discount`=0 AND `id_customer` = ' .(int) $cookie->id_customer; - $loyalties = Db::getInstance()->getValue($sql); - + $smarty->assign(array( + 'onlyForm' => !$this->useTopUpper, 'display_credits' => $display_credits, 'loyalties' => ($loyalties)?$loyalties:0, 'cart' => $cart, @@ -82,6 +133,7 @@ class BlockUserInfo extends Module 'lastName' => ($cookie->logged ? $cookie->customer_lastname : false), 'order_process' => Configuration::get('PS_ORDER_PROCESS_TYPE') ? 'order-opc' : 'order' )); + return $this->display(__FILE__, 'blockuserinfo.tpl'); } } diff --git a/modules/sensefuel/sensefuel.php b/modules/sensefuel/sensefuel.php index 478f9d08..56ff6f66 100644 --- a/modules/sensefuel/sensefuel.php +++ b/modules/sensefuel/sensefuel.php @@ -38,11 +38,12 @@ class SenseFuel extends Module public function hookTop($params) { - /* if(_PS_MOBILE_){ return false; } + global $site_version, $page_name; + if (null !== $site_version && null !== $page_name && in_array($site_version, self::$ACTIVE_VERSION_ARRAY, true) && @@ -61,7 +62,6 @@ class SenseFuel extends Module } return false; - */ } public function hookSubTop($params) diff --git a/modules/sensefuel/views/top-sensefuel.tpl b/modules/sensefuel/views/top-sensefuel.tpl index fa230e8f..5b1e2ec1 100644 --- a/modules/sensefuel/views/top-sensefuel.tpl +++ b/modules/sensefuel/views/top-sensefuel.tpl @@ -10,10 +10,8 @@ {/if} diff --git a/override/classes/FrontController.php b/override/classes/FrontController.php index 8cb70643..9bc381ee 100755 --- a/override/classes/FrontController.php +++ b/override/classes/FrontController.php @@ -14,6 +14,7 @@ class FrontController extends FrontControllerCore { { self::$smarty->assign(array( 'HOOK_TOP_MENU' => Module::hookExec('topMenu'), + 'HOOK_TOP_UPPER' => Module::hookExec('displayTopUpper'), )); parent::displayHeader(); } diff --git a/themes/site/css/style.css b/themes/site/css/style.css index 3ec82724..cefbb119 100755 --- a/themes/site/css/style.css +++ b/themes/site/css/style.css @@ -1758,6 +1758,9 @@ body#page-404 .footer_links { -o-box-shadow: 0px 4px 4px #bfbcb4; box-shadow: 0px 4px 4px #bfbcb4; } +#header > .content > .top { + clear: both; +} #header > .content > .top .block ul li { margin: 5px 0 0 0; } @@ -1779,6 +1782,12 @@ body#page-404 .footer_links { height: 84px; position: relative; } +#header > .content > .top-upper > .content-upper { + width: 980px; + margin: 0px auto; + padding-top: 6px; + position: relative; +} #header > .content > .top > .content .logo_block { float: left; height: 70px; @@ -5527,9 +5536,10 @@ body .top #header_user { body.logged #header_user { clear: none; display: block; - float: left; - margin-left: 165px; - margin-top: 35px; + float: right; + margin-right: 10px; + /*margin-left: 165px;*/ + /*margin-top: 35px;*/ min-width: 270px; } .help_contact { @@ -5595,7 +5605,7 @@ body.logged #header_user { color: #4f4f4f; float: left; margin-left: 10px; - padding-top: 15px; + /*padding-top: 15px;*/ } #header_nav .inner > ul { margin: 0; padding: 0; } #header_nav .inner > ul li { @@ -5664,7 +5674,7 @@ body.nav_active #header_nav .inner a.submenu_top_btn { z-index: 2;} padding-left: 45px; padding-right: 10px; position: relative; - z-index: 100001; + z-index: 99998; } body.nav_active .top #cart_block_summary { z-index: 6;} .top #cart_block_summary.active { border-color:#ccc;} @@ -7553,6 +7563,53 @@ div.addresses ul.address.item { #discount .discount .alternate_item{ background: #F3F3F3; } -.ant_support{ +.ant_support { padding:0px!important; } + +#sensefuel { + display: inline-block; + vertical-align: top; + width: 50%; + float: left; + padding-left: 20px; + font-family: 'Source Sans Pro', Helvetica, Arial, sans-serif; } + @media (min-width: 1350px) { + #sensefuel { + width: 50%; } } + @media (min-width: 1024px) and (max-width: 1349px) { + #sensefuel { + width: 50%; } } + #sensefuel .search .search_form { + padding-top: 20px; } + #sensefuel .search .search_form .search_input { + display: block; + float: left; + background: #fff; + color: #000; + padding: 5px 0 5px 10px; + border-top-left-radius: 8px; + border-bottom-left-radius: 8px; + /*font-size: 15px;*/ + line-height: 28px; + width: 80%; } + #sensefuel .search .search_form a.search_submit { + display: block; + float: left; + background: #70bc2c; + border-top-right-radius: 8px; + border-bottom-right-radius: 8px; + height: 32px; + width: 15%; } + #sensefuel .search .search_form a.search_submit:hover { + -moz-transition: background 0.5s ease; + -o-transition: background 0.5s ease; + -webkit-transition: background 0.5s ease; + transition: background 0.5s ease; + background: #70bc2c; } + #sensefuel .search .search_form a.search_submit span.picto { + display: block; + background: url(../img/white_magnifier.png) no-repeat scroll center center transparent; + height: 32px; + width: 100%; } + diff --git a/themes/site/header.tpl b/themes/site/header.tpl index 27f0d5f1..01116a75 100755 --- a/themes/site/header.tpl +++ b/themes/site/header.tpl @@ -450,10 +450,19 @@