webbusiness23 Posted November 17, 2009 Share Posted November 17, 2009 Hi,i need to move the "User info block" (which is located in the header) just above the cart (which is located in the right side).I read other threads related to moving modules and i did this:BO --> Modules --> Positionsand i moved the "User info block" from header in the right side. After that, i deleted the "User info block" from header, but the above steps were not successful because the user info block never appeared in the right side.There's a picture attached showing exactly what i need to do.Any suggestions? Thanks! Link to comment Share on other sites More sharing options...
ladivito Posted November 30, 2009 Share Posted November 30, 2009 Hi,this is what i'm looking ~ lol but i'll put a mini search box at the top then following by the User info block then only blockcart.....anyone help ? Link to comment Share on other sites More sharing options...
rocky Posted December 1, 2009 Share Posted December 1, 2009 The user info block was designed only to be positioned at the top of the page, not in a column. You will need to modify modules/blockuserinfo/blockuserinfo.php and add the following code before the last }: function hookRightColumn($params) { global $smarty, $cookie, $cart; $smarty->assign(array( '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) )); return $this->display(__FILE__, 'blockuserinfo-column.tpl'); } Then copy blockuserinfo.tpl to blockuserinfo-column.tpl and modify it to become a block. Have a look at another module for guidance. You should add class="block" to the div, a h4 for the heading and a div class="block_content" around the content of the module. Link to comment Share on other sites More sharing options...
ladivito Posted December 4, 2009 Share Posted December 4, 2009 This is the files that i had follow your instruction.After that i had create a file blockuserinfo-column.tpl without modify as a block. i didnt modify to as a block it is because i want it to be like that to hook at the top right column there then i uninstall and install again BUT it is not working. it is still at the top thereCan you plz let me know where i missed ? Thanks <?php class BlockUserInfo extends Module { function __construct() { $this->name = 'blockuserinfo'; $this->tab = 'Blocks'; $this->version = 0.1; parent::__construct(); $this->displayName = $this->l('User info block'); $this->description = $this->l('Adds a block that displays information about the customer'); } function install() { if (!parent::install()) return false; if (!$this->registerHook('top')) return false; return true; } /** * Returns module content for header * * @param array $params Parameters * @return string Content */ function hookTop($params) { global $smarty, $cookie, $cart; $smarty->assign(array( '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) )); return $this->display(__FILE__, 'blockuserinfo.tpl'); } function hookRightColumn($params) { global $smarty, $cookie, $cart; $smarty->assign(array( '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) )); return $this->display(__FILE__, 'blockuserinfo-column.tpl'); } } ?> Link to comment Share on other sites More sharing options...
rocky Posted December 4, 2009 Share Posted December 4, 2009 The install function is putting the module in the 'top' hook. You need to go to Modules > Positions and transplant the module to the right column. Link to comment Share on other sites More sharing options...
ladivito Posted December 4, 2009 Share Posted December 4, 2009 i had transplant the module to the right and it is overlap the blocksearch..... then by creating a block it wont cover the "Cart" and "your account" into the blockWhere did i mistake ? Link to comment Share on other sites More sharing options...
rocky Posted December 4, 2009 Share Posted December 4, 2009 That's why you need to rewrite the code in blockuserinfo-column.tpl to make it a block, so it won't overlap other modules. If you don't turn it into a block, you'll need to modify the /* block top user information */ section of global.css to fix the overlapping issue. Link to comment Share on other sites More sharing options...
ladivito Posted December 4, 2009 Share Posted December 4, 2009 my block is done by adding <!-- Block user information module HEADER --> {l s='User Info Block'} your code here....................xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx <!-- /Block user information module HEADER --> Link to comment Share on other sites More sharing options...
Riz Sedek Posted December 4, 2009 Share Posted December 4, 2009 Ok I have a question. I would also like to move modules. So I went to modules > positions > and clicked on one (any one). The drop down menus are there, but they are not clickable or selectable. What am I doing wrong? Link to comment Share on other sites More sharing options...
ladivito Posted December 4, 2009 Share Posted December 4, 2009 u hv to click on the "transplant" to copy to another location and delete the existing one ~ Link to comment Share on other sites More sharing options...
jaykay2012 Posted January 24, 2010 Share Posted January 24, 2010 Hiya all,This is what i'm trying to achieve for my store but think i've messed things up a bit now and can't transpalnt the user info back into the origional place. What i'd like still is to have the user info in the right hand column at the top like discussed in this forum.I understand what is being said that I need to change the code to create a midule box but i'm not able to do this withour help at the moment. Am getting there with PS but need some help with creating the module.Has anyone who has made these changes able to put their fully modified blockuserinfo.tpl & blockuserinfo.php file content in this post for me to read and make changes to my files.See my store sofar at http://www.hydroflora.co.ukThanks in advance, without the community I wouldn't of got as far as i have now:)JayKay Link to comment Share on other sites More sharing options...
ladivito Posted January 24, 2010 Share Posted January 24, 2010 Hiya all,This is what i'm trying to achieve for my store but think i've messed things up a bit now and can't transpalnt the user info back into the origional place. What i'd like still is to have the user info in the right hand column at the top like discussed in this forum.I understand what is being said that I need to change the code to create a midule box but i'm not able to do this withour help at the moment. Am getting there with PS but need some help with creating the module.Has anyone who has made these changes able to put their fully modified blockuserinfo.tpl & blockuserinfo.php file content in this post for me to read and make changes to my files.See my store sofar at http://www.hydroflora.co.ukThanks in advance, without the community I wouldn't of got as far as i have now:)JayKay I like your slide at the top right....how do u do that ?to move your block from top to right side just follow the code as show at above.....i'm not able to move the picture in blockuserinfo into a new block so i just delete the picture and maintain the "text".... Link to comment Share on other sites More sharing options...
jaykay2012 Posted January 24, 2010 Share Posted January 24, 2010 The page corner peel is a mod from this forum. I just cant work out how to follow the code. If you could send me copies of your 2 files that need updating so that I can take a look if you have done this i'd appreciate it. If you need any help with the page peel mod i'd be happy to help in return. Just send me the small and big images that you want in there. 100px X 100px Small & 500px X 500px Large.Thanks for the reply.Jay Kay Link to comment Share on other sites More sharing options...
ladivito Posted January 25, 2010 Share Posted January 25, 2010 i'm no longer using the block to hook at the right side.....so had deleted the code......PM me your email so i can send you the modification log..... Link to comment Share on other sites More sharing options...
htech Posted January 28, 2011 Share Posted January 28, 2011 hi,need help with the positioning topic of the UserInfo Block....struggling to figure this out...if anyone can point me in the right direction See attached picture...looking to move that info from the RED block to the yellow Block.. Link to comment Share on other sites More sharing options...
rizzledon Posted February 3, 2012 Share Posted February 3, 2012 The user info block was designed only to be positioned at the top of the page, not in a column. You will need to modify modules/blockuserinfo/blockuserinfo.php and add the following code before the last }: function hookRightColumn($params) { global $smarty, $cookie, $cart; $smarty->assign(array( '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) )); return $this->display(__FILE__, 'blockuserinfo-column.tpl'); } Then copy blockuserinfo.tpl to blockuserinfo-column.tpl and modify it to become a block. Have a look at another module for guidance. You should add class="block" to the div, a h4 for the heading and a div class="block_content" around the content of the module. Hey rocky, Is this code still relevant for 1.4.6.2?? Link to comment Share on other sites More sharing options...
prestaZ Posted March 7, 2012 Share Posted March 7, 2012 Dear all, I would like to move the cart - which is apparently linked to block user info - from header to right column, like in image "Original condition". I followed the steps as above, added the code to blockuserinfo.php, copied blockuserinfo.tpl to blockuserinfo-column.tpl and added the classes to it. Then I transplated the module in backoffce and deleted it from header in positions. Now what I get is what is shown in image "Current condition". The ajax cart is expanding nicely where it should, but the cart itself does not look the same as previously (with background image etc). I get the text only. What should I do to look it the same as previously, but be in the right column? [using Prestashop 1.4.7.0, New template.] Link to comment Share on other sites More sharing options...
prestaZ Posted March 9, 2012 Share Posted March 9, 2012 OK, i figured it out. As following, for those who might be interested. 1. Add the code in blockuserinfo.php as mentioned above. 2. Copy blockuserinfo.tpl to blockuserinfo-column.tpl under your theme (as mentioned above). 3. In back office, transplant User info block module from Top pages (delete) to Right column. Then, transplant Prestashop New theme Cart block v1.2 from Top pages (delete) to Right column. Move both modules to top of Right column under Positions. 4. I changed some code so that the Welcome, Login text comes before the cart. So, in blockuserinfo-column.tpl move <p...> for "Welcome,Login" before the cart part. Add a <div style="clear:both"></div> after the last </div>. -> This will separate the block from the next module in the column. Because at first it looks like the cart and user info is within the title of the next module in the column. You should clear cache + complile at this point to see the changes. 5. In blockuserinfo.css (your theme/css/modules) add "margin-bottom:10px;" under /*cart*/. -> This will create some space between the cart and next module in the column. 6. Change "margin-top:10px;" to "margin-bottom:10px;" under /*user infos*/. -> This will create some space between the Welcome, Login text and the cart image. It looks fine for me now. Hope this can help somebody, too. It was not necessary for me to modify blockuserinfo-column.tpl into a block - it worked without it. I am not an expert in these things, maybe somebody has a better description / solution, too. 1 Link to comment Share on other sites More sharing options...
AnitaR Posted January 8, 2013 Share Posted January 8, 2013 I realise this is n old topic, but can I get help with this? I need to getmy webshop live i 3 weeks.. and need to get rid of that cart-part of the user info in top. Or, move as suggested here, but I dont come further that I get a tex in the right colum (where I hook the adapted block) that says, cant find template for block. I also opened a new topic, asking how to hide a part of the userinfo but didnt got any answerso far:( Link to comment Share on other sites More sharing options...
AnitaR Posted January 8, 2013 Share Posted January 8, 2013 nvm..finally managed to remove the correct lines from infouserblock.tpl and its gone. Link to comment Share on other sites More sharing options...
shabbiramin Posted April 10, 2013 Share Posted April 10, 2013 I m using prestashop leo theme. I wanted to change the user info block as to display only 'FIRSTNAME' in the block. As it is showing full name (First + Last) so the logout comes down. Kindly please help me to modify it as I am new. Link to comment Share on other sites More sharing options...
qcek Posted January 15, 2014 Share Posted January 15, 2014 OK, i figured it out. As following, for those who might be interested. 1. Add the code in blockuserinfo.php as mentioned above. 2. Copy blockuserinfo.tpl to blockuserinfo-column.tpl under your theme (as mentioned above). 3. In back office, transplant User info block module from Top pages (delete) to Right column. Then, transplant Prestashop New theme Cart block v1.2 from Top pages (delete) to Right column. Move both modules to top of Right column under Positions. 4. I changed some code so that the Welcome, Login text comes before the cart. So, in blockuserinfo-column.tpl move <p...> for "Welcome,Login" before the cart part. Add a <div style="clear:both"></div> after the last </div>. -> This will separate the block from the next module in the column. Because at first it looks like the cart and user info is within the title of the next module in the column. You should clear cache + complile at this point to see the changes. 5. In blockuserinfo.css (your theme/css/modules) add "margin-bottom:10px;" under /*cart*/. -> This will create some space between the cart and next module in the column. 6. Change "margin-top:10px;" to "margin-bottom:10px;" under /*user infos*/. -> This will create some space between the Welcome, Login text and the cart image. It looks fine for me now. Hope this can help somebody, too. It was not necessary for me to modify blockuserinfo-column.tpl into a block - it worked without it. I am not an expert in these things, maybe somebody has a better description / solution, too. Can you write step by step instructions? I mean a complete step by step instructions how to make the block was in the right column. Link to comment Share on other sites More sharing options...
vekia Posted January 16, 2014 Share Posted January 16, 2014 hello these instructions from above are well explained you've got problems with some steps ? if co, with which one? 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