简体   繁体   English

Magento-2迷你书包添加产品无法在IE-11中使用?

[英]Magento-2 mini bag added product is not working in IE-11?

I am facing an issue with Internet Explorer. 我面临Internet Explorer的问题。 It is possible to add products to a mini bag on my page. 可以在我的页面上的迷你包中添加产品。 You can take a look in the mini-bag in a popup, where the products are listed in a drop-down. 您可以在弹出窗口中的迷你袋中查看,产品在下拉列表中列出。

On Internet Explorer, the mini bag pop-up will not display newly added products, which were added after the page was loaded, eventhough they are added to the mini bag. 在Internet Explorer上,迷你购物袋弹出窗口不会显示新添加的产品,这些产品是在页面加载后添加的,即使它们已添加到迷你购物袋中也是如此。 If you then change the page the mini bag displays the (1) icon as normal and the product shows properly in the drop-down. 如果随后更改页面,则迷你包会正常显示(1)图标,并且产品会在下拉菜单中正确显示。

The technology I am using is Magento 2. When I click on the add to bag button the following error is shown in the console: 我使用的技术是Magento2。单击添加到购物袋按钮时,控制台中显示以下错误:

Object doesn't support property or method 'find' 对象不支持属性或方法“查找”

options-updater.js (26.9) options-updater.js(26.9)

This is the mentioned line: 这是上面提到的行:

changedProductOptions = data.items.find(function (item) {
    return item['product_id'] === productId;
});

Note: It is working fine with Edge browser. 注意:它与Edge浏览器配合正常。

Please help. 请帮忙。 I don't know why IE does not support js for mini bag adding product features. 我不知道为什么IE不支持js的迷你购物袋添加产品功能。

After the ES-6 standards, the find() method is no longer working with IE browsers. 在ES-6标准之后,find()方法不再与IE浏览器一起使用。 For this, you can use the map() method, 为此,您可以使用map()方法,

Here is the code sample: 这是代码示例:

changedProductOptions = data.items.map(function (item) {
      return item['product_id'] === productId;
});

Hope this will work for you. 希望这对您有用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM