首页 > 解决方案 > 如何将 magento 1.9 代码迁移到 magento 2.3

问题描述

我在 magento 1,9 checkout 上创建了一个时事通讯复选框,它工作正常。有代码:

app/design/frontend/default 主题/default/template/persistent/ Checkout/onepage/billing.phtml

Newsletter : <input type="checkbox" name="billing[is_subscribed]" title="" value="1" id="billing:is_subscribed" class="checkbox" checked="checked" />

最后:app/code/core/(le nom de ton Magento)/Checkout/controllers/Onepagecontroller.php

  if (isset($data['is_subscribed'])) {
        $status = Mage::getModel('newsletter/subscriber')->subscribe($data['email']);
    }

它在 magento 1.9 中像魅力一样工作,但我不知道如何在 Magento 2.3 中使用它的结构不同:/

有人可以帮助我吗?此致

标签: magentomagento2newsletterbilling

解决方案


推荐阅读