Page 1 of 1

Getting product variable into footer

Posted: Sat Feb 17, 2018 5:39 pm
by prxbl
I would like the footer from the product pages to contain a text with the product model. I searched the forum and I found a similar request viewtopic.php?f=21&t=58217 for OC 1.5. I've tried that code but after modifying /catalog/controller/common/footer.php I get a series of bad characters in my frontend.
,s:�33�&�A�2f��|��M���9 žc=}�Z�
I know I need to modify /catalog/controller/common/footer.php to add a function that will check if the path corresponds to a product page and then storing the product model inside a variable $footer_model . But I don't know how to do it.

Then in footer.tpl I could add something like this to echo that variable if present:

Code: Select all

    <?php if (isset($footer_model)) { echo $footer_model; } ?>
Any help is appreciated, thank you!

Re: Getting product variable into footer

Posted: Sat Feb 17, 2018 10:13 pm
by straightlight
From this post: viewtopic.php?f=21&t=58217#p272247 , simply replace all instances of:

Code: Select all

$this->data
with:

Code: Select all

$data

Re: Getting product variable into footer

Posted: Sun Feb 18, 2018 5:28 pm
by prxbl
Thanks, it's working now!