51 lines
1.3 KiB
PHP
51 lines
1.3 KiB
PHP
<?php
|
|
|
|
if (!defined('_CAN_LOAD_FILES_'))
|
|
exit;
|
|
|
|
class CmsPS extends Module
|
|
{
|
|
public function __construct()
|
|
{
|
|
$this->name = 'cmsps';
|
|
$this->tab = 'front_office_features';
|
|
$this->version = '1.0';
|
|
$this->author = 'Antadis';
|
|
$this->need_instance = 0;
|
|
|
|
$this->bootstrap = true;
|
|
parent::__construct();
|
|
|
|
$this->displayName = $this->l('CMS component by Antadis');
|
|
$this->description = $this->l('Manage CMS data in Prestashop');
|
|
$this->secure_key = Tools::encrypt($this->name);
|
|
$this->ps_versions_compliancy = array('min' => '1.6', 'max' => _PS_VERSION_);
|
|
}
|
|
|
|
public function install()
|
|
{
|
|
if (Shop::isFeatureActive())
|
|
Shop::setContext(Shop::CONTEXT_ALL);
|
|
|
|
if (!parent::install()
|
|
|| !$this->registerHook('displayRelatedProduct')
|
|
|| !$this->registerHook('footer')
|
|
|| !$this->createTables()
|
|
)
|
|
return false;
|
|
}
|
|
|
|
public function createTables (){
|
|
return true;
|
|
}
|
|
|
|
public function hookdisplayFooter() {
|
|
$this->context->controller->addJS(($this->_path).'voting.js', 'all');
|
|
}
|
|
|
|
public function hookdisplayRelatedProduct($params) {
|
|
$id_product = $params['product']->id;
|
|
p($id_product);
|
|
}
|
|
}
|