Vin_fugen
Vin_fugen

Reputation: 581

Opencart display one module conents into another module

I'm having custom footer module in my template. Also i'm using testimonial module in the position content bottom. I'm trying to display testimonial inside custom footer.

To do this i simply copied testimonial.tpl and testimonial.php contents and pasted into customfooter.tpl and customfooter.php

After this i'm getting errors stating

undefined variable and class name already assigned error

Did you know how to do this?

Upvotes: 1

Views: 777

Answers (2)

Ravi Chauhan
Ravi Chauhan

Reputation: 1458

please define variable.

how can you define i will show you.

catalog > controller > header.php

for static variable

$this->load->language('common/header');
$data['text_home'] = $this->language->get('text_home');

// Where language file in assign this variable with different language foler

$data['text_home'] = $this->url->link('information/contact');

and you can tpl file in use this varible.

<?php echo $text_home; ?>

make sure 100% erorr has not facing

for dynamic variable

Upvotes: 0

Jay Gilford
Jay Gilford

Reputation: 15151

See this answer for how to do use a module in a separate modification/controller

opencart - How to manually display a module inside a template file?

You simply need to change from the common/home to your module's controller and view files

Upvotes: 1

Related Questions