Jump to content

[solved] How to move Cart block to footer? Tried everything


Recommended Posts

I have tried to move cart block from left column to the footer i also tried to write it to footer.tpl via copy it from blockcart.tpl, it works, but i have problems with position of that block. I also replaced Hook in blockcart.php i hooked it into footer $this->registerHook('footer') it succesfully register but didint show up its hidden in administration i see "blockcart" in footer. Can someone help pls? Its important for me. i have the same problem with newsletter block. Pls help me. With respect Peter.

Link to comment
Share on other sites

I have tried to move cart block from left column to the footer i also tried to write it to footer.tpl via copy it from blockcart.tpl, it works, but i have problems with position of that block. I also replaced Hook in blockcart.php i hooked it into footer $this->registerHook('footer') it succesfully register but didint show up its hidden in administration i see "blockcart" in footer. Can someone help pls? Its important for me. i have the same problem with newsletter block. Pls help me. With respect Peter.

 

in blockcart.php you must add function:

public function hookfooter($params)
{
 return $this->hookRightColumn($params);
}

 

then you must transplant module to footer section in modules -> position tab

  • Like 1
Link to comment
Share on other sites

in blockcart.php you must add function:

public function hookfooter($params)
{
 return $this->hookRightColumn($params);
}

 

then you must transplant module to footer section in modules -> position tab

 

 

public function install()

{

if (

parent::install() == false

|| $this->registerHook('footer') == false

|| $this->registerHook('header') == false

|| Configuration::updateValue('PS_BLOCK_CART_AJAX', 1) == false)

return false;

return true;

}

 

public function hookRightColumn($params)

{

if (Configuration::get('PS_CATALOG_MODE'))

return;

 

// @todo this variable seems not used

$this->smarty->assign('order_page', strpos($_SERVER['PHP_SELF'], 'order') !== false);

$this->assignContentVars($params);

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

}

 

if i replace "public function hookRightColumn($params)

{" all web crash

Link to comment
Share on other sites

The size is ok. But i have the same problem with Block newsletter. this module is written something else.

 

public function install()

{

if (parent::install() == false || $this->registerHook('footer') == false || $this->registerHook('header') == false)

return false;

Link to comment
Share on other sites

I edited your post due to the chaotic contents of php file.

 

you must put the code:

 

function hookfooter($params){
return $this->hookLeftColumn($params);
}

 

 

public function hookDisplayHeader($params)
{
$this->context->controller->addCSS($this->_path.'blocknewsletter.css', 'all');
}
//
// HERE
//
}

Link to comment
Share on other sites

I must doing something wrong. I found that code i put this function hookfooter($params){

return $this->hookLeftColumn($params);

} and then whole web doesnt work. Anyway Thank you for helping me. Do you want some reward?

 

And dont worry i took care about } etc:)

Link to comment
Share on other sites

I must doing something wrong. I found that code i put this function hookfooter($params){

return $this->hookLeftColumn($params);

} and then whole web doesnt work. Anyway Thank you for helping me. Do you want some reward?

 

And dont worry i took care about } etc:)

 

you can send me PM with file that you use, i can check it for issues

Link to comment
Share on other sites

  • 4 weeks later...
  • 3 months later...

Hi vekia,

 

After I inserted the below code into root\modules\blocknewsletter.php and after that transplanted the newsletter block to footer, my website became blank.

 

 

function hookfooter($params){

return $this->hookLeftColumn($params);

}

 

Is there anything I'm not doing right? Please advice thanks!

Link to comment
Share on other sites

Can some one please help?

 

We have two websites.

 

site 1 - www.eyewearoutlet.ph 1.5.3 default theme

 

site 2 - www.babyoutlet.ph 1.4.7 custom theme

 

 

We love the regular default footer of site 1, and we want this footer in our site 2. Is this possible?

 

I have been searching all day every for almost a week for an answer now so it would be much appreciated if anyone knows this?

 

Our designer who did the customer design turns out not to know much about development lol, hence why we now have NO footer on site 2, and missing a few footer modules. hes also not contactable anymore.

 

Can anyone help us out?

 

Much love.

Link to comment
Share on other sites

Can some one please help?

 

you want to create the same footer in shop 2 as in shop 1? I understood it well? ;)

Attached is the modified part of blocknewsletter.php. Modification is in line 520-522.

 

you've got duplicated hookfooter function, this is probably main problem. Delete one of them.

Hi vekia,

 

After I inserted the below code into root\modules\blocknewsletter.php and after that transplanted the newsletter block to footer, my website became blank.

 

 

function hookfooter($params){

return $this->hookLeftColumn($params);

}

 

Is there anything I'm not doing right? Please advice thanks!

 

where you exactly pasted it? can you provide the piece of code? you can upload file to own post, i will download it and check for errors,

Link to comment
Share on other sites

Hi vekia,

 

I inserted the code in blocknewsletter between this code near to the bottom of the page,

 

public function hookDisplayHeader($params)

{

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

}

//the code pasted here

}

 

Then I transplant the Newsletter Block to the displayFooter in the back office.

 

Attached is the file, many thanks for your help!

blocknewsletter.php

Link to comment
Share on other sites

×
×
  • Create New...