Jump to content

[Solved] How to move Newsletter block to footer? Tried everything


Recommended Posts

I have tried to move newsletter block from left column to the footer by using Transplant a module, but it doesn't work. I have discovered some modules cannot be transplanted to other locations for specific reasons.

 

I went into blocknewsletter.php and added this code at the end before last } :

 

function hookFooter($params)

{

return $this->hookFooter($params);

}

 

 

What else can I do to move the newsletter block to the footer where it should be? Should php code be different?

Link to comment
Share on other sites

Ok, what I discovered now: I was changing the code in themes/mytheme/modules/blocknewsletter folder, instead of the root/modules folder. I now changed the code in root/modules folder and it works fine, but what happens when the prestashop is upgraded to the latest version? Is this code going to be overriden?

Thanks so much CartExpert.net for your time trying to help me with this problem.

Link to comment
Share on other sites

I found that you can use override folder for changing the core files so when you upgrade to the newest version of PrestaShop, the changes remain.

There is a good article about this: http://www.prestashop.com/blog/en/modules_classes_and_controller_override_by_julien_breux/

but I wouldn't know how to apply what they are suggesting in this article to the problem above. Any ideas?

Link to comment
Share on other sites

This means: you can create 'copy' of files which will not be overwritten when you upgrade. These copies also overrule/override the originals.

This procedure applies only to Class files, Controller files and the template files of the modules.

So, if you change the template file 'blockcategories.tpl' of the 'blockcategories' module, you should copy the modified file to: 'themes/[YOUR_THEME]/modules/blockcategories/' This way even if you update and 'modules/blockcategories/blockcategories.tpl' will be overwritten, the system will still use the override file 'themes/[YOUR_THEME]/modules/blockcategories/blockcategories.tpl'

This will not work with blockcategories.php

 

For classes and controllers, you need to copy the modified files to 'overrides/'

Link to comment
Share on other sites

  • 4 weeks later...
  • 11 months later...

can you please send me the working footer friendly :) module complete, I tried to reinstall it few times and it just work with hook header. If I set the

 

 

function hookFooter($params)

{

return $this->hookLeftColumn($params);

}

 

and also rewrite the hook header and then I get blank page, just with html and body tags, tried to reinstall few more times and still the same porblem, using prestashop 1.5.3

Link to comment
Share on other sites

other problem, I want to assign css from theme/css/modules folder, but when I add function

 

 

public function hookDisplayFooter($params)

{

$this->context->controller->addCSS($this->_path.'blocknewsletter.css', 'all');

}

 

Is stops showing the footer block and recolor(css) the left column block.

 

 

/********************************************SOLVED********************************************/

 

 

public function hookFooter($params)

{

$this->_prepareHook($params);

$this->context->controller->addCSS($this->_path.'blocknewsletter.css', 'all');

return $this->display(__FILE__, 'blocknewsletter.tpl');

}

 

and removing the previous function

Edited by AndyLaci (see edit history)
  • Like 1
Link to comment
Share on other sites

  • 1 month later...

Tried this exactly, and its not working!

 

last few lines of blocknewsletter.php

 

cart 1.5.4.1

 

http://lucas.lovemywall.co.uk/index.php

 

 

public function hookDisplayLeftColumn($params)

{

$this->_prepareHook($params);

return $this->display(__FILE__, 'blocknewsletter.tpl');

}

 

public function hookFooter($params)

{

return $this->hookDisplayLeftColumn($params);

}

 

public function hookDisplayHeader($params)

{

$this->context->controller->addCSS($this->_path.'blocknewsletter.css', 'all');

}

public function hookFooter($params)

{

$this->_prepareHook($params);

$this->context->controller->addCSS($this->_path.'blocknewsletter.css', 'all');

return $this->display(__FILE__, 'blocknewsletter.tpl');

}

 

}

 

}

Edited by jasonwinley (see edit history)
Link to comment
Share on other sites

  • 1 year later...

Hi guys

The newsletter block has insererted itself in the top of the screen and in the footer. www.rosieposy.fr/en 

I have disabled the search bar and now the 'newsletter' title is above the catagories in top menu, and the bar for filling customer emails is under the catagories . Any ideas how to rectify this. 

Also I have the newsletter in the footer and I don't want the newsletter in the footer. 

Thanks for any advice. 

Keep well 

bye for now, Len

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...