2016-01-04 12:49:26 +01:00
|
|
|
<?php
|
|
|
|
class ExpressCart extends Module {
|
|
|
|
public function __construct() {
|
|
|
|
$this->name = 'expresscart';
|
|
|
|
$this->tab = 'front_office_features';
|
|
|
|
$this->version = '1.0';
|
|
|
|
|
|
|
|
parent::__construct();
|
|
|
|
|
|
|
|
$this->displayName = $this->l('Express Cart');
|
|
|
|
$this->description = $this->l('Adds a quick add-to-cart feature to the product list.');
|
|
|
|
}
|
|
|
|
|
|
|
|
public function install() {
|
|
|
|
if(!parent::install()
|
|
|
|
OR !$this->registerHook('header')) {
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function hookHeader() {
|
2016-06-24 12:41:46 +02:00
|
|
|
global $smarty;
|
|
|
|
$page_name = $smarty->getTemplateVars('page_name');
|
|
|
|
|
|
|
|
if($id_category = Tools::getValue('id_category')) {
|
|
|
|
$smarty->assign('id_category', $id_category);
|
|
|
|
return $this->display(__FILE__, 'header.tpl');
|
|
|
|
}
|
|
|
|
|
|
|
|
if($page_name == 'product') {
|
|
|
|
return $this->display(__FILE__, 'header2.tpl');
|
|
|
|
}
|
2016-01-04 12:49:26 +01:00
|
|
|
}
|
|
|
|
}
|