Thibault GUILLAUME c97d4d9f7c inte suite
2015-08-27 14:48:06 +02:00

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());
}
}