Intégration sensuel, barre de recherche et modification infomrations
login
This commit is contained in:
parent
731857719b
commit
89cfe1499d
@ -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');
|
||||
}
|
||||
}
|
||||
|
@ -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)
|
||||
|
@ -10,10 +10,8 @@
|
||||
</form>
|
||||
</div>
|
||||
<style>
|
||||
|
||||
#category #shop_category .shop_category_filter.horizontal .search {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#category #shop_category .shop_category_filter.horizontal .search {
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
{/if}
|
||||
|
@ -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();
|
||||
}
|
||||
|
@ -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%; }
|
||||
|
||||
|
@ -450,10 +450,19 @@
|
||||
|
||||
<!-- Header -->
|
||||
<div id="header">
|
||||
|
||||
<div class="content">
|
||||
<div class="top-upper">
|
||||
<div class="content-upper">
|
||||
|
||||
<span class='help_contact'><a href="{$base_dir_ssl}modules/ant_support/help.php">{l s='Aide et contact'}</a></span>
|
||||
|
||||
{$HOOK_TOP_UPPER}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="top">
|
||||
<div class="content">
|
||||
<span class='help_contact'><a href="{$base_dir_ssl}modules/ant_support/help.php">{l s='Aide et contact'}</a></span>
|
||||
<div class="content">
|
||||
{$HOOK_TOP}
|
||||
</div>
|
||||
</div>
|
||||
|
@ -24,64 +24,68 @@
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*}
|
||||
|
||||
<!-- Block user information module HEADER -->
|
||||
{if $page_name != 'authentication'}
|
||||
<div id="header_user">
|
||||
<!-- Block user information module HEADER -->
|
||||
{if $cookie->isLogged()}
|
||||
<div id="header_nav">
|
||||
<div class="inner">{l s='Bonjour' mod='blockuserinfo'}
|
||||
{if $cookie->id_lang == 3}
|
||||
<span>{$cookie->customer_firstname}!</span>
|
||||
{else}
|
||||
<span>{$cookie->customer_firstname} !</span>
|
||||
{/if}
|
||||
</div>
|
||||
<div class="inner">
|
||||
<ul>
|
||||
<li class="account_hover">
|
||||
<a class="submenu_top_btn" href="{$link->getPageLink('my-account.php', true)}" title="{l s='Your Account' mod='blockuserinfo'}">{l s='Your Account' mod='blockuserinfo'}</a>
|
||||
<ul class="submenu_top">
|
||||
<li><a href="{$link->getPageLink('history.php', true)}" title="{l s='Orders' mod='blockuserinfo'}">{l s='History and details of my orders' mod='blockuserinfo'}</a></li>
|
||||
<li><a href="{$link->getPageLink('identity.php', true)}" title="{l s='Information' mod='blockuserinfo'}">{l s='My personal information' mod='blockuserinfo'}</a></li>
|
||||
<li><a href="{$base_dir_ssl}modules/loyalty/loyalty-program.php" title="{l s='Loyalty program' mod='blockuserinfo'}">{l s='Loyalty program' mod='blockuserinfo'}</a></li>
|
||||
<li><a href="{$link->getPageLink('discount.php', true)}" title="{l s='Credit slips' mod='blockuserinfo'}">{l s='My credit slips' mod='blockuserinfo'}</a></li>
|
||||
<li><a title="Referral program" href="{$base_dir_ssl}modules/invite/invite-program.php">{l s='Programme de parrainage' mod='blockuserinfo'}</a></li>
|
||||
<li class="logout">
|
||||
<a href="{$link->getPageLink('index.php')}?mylogout" title="{l s='Log me out' mod='blockuserinfo'}">{l s='Log out' mod='blockuserinfo'}</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
{if $display_credits}
|
||||
<div class="inner">
|
||||
{* {if $cookie->id_lang == 3}
|
||||
<a class="credit" href="{$base_dir_ssl}modules/invite/invite-program.php" title="{l s='Sponsor your friends' mod='blockuserinfo'}">
|
||||
<span class="desc">{l s='Your credit:' mod='blockuserinfo'} <span class="green">{$customer_credit}</span></span>
|
||||
</a>
|
||||
{else} *}
|
||||
<ul>
|
||||
<li class="account_hover">
|
||||
<a class="submenu_top_btn credit" href="{$base_dir_ssl}modules/invite/invite-program.php" title="{l s='Sponsor your friends' mod='blockuserinfo'}">{l s='Your credit' mod='blockuserinfo'}</a>
|
||||
<ul class="submenu_top">
|
||||
<li>
|
||||
<a href="{$base_dir_ssl}modules/invite/invite-program.php" title="{l s='Sponsor your friends' mod='blockuserinfo'}">
|
||||
<span class="desc">{l s='Your credit:' mod='blockuserinfo'} <span class="green">{$customer_credit}</span></span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="{$base_dir_ssl}modules/loyalty/loyalty-program.php" title="{l s='Loyalty program' mod='blockuserinfo'}">
|
||||
<span class="desc">{l s='Loyalty:' mod='blockuserinfo'} <span class="green">{convertPrice price=$loyalties}</span></span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
{/if}
|
||||
</div>
|
||||
{* {/if} *}
|
||||
{if $onlyForm == false}
|
||||
<div id="header_user">
|
||||
<div id="header_nav">
|
||||
<div class="inner">{l s='Bonjour' mod='blockuserinfo'}
|
||||
{if $cookie->id_lang == 3}
|
||||
<span>{$cookie->customer_firstname}!</span>
|
||||
{else}
|
||||
<span>{$cookie->customer_firstname} !</span>
|
||||
{/if}
|
||||
</div>
|
||||
<div class="inner">
|
||||
<ul>
|
||||
<li class="account_hover">
|
||||
<a class="submenu_top_btn" href="{$link->getPageLink('my-account.php', true)}" title="{l s='Your Account' mod='blockuserinfo'}">{l s='Your Account' mod='blockuserinfo'}</a>
|
||||
<ul class="submenu_top">
|
||||
<li><a href="{$link->getPageLink('history.php', true)}" title="{l s='Orders' mod='blockuserinfo'}">{l s='History and details of my orders' mod='blockuserinfo'}</a></li>
|
||||
<li><a href="{$link->getPageLink('identity.php', true)}" title="{l s='Information' mod='blockuserinfo'}">{l s='My personal information' mod='blockuserinfo'}</a></li>
|
||||
<li><a href="{$base_dir_ssl}modules/loyalty/loyalty-program.php" title="{l s='Loyalty program' mod='blockuserinfo'}">{l s='Loyalty program' mod='blockuserinfo'}</a></li>
|
||||
<li><a href="{$link->getPageLink('discount.php', true)}" title="{l s='Credit slips' mod='blockuserinfo'}">{l s='My credit slips' mod='blockuserinfo'}</a></li>
|
||||
<li><a title="Referral program" href="{$base_dir_ssl}modules/invite/invite-program.php">{l s='Programme de parrainage' mod='blockuserinfo'}</a></li>
|
||||
<li class="logout">
|
||||
<a href="{$link->getPageLink('index.php')}?mylogout" title="{l s='Log me out' mod='blockuserinfo'}">{l s='Log out' mod='blockuserinfo'}</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
{if $display_credits}
|
||||
<div class="inner">
|
||||
{* {if $cookie->id_lang == 3}
|
||||
<a class="credit" href="{$base_dir_ssl}modules/invite/invite-program.php" title="{l s='Sponsor your friends' mod='blockuserinfo'}">
|
||||
<span class="desc">{l s='Your credit:' mod='blockuserinfo'} <span class="green">{$customer_credit}</span></span>
|
||||
</a>
|
||||
{else} *}
|
||||
<ul>
|
||||
<li class="account_hover">
|
||||
<a class="submenu_top_btn credit" href="{$base_dir_ssl}modules/invite/invite-program.php" title="{l s='Sponsor your friends' mod='blockuserinfo'}">{l s='Your credit' mod='blockuserinfo'}</a>
|
||||
<ul class="submenu_top">
|
||||
<li>
|
||||
<a href="{$base_dir_ssl}modules/invite/invite-program.php" title="{l s='Sponsor your friends' mod='blockuserinfo'}">
|
||||
<span class="desc">{l s='Your credit:' mod='blockuserinfo'} <span class="green">{$customer_credit}</span></span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="{$base_dir_ssl}modules/loyalty/loyalty-program.php" title="{l s='Loyalty program' mod='blockuserinfo'}">
|
||||
<span class="desc">{l s='Loyalty:' mod='blockuserinfo'} <span class="green">{convertPrice price=$loyalties}</span></span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
{/if}
|
||||
</div>
|
||||
{* {/if} *}
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
{else}
|
||||
<div id="header_user">
|
||||
<form id="login_form_top" method="post" action="{$link->getPageLink('authentication.php')}">
|
||||
<fieldset>
|
||||
<p class="title">{l s='Accès membre' mod='blockuserinfo'}</p>
|
||||
@ -98,7 +102,7 @@
|
||||
<a class="forgot" href="{$link->getPageLink('password.php')}">{l s='Mot de passe oublié ?' mod='blockuserinfo'}</a>
|
||||
</fieldset>
|
||||
</form>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
<!-- /Block user information module HEADER -->
|
||||
{/if}
|
||||
|
Loading…
Reference in New Issue
Block a user