在我的模块中,我需要扩展prestashop核心CarrierModule和PaymentModule,因为它有运输和支付部分。所以我打算单独创建两个不同的模块,并在一个文件夹中构建它们,然后安装一次。我需要知道如何制作安装脚本来安装两个模块(一个接一个)。
这是一个模块的安装功能
public function install() {
$flag = parent::install();
if ($this->name !== 'urbitbasic')
$flag = ($flag && $this->registerHook('displayRightColumnProduct'));
return ($this->installer->installTables() &&
$this->installer->installCarriers() &&
$this->installer->installWarehouseCarriers() &&
$this->installTabs() &&
$this->registerHook('displayBackOfficeHeader') &&
$this->registerHook('actionCarrierUpdate') &&
$this->registerHook('actionObjectCarrierUpdateAfter') &&
$this->registerHook('displayCarrierList') &&
$this->registerHook('displayOrderConfirmation') &&
$flag);
}基本上我需要创建一个模块,一个安装文件来安装两个模块。
发布于 2016-08-26 18:21:02
您必须安装几乎一个模块,选择您可以在该模块中执行以下步骤的模块:
public function install() {
$flag = parent::install();
if ($this->name !== 'urbitbasic')
$flag = ($flag && $this->registerHook('displayRightColumnProduct'));
$first_install = ($this->installer->installTables() &&
$this->installer->installCarriers() &&
$this->installer->installWarehouseCarriers() &&
$this->installTabs() &&
$this->registerHook('displayBackOfficeHeader') &&
$this->registerHook('actionCarrierUpdate') &&
$this->registerHook('actionObjectCarrierUpdateAfter') &&
$this->registerHook('displayCarrierList') &&
$this->registerHook('displayOrderConfirmation') &&
$flag);
// Now we install the second module
$mysecondmodule = Module::getInstanceByName('{thenameofyoursecondmodule}');
$second_install = $mysecondmodule->install();
return $first_install AND $second_install;
}https://stackoverflow.com/questions/39144730
复制相似问题