Добрый день!
Прошу не пинать, но однако столкнулся с такой проблемой. На существующий магазин на престе 1.6.0.9 установили самописный плагин, однако хуки с него не отрабатывают (проверял hookCustomerAccount и hookHeader). Поставил на чистый магазин - всё работает отлично. Чувствую что проблема в мелочи, однако не могу её найти. Другие модуля поотключал, престу обновил до 1.6.1.6 - не помогло. Тему сменить не получилось - при выборе дефолтной темы ничего не происходило, менял в настройке темы её папку - внешний вид изменился на дефолтный - но ничего модуль так и не заработал. Уже теряюсь в чем может быть проблема. Кто чем богат -подскажите пожалуйста.
Премного благодарен!
if (!defined('_PS_VERSION_')) {
exit;
}
class Test extends Module
{
public function __construct()
{
$this->name = 'test';
$this->tab = 'front_office_features';
$this->version = '1.0.0';
$this->author = 'author';
$this->need_instance = 0;
$this->ps_versions_compliancy = array('min' => '1.6', 'max' => _PS_VERSION_);
$this->bootstrap = true;
parent::__construct();
$this->displayName = $this->l('Test module');
$this->description = $this->l('Module create and shows test .');
$this->confirmUninstall = $this->l('Are you sure you want to uninstall?');
}
public function install()
{
if (!parent::install() ||
!$this->registerHook('customerAccount') ||
!$this->registerHook("OrderConfirmation") ||
!$this->registerHook("ActionPaymentConfirmation") ||
!$this->registerHook("PaymentConfirmation") ||
!$this->registerHook("ActionOrderConfirmation") ||
!$this->registerHook('Header') ||
!$this->registerHook('ActionOrderStatusUpdate') ||
!Configuration::updateValue('rewards_REMOTE_IMG_URL', 'http://')
) {
return false;
}
return true;
}
public function uninstall()
{
if (!parent::uninstall()) {
return false;
}
return true;
}
/**
* specific styles and scripts only for this module
*/
public function hookHeader()
{
$this->context->controller->addCSS($this->_path.'views/css/test.css', 'all');
$this->context->controller->addJS($this->_path.'views/js/test.js', 'all');
}
/**
* @return mixed
* displays menu point in customer account
*/
public function hookCustomerAccount()
{
return $this->display(__FILE__, 'my-account.tpl');
}