首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >Prestashop在一个安装中创建两个模块

Prestashop在一个安装中创建两个模块
EN

Stack Overflow用户
提问于 2016-08-25 19:59:37
回答 1查看 175关注 0票数 0

在我的模块中,我需要扩展prestashop核心CarrierModulePaymentModule,因为它有运输和支付部分。所以我打算单独创建两个不同的模块,并在一个文件夹中构建它们,然后安装一次。我需要知道如何制作安装脚本来安装两个模块(一个接一个)。

这是一个模块的安装功能

代码语言:javascript
运行
复制
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);
    }

基本上我需要创建一个模块,一个安装文件来安装两个模块。

EN

Stack Overflow用户

发布于 2016-08-26 18:21:02

您必须安装几乎一个模块,选择您可以在该模块中执行以下步骤的模块:

代码语言:javascript
运行
复制
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;
}
票数 1
EN
查看全部 1 条回答
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/39144730

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档