Problem:
banners disabled in admin in: admin/system/designs/banners still show up-front.
I'm not sure if this is a bug, but surely it is a logical folly, since user disabling banner in the back expects banner not to show, while disabled.
see below:
Here is a fix:
(for those, who thinks - as me - that disabled means disabled):
#1.
-------------------------------------------------------------------------
Find:
Add method:catalog/model/design/banner.php
Code: Select all
public function getBannerStatus($banner_id) //jp
{
$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "banner WHERE banner_id = '" . (int) $banner_id . "'");
return (int) $query->row['status'];
}
-------------------------------------------------------------------------
Find:
find code:catalog/controller/module/banner.php
Code: Select all
if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/module/banner.tpl'))
{
return $this->load->view($this->config->get('config_template') . '/template/module/banner.tpl', $data);
} else
{
return $this->load->view('default/template/module/banner.tpl', $data);
}
Code: Select all
if ($this->model_design_banner->getBannerStatus($setting['banner_id'])!=0) //jp
{
if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/module/banner.tpl'))
{
return $this->load->view($this->config->get('config_template') . '/template/module/banner.tpl', $data);
} else
{
return $this->load->view('default/template/module/banner.tpl', $data);
}
}
-------------------------------------------------------------------------
Find:
find code:catalog/controller/module/carousel.php
Code: Select all
if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/module/carousel.tpl'))
{
return $this->load->view($this->config->get('config_template') . '/template/module/carousel.tpl', $data);
} else
{
return $this->load->view('default/template/module/carousel.tpl', $data);
}
replace it with:
Code: Select all
if ($this->model_design_banner->getBannerStatus($setting['banner_id'])!=0) //jp
{
if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/module/carousel.tpl'))
{
return $this->load->view($this->config->get('config_template') . '/template/module/carousel.tpl', $data);
} else
{
return $this->load->view('default/template/module/carousel.tpl', $data);
}
}
-------------------------------------------------------------------------
Find:
find code:catalog/controller/module/slideshow.php
Code: Select all
if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/module/slideshow.tpl')) {
return $this->load->view($this->config->get('config_template') . '/template/module/slideshow.tpl', $data);
} else {
return $this->load->view('default/template/module/slideshow.tpl', $data);
}
Code: Select all
if ($this->model_design_banner->getBannerStatus($setting['banner_id'])!=0) //jp
{
if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/module/slideshow.tpl')) {
return $this->load->view($this->config->get('config_template') . '/template/module/slideshow.tpl', $data);
} else {
return $this->load->view('default/template/module/slideshow.tpl', $data);
}
}