Prestashop - Как сделать .tpl в указанном c хуке? - PullRequest
0 голосов
/ 25 апреля 2020

Я новичок в prestashop, и это может быть очевидно, но у меня есть этот код, который связан с файлом .tpl в моем модуле.

<?php
    if(!defined('_PS_VERSION_'))
        return false;

    class FormCUI extends Module implements \PrestaShop\PrestaShop\Core\Module\WidgetInterface
    {
        private $templateFile;

        public function __construct($name = null, Context $context = null)
        {
            $this->name = 'formCUI';
            $this->author = 'CristainCutitei';
            $this->version = '1.0';

            $this->bootstrap = true;
            parent::__construct();

            $this->displayName = $this->trans('Form CUI', array(), 'Modules.FormCUI.Admin');
            $this->description = $this->trans('Allow users CUI in register form',array(),'Modules.FormCUI.Admin');
            $this->ps_versions_compliancy = array('min'=>'1.7', 'max'=>_PS_VERSION_);

            $this->templateFile = 'module:formCUI/views/templates/hook/FormCUI.tpl';
        }

        public function renderWidget($hookName, array $configuration)
        {
            return $this->fetch($this->templateFile);
        }

        public function getWidgetVariables($hookName, array $configuration)
        {
            return array(
                'message' => "Hello, this product is great!"
            );
        }
    }

Я хочу отобразить виджет в хуке AdditionalCustomerFormFields, чтобы иметь новое поле? Заранее спасибо!

...