Post by fwellner » Sat Feb 27, 2016 5:45 pm

Hi,

I have been looking around but haven't found any solution on this. I would like to put a custom header text on the "banner" module (or find a suitable extension). The idea is that I have a right side banner pane with banners for the events I will take my shop to. I would like to add the text "Meet us at these events" or similar.

I use OC 1.5.6.4 and use multiple languages.

/Fredrik

Newbie

Posts

Joined
Sat May 10, 2014 5:45 pm

Post by ocart777 » Sun Feb 28, 2016 2:53 am

if you need a quick modification you can use this

catalog/controller/module/module/banner.php

before

Code: Select all

$this->data['module'] = $module++;
add

Code: Select all

$this->data['banners_name'] = array();
foreach ($this->model_design_banner->getBanners() as $result_name) {
$this->data['banners_name'][] = array(
'name' => $result_name['name']
);
}
catalog/model/design/banner.php

before the closing braces '}' of ModelDesignBanner add

Code: Select all

public function getBanners() {
$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "banner");
return $query->rows;
}
catalog/view/theme/theme_name/template/module/banner.tpl

before

Code: Select all

<?php foreach ($banners as $banner) { ?>
add

Code: Select all

<?php foreach ($banners_name as $banner_name) { ?>
<?php echo $banner_name['name'] == 'HP Products' ? 'Meet us at these events' : ''; ?>
<?php } ?>

You can't control the weather, but you can change your mood.
You can't modify the visage, but you can show your smile.
You can't command someone else, but you can hold yourself.
You can't forecast tomorrow, but you can using today.
You can't obtain thanks, but you can exert yourself in everything.


OCEXTENSION.COM - YOUR PROFESSIONAL OPENCART EXTENSION STORE


User avatar
Active Member

Posts

Joined
Mon Jun 10, 2013 4:57 pm
Location - Malaysia

Post by ocart777 » Sun Feb 28, 2016 2:58 am

Code: Select all

<?php echo $banner_name['name'] == 'HP Products' ? 'Meet us at these events' : ''; ?>
HP Products = your banner name, not a banner title
Meet us at these events = this is your message to the front end. if your banner name is already "Meet us at these events" then replace "HP Products" with "Meet us at these events" or use this code

Code: Select all

<?php echo $banner_name['name'] == 'Meet us at these events' ? $banner_name['name'] : ''; ?>

You can't control the weather, but you can change your mood.
You can't modify the visage, but you can show your smile.
You can't command someone else, but you can hold yourself.
You can't forecast tomorrow, but you can using today.
You can't obtain thanks, but you can exert yourself in everything.


OCEXTENSION.COM - YOUR PROFESSIONAL OPENCART EXTENSION STORE


User avatar
Active Member

Posts

Joined
Mon Jun 10, 2013 4:57 pm
Location - Malaysia
Who is online

Users browsing this forum: No registered users and 1 guest