5haun Posted November 22, 2013 Share Posted November 22, 2013 (edited) Hi all, Okay so what I need to do is exactly what this user said in the old thread:http://www.prestashop.com/forums/topic/34684-how-to-move-user-info-block-from-header-of-pages-to-the-right-side/I want to move it above the cart block but I don't really understand how to do it. Can anyone please eleborate futher on the steps to do this? Thanks Edited November 25, 2013 by 5haun (see edit history) Link to comment Share on other sites More sharing options...
Urbanfarmer Posted November 22, 2013 Share Posted November 22, 2013 Hello....I'm not advanced, but I was able to move the user info block around by changing and/or adding values to blockcart css. I first used Firebug to experiment and find which mods were necessary, and where. I then made the mods in my default css. Try it out...... Link to comment Share on other sites More sharing options...
vekia Posted November 24, 2013 Share Posted November 24, 2013 open module .php file and before last bracket } add this code: public function hookRightColumn($params) { 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), 'order_process' => Configuration::get('PS_ORDER_PROCESS_TYPE') ? 'order-opc' : 'order' )); return $this->display(__FILE__, 'blockuserinfo.tpl'); } go to modules > positions then click on green "transplant" button from first dropdown select: block user info module from second dropdown select right column save changes. Voila! remember to remove userinfo block from displayTop (attention! displayTop not displayHeader!) Link to comment Share on other sites More sharing options...
5haun Posted November 25, 2013 Author Share Posted November 25, 2013 open module .php file and before last bracket } add this code: public function hookRightColumn($params) { 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), 'order_process' => Configuration::get('PS_ORDER_PROCESS_TYPE') ? 'order-opc' : 'order' )); return $this->display(__FILE__, 'blockuserinfo.tpl'); } go to modules > positions then click on green "transplant" button from first dropdown select: block user info module from second dropdown select right column save changes. Voila! remember to remove userinfo block from displayTop (attention! displayTop not displayHeader!) Thank you Milos! Solved once again Link to comment Share on other sites More sharing options...
vekia Posted November 25, 2013 Share Posted November 25, 2013 ok, but i've got question now when you adding products to cart, does the cart works well? i mean you see products after adding products to cart? Link to comment Share on other sites More sharing options...
5haun Posted December 19, 2013 Author Share Posted December 19, 2013 Yes they work well Link to comment Share on other sites More sharing options...
vekia Posted December 19, 2013 Share Posted December 19, 2013 ok, thank you so much for confirmation i really appreciate it with regards, Milos Link to comment Share on other sites More sharing options...
Enoteca Posted February 9, 2014 Share Posted February 9, 2014 open module .php file and before last bracket } add this code: public function hookRightColumn($params) { 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), 'order_process' => Configuration::get('PS_ORDER_PROCESS_TYPE') ? 'order-opc' : 'order' )); return $this->display(__FILE__, 'blockuserinfo.tpl'); } go to modules > positions then click on green "transplant" button from first dropdown select: block user info module from second dropdown select right column save changes. Voila! remember to remove userinfo block from displayTop (attention! displayTop not displayHeader!) I'm using latest version of PS and the above code is already inside the php file. Then I tried to hook it to the right column but it says that this module cannot be moved there. Solution? Link to comment Share on other sites More sharing options...
vekia Posted February 9, 2014 Share Posted February 9, 2014 I'm using latest version of PS and the above code is already inside the php file. Then I tried to hook it to the right column but it says that this module cannot be moved there. Solution? i checked latest module core but i can't find this code inside ... Link to comment Share on other sites More sharing options...
Enoteca Posted February 9, 2014 Share Posted February 9, 2014 Thanks for looking into this. The code is there, trust me (I nstalled PS today). I also believe you are contradicting yourself by saying that the module can be moved to the right column, because in this 3D you are saying the opposite: http://www.prestashop.com/forums/topic/268565-solved-login-move-from-top-of-page/ So where's the truth and where can I find a real "customer login module"? The many I found are either too old or bug filled. Link to comment Share on other sites More sharing options...
vekia Posted February 10, 2014 Share Posted February 10, 2014 original blockuserinfo.php file (from latest release of ps) <?php /* * 2007-2013 PrestaShop * * NOTICE OF LICENSE * * This source file is subject to the Academic Free License (AFL 3.0) * that is bundled with this package in the file LICENSE.txt. * It is also available through the world-wide-web at this URL: * http://opensource.org/licenses/afl-3.0.php * If you did not receive a copy of the license and are unable to * obtain it through the world-wide-web, please send an email * to [email protected] so we can send you a copy immediately. * * DISCLAIMER * * Do not edit or add to this file if you wish to upgrade PrestaShop to newer * versions in the future. If you wish to customize PrestaShop for your * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA <[email protected]> * @copyright 2007-2013 PrestaShop SA * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) * International Registered Trademark & Property of PrestaShop SA */ if (!defined('_PS_VERSION_')) exit; class BlockUserInfo extends Module { public function __construct() { $this->name = 'blockuserinfo'; $this->tab = 'front_office_features'; $this->version = 0.1; $this->author = 'PrestaShop'; $this->need_instance = 0; parent::__construct(); $this->displayName = $this->l('User info block'); $this->description = $this->l('Adds a block that displays information about the customer.'); } public function install() { return (parent::install() AND $this->registerHook('top') AND $this->registerHook('header')); } /** * Returns module content for header * * @param array $params Parameters * @return string Content */ public function hookTop($params) { 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), 'order_process' => Configuration::get('PS_ORDER_PROCESS_TYPE') ? 'order-opc' : 'order' )); return $this->display(__FILE__, 'blockuserinfo.tpl'); } public function hookHeader($params) { $this->context->controller->addCSS(($this->_path).'blockuserinfo.css', 'all'); } } so i just wondering how it is possible that you've got this code with default module ... you, or someone else, added it ? or what? Link to comment Share on other sites More sharing options...
Enoteca Posted February 10, 2014 Share Posted February 10, 2014 My fiend I'm not following you. You are confirming that is the code inside blockuserinfo.php and then wonder who put it there? Now let's assume PS developers did it.... how can I move the user info block to the right column? Link to comment Share on other sites More sharing options...
vekia Posted February 10, 2014 Share Posted February 10, 2014 You are confirming that is the code inside blockuserinfo.php i never said that, i never confirmed that. this code doesn't exist in blockuserinfo.php file and i checked also github resources, there is no code you mentioned. Link to comment Share on other sites More sharing options...
Enoteca Posted February 10, 2014 Share Posted February 10, 2014 English is not my language but you said original blockuserinfo.php file (from latest release of ps) an that to me means "the code is taken from the latest version of PS". Then I'm telling you the code is like that, and to prove it I'm attaching the file. See for yourself, really! Now, we can continue going on like this forever, the fact is the problem of moving the infoblock goes unsolved to me blockuserinfo.php Link to comment Share on other sites More sharing options...
vekia Posted February 10, 2014 Share Posted February 10, 2014 sorry, there is no code that i suggested to use. this is why it doesn't work. open this file once again and search for public function hookRightColumn($params) { 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), 'order_process' => Configuration::get('PS_ORDER_PROCESS_TYPE') ? 'order-opc' : 'order' )); return $this->display(__FILE__, 'blockuserinfo.tpl'); } it doesn't exist there Link to comment Share on other sites More sharing options...
tami691 Posted March 4, 2015 Share Posted March 4, 2015 Hi Milos, I followed your advice, added the missing function in blockuserinfo.php, added the transplant but nothing shows up in the right column of our site. I thought the problem was the original install function that was: public function install() { return (parent::install() && $this->registerHook('displayTop') && $this->registerHook('displayNav') && $this->registerHook('displayHeader')); } so I changed it to: public function install() { return (parent::install() && $this->registerHook('displayTop') && $this->registerHook('displayNav') && $this->registerHook('displayHeader') && $this->registerHook('displayRightColumn')); } Then I tried removing the transplant and applying it again, but no luck. Can you help me please? Thanks. Tami Link to comment Share on other sites More sharing options...
breda_Mcg Posted June 19, 2015 Share Posted June 19, 2015 open module .php file and before last bracket } add this code: public function hookRightColumn($params) { 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), 'order_process' => Configuration::get('PS_ORDER_PROCESS_TYPE') ? 'order-opc' : 'order' )); return $this->display(__FILE__, 'blockuserinfo.tpl'); } go to modules > positions then click on green "transplant" button from first dropdown select: block user info module from second dropdown select right column save changes. Voila! remember to remove userinfo block from displayTop (attention! displayTop not displayHeader!) Hi Vekia I am trying to move the Currency drop down module form the Nav bar into the right colum. I'm using the default bootstrap theme on presta shop 1.6.0. I think I might be looking at the wrong file? I opened module.php locled at root/ classes/module. When I paste the code in to this page that you provided above it just gives a white page. Cna you tell me the location of the module.php that needs to be edited? thanks Breda Link to comment Share on other sites More sharing options...
breda_Mcg Posted June 24, 2015 Share Posted June 24, 2015 Hi Vekia Could you please help with this problem? I am trying to move the Currency drop down module form the Nav bar into the right colum. I'm using the default bootstrap theme on presta shop 1.6.0. I think I might be looking at the wrong file? I opened module.php locled at root/ classes/module. When I paste the code in to this page that you provided above it just gives a white page. Can you tell me the location of the module.php that needs to be edited? thanks Breda Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now