成功消息不会在主页Magento 2中消失

时间:2017-10-26 09:43:30

标签: magento magento2

当我尝试使用LUMA主题时,成功消息正常工作,但是当我使用自定义主题时,问题就出现了。每当我尝试将产品添加到比较列表时,成功消息就会在主页中累积。我正在使用Magento 2.1.3。见下图:enter image description here

1 个答案:

答案 0 :(得分:0)

似乎你的主题在前端部分更新过程中做了一些事情。你应该看一下文件 供应商/的magento /模块的客户/视图/前端/网络/ JS /视图/ customer.js 并添加条件并强制刷新部分

define([
    'uiComponent',
    'Magento_Customer/js/customer-data'
], function (Component, customerData) {
    'use strict';

    return Component.extend({

        initialize: function () {
            this._super();
            var someCondition = true;

            this.customer = customerData.get('customer');
            if(someCondition === true){
            customerData.reload(['customer']);
            }
        }
    });
});
相关问题