prestashop-1.7

Get name of module in PrestaShop front controller

有些话、适合烂在心里 提交于 2019-11-28 12:45:26
问题 In PrestaShop (specifically v1.7.5) one can get an instance of the module class by calling $module = Module::getInstanceByName('theModuleName'); in the controller of a custom module. Is 'theModuleName' available via some other setting or variable or does it need to be hardcoded? It should also be used as first parameter to getModuleLink(). 回答1: You can access the module name (along with the rest from the module class) by: $theModuleName = $this->module->name; Using Prestashop core module

Add field in product Prestashop 1.7

久未见 提交于 2019-11-28 11:43:04
Why is prestashop don't save my modification into database? Using prestashop 1.7 /override/classes/Product.php class Product extends ProductCore { public $por_gan; public function __construct ($idProduct = null, $idLang = null, $idShop = null) { $definition = self::$definition; $definition['fields']['por_gan'] = array('type' => self::TYPE_INT, 'required' => false); parent::__construct($idProduct, $idLang, $idShop); } } In ProductInformation.php ->add('por_gan', 'Symfony\Component\Form\Extension\Core\Type\NumberType', array( 'required' => false, 'label' => $this->translator->trans('Beneficio',

Add field in product Prestashop 1.7

感情迁移 提交于 2019-11-26 17:11:36
问题 Why is prestashop don't save my modification into database? Using prestashop 1.7 /override/classes/Product.php class Product extends ProductCore { public $por_gan; public function __construct ($idProduct = null, $idLang = null, $idShop = null) { $definition = self::$definition; $definition['fields']['por_gan'] = array('type' => self::TYPE_INT, 'required' => false); parent::__construct($idProduct, $idLang, $idShop); } } In ProductInformation.php ->add('por_gan', 'Symfony\Component\Form