Post by ehandelsfabriken » Wed Mar 09, 2011 6:25 pm

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.

I'm using OpenCart 1.5.1.3


New member

Posts

Joined
Wed Mar 09, 2011 6:20 pm

Post by fido-x » Wed Mar 09, 2011 10:24 pm

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')); 

Image
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool

If you're not living on the edge ... you're taking up too much space!


User avatar
Expert Member

Posts

Joined
Sat Jun 28, 2008 1:09 am
Location - Tasmania, Australia

Post by evopixel » Fri May 02, 2014 8:32 pm

Fantabulous explanation, cheers ;o)
I have implemented this in a vqmod 'Show store address in footer' see attachment.
Have fun :)

Newbie

Posts

Joined
Mon Apr 28, 2014 4:20 pm

Post by evopixel » Fri May 02, 2014 8:36 pm

..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

Newbie

Posts

Joined
Mon Apr 28, 2014 4:20 pm
Who is online

Users browsing this forum: No registered users and 7 guests