Naughtyfox Posted January 24, 2014 Share Posted January 24, 2014 For example, add group name which a specific customer belongs to after logged in:Welcome, XXX Log out. You are (group name) I found some way to do it but these solutions works in older version I'm using prestashop 1.5.6.1 Im so newbie so plz explain it easly Thanks in advance.Sukho Link to comment Share on other sites More sharing options...
vekia Posted January 26, 2014 Share Posted January 26, 2014 you need to assign group object to smarty array in blockuserinfo module Top Hook 'group' => new Group($this->context->customer->id_default_group); Link to comment Share on other sites More sharing options...
Naughtyfox Posted January 26, 2014 Author Share Posted January 26, 2014 (edited) Can you explain which file should i edit?? and which line should i add to "'group' => new Group($this->context->customer->id_default_group);" sorry im so newbie Thanks for help Edited January 26, 2014 by Naughtyfox (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted January 26, 2014 Share Posted January 26, 2014 blockuserinfo.php in in hookdisplaytop module, you will see there smarty array, you have to pass this variable to this array then you will be able to use it in your front office, in blockuserinfo.tpl module Link to comment Share on other sites More sharing options...
Naughtyfox Posted January 26, 2014 Author Share Posted January 26, 2014 (edited) Hi thanks for quick reply I added "'group' => new Group($this->context->customer->id_default_group);" to php file so now its look like this now { if (!$this->active) return; $this->smarty->assign(array( 'cart' => $this->context->cart, 'cart_qties' => $this->context->cart->nbProducts(), 'logged' => $this->context->customer->isLogged(), 'customerName' => ($this->context->customer->logged ? $this->context->customer->firstname.' '.$this->context->customer->lastname : false), 'firstName' => ($this->context->customer->logged ? $this->context->customer->firstname : false), 'lastName' => ($this->context->customer->logged ? $this->context->customer->lastname : false), 'group' => new Group($this->context->customer->id_default_group), 'order_process' => Configuration::get('PS_ORDER_PROCESS_TYPE') ? 'order-opc' : 'order' )); return $this->display(__FILE__, 'blockuserinfo.tpl'); } but i dont know how should i add 'group' to tpl file. this is my tpl <p id="header_user_info"> {if $logged} <a href="{$link->getPageLink('my-account', true)}" class="account hidden-phone"><span>{$cookie->customer_firstname} {$cookie->customer_lastname}</span></a> <a href="{$link->getPageLink('index', true, NULL, "mylogout")}" title="{l s='Log me out' mod='blockuserinfo'}" class="logout">{l s='Log out' mod='blockuserinfo'}</a> {else} <a id="openloginform">{l s='Log In' mod='blockuserinfo'}</a> {l s='or' mod='blockuserinfo'} <a href="{$link->getPageLink('my-account', true)}" class="login">{l s='Create An Account' mod='blockuserinfo'}</a> {/if} </p> </div> So i tried to make <a href="{$link->getPageLink('my-account', true)}" class="account hidden-phone"><span>{$cookie->id_default_group}</span></a> i made this and <a href="{$link->getPageLink('my-account', true)}" class="account hidden-phone"><span>{$cookie->customer_group}</span></a> this. but both are not working.. Thanks for helping me and plz help this too.. sorry about doing dumb.. Edited January 26, 2014 by Naughtyfox (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted January 26, 2014 Share Posted January 26, 2014 you've got no $group variable use this: $group|print_r you will see all available variables to use Link to comment Share on other sites More sharing options...
gr_fenix Posted June 17, 2015 Share Posted June 17, 2015 you need to assign group object to smarty array in blockuserinfo module Top Hook 'group' => new Group($this->context->customer->id_default_group); Hi Vekia, where you take this name "id_default_group"? I like to have a list of all the contexts values. Thanks Link to comment Share on other sites More sharing options...
Recommended Posts