当我在 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/