Page 1 of 1

<?php echo $store; ?> doesn't print in footer.tpl

Posted: Wed Mar 09, 2011 6:25 pm
by ehandelsfabriken
I'm trying to print out the stores contact information in footer.tpl with <?php echo $store; ?> and <?php echo $address; ?> but the code doesn't print it out. Why? Do I need to declare a varible for the footer template file? Because I've just copied the code from the contact.tpl file where it works great.

I'm using version 1.4.9.3 of OC.

Re: <?php echo $store; ?> doesn't print in footer.tpl

Posted: Wed Mar 09, 2011 10:24 pm
by fido-x
Any variables you use in a template file need to be defined in the corresponding controller.

If you want to use <?php echo $store; ?> and <?php echo $address; ?> in the footer template file, they need to be defined in "catalog/controller/common/footer.php".

Code: Select all

$this->data['store'] = $this->config->get('config_name');
$this->data['address'] = nl2br($this->config->get('config_address')); 

Re: <?php echo $store; ?> doesn't print in footer.tpl

Posted: Fri May 02, 2014 8:32 pm
by evopixel
Fantabulous explanation, cheers ;o)
I have implemented this in a vqmod 'Show store address in footer' see attachment.
Have fun :)

Re: <?php echo $store; ?> doesn't print in footer.tpl

Posted: Fri May 02, 2014 8:36 pm
by evopixel
..one more thing you need to add an address echo in your footer like this:
<?php echo $address; ?>

This works in version 1.5.6