magento2 - 为 Magento\Framework\Interception\PluginList\PluginList 的 $reader 参数提供的参数配置无效

标签 magento2

当我在 Magento 2 中进行 ajax 调用时,出现此错误: 为 Magento\Framework\Interception\PluginList\PluginList 的 $reader 参数提供的参数配置无效

我的 Controller

public function execute()
{
    $objectManager = ObjectManager::getInstance();
    $data = $this->request->getParams();
    $currentdate = $this->date->gmtDate();
    $model = $this->aboncartFactory->create();
    $model->setData($data);
}

我的 Ajax 调用

function pushData() {
    var url = "<?php echo $block->getUrl('aboncart/index/insertorder'); ?>";
    var firstname = document.getElementsByName("firstname").value; //$("#billing_firstname").val();
    var lastname = document.getElementsByName("lastname").value; //$("#billing_lastname").val();
    var telephone = document.getElementsByName("telephone").value; //$("#billing_telephone").val();
    var email = document.getElementsByName("username").value; //$("#billing_email").val();
    var quote = "<?php echo $quoteId; ?>";
    var store = "<?php echo $storeId; ?>";
    var parameters = { 
        email: email,
        firstname: firstname,
        lastname: lastname,
        telephone: telephone,
        quote_id: quote,
        store_id: store
    };

    $.ajax({
        url: url,
        type: "POST",
        data: parameters,
        success: function(result)  {
          console.log(result);
        },
        error: function(error){
            console.log(error);
        }
    });
}

最佳答案

我从 Controller 中删除了 ObjectManager,它又可以工作了!

关于magento2 - 为 Magento\Framework\Interception\PluginList\PluginList 的 $reader 参数提供的参数配置无效,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55145670/

相关文章:

php - 您当前的 session 已过期。 Magento2

php - PSR4 子目录与子命名空间名称的大小写不匹配

javascript - 无法覆盖 magento 2 中的 collapsible.js

magento2 - 在安装 2.0 版本的 magento 时如何修复此控制台日志错误?

php - 如何在 magento 2 中添加自定义顶部链接?

php - Magento 2 - 当用户点击 "Go To Checkout"时调度事件

magento - 如何在magento 2.1中激活自定义主题?

magento - 在 magento2 中以编程方式保存默认地址

magento - 如何在magento2中将数据分配给新的div

knockout.js - Magento 2 - 向结帐摘要框添加额外的产品属性