39 lines
1.1 KiB
PHP
39 lines
1.1 KiB
PHP
<?php
|
|
|
|
class BlockManufacturerOverride extends BlockManufacturer
|
|
{
|
|
|
|
public function install()
|
|
{
|
|
$success = (parent::install() &&
|
|
$this->registerHook('displayHome')
|
|
);
|
|
return $success;
|
|
}
|
|
|
|
public function hookdisplayHome($params)
|
|
{
|
|
if (!$this->isCached('blockmanufacturer_home.tpl', $this->getCacheId()))
|
|
{
|
|
$manufacturers = Manufacturer::getManufacturers();
|
|
foreach ($manufacturers as &$manufacturer)
|
|
{
|
|
$manufacturer['image'] = $this->context->language->iso_code.'-default';
|
|
if (file_exists(_PS_MANU_IMG_DIR_.$manufacturer['id_manufacturer'].'-'.ImageType::getFormatedName('medium').'.jpg'))
|
|
$manufacturer['image'] = $manufacturer['id_manufacturer'];
|
|
}
|
|
|
|
$this->smarty->assign(array(
|
|
'manufacturers' => $manufacturers,
|
|
'text_list' => Configuration::get('MANUFACTURER_DISPLAY_TEXT'),
|
|
'text_list_nb' => Configuration::get('MANUFACTURER_DISPLAY_TEXT_NB'),
|
|
'form_list' => Configuration::get('MANUFACTURER_DISPLAY_FORM'),
|
|
'display_link_manufacturer' => Configuration::get('PS_DISPLAY_SUPPLIERS'),
|
|
));
|
|
}
|
|
return $this->display(__FILE__, 'blockmanufacturer_home.tpl', $this->getCacheId());
|
|
}
|
|
|
|
|
|
}
|
|
|