Home    Articles

 

How to add particular banner on frontend for Opencart, anywhere.

 

First of all you need to create a new banner.

System->Design->Banners.

Create one and add the image.

After you create it click to edit it.
In the url you will see something like this ….&token=f75a1dcc4dc5f29b3f23b675dd0fd836&banner_id=9
Your banner id is 9

Let’s say that you want to add this banner to header.
Go to catalog->controller->common->header.php

Add the folowing line before $this->render();
Try to add this upper.

$this->data['header_ad'] = $module = $this->getChild('module/banner', array('limit' => 5,  'width' => 479,   'height' => 70,'banner_id'=>9));

Now go to your theme and open template->common->header.tpl.

Add the following line anywhere:

<?php echo $header_ad; ?>

That’s it.For questions please add comment.

by