使用Magento 2.0.4缓存,更具体地说,启用页面缓存,一切正常。
如果我禁用它,请清除cookie,然后以客户身份登录,而不是minicart中的产品。
欢迎消息并不正确。我必须从产品页面将产品添加到购物车才能看到迷你车。比起结帐,我的国家/地区没有显示在地址摘要中(送货地址已添加到我的帐户中)。
我已经调试完毕,看来问题出在:
module-customer/view/frontend/web/js/customer-data.js
。Cookie private_content_version
已设置在中module-page-cache/view/frontend/web/js/page-cache.js
并在中使用customer-data.js
。参见customerData::reload
功能。
在禁用页面缓存的情况下,不会像该功能dataProvider::getFromServer()
那样从服务器加载数据。
当禁用页面缓存时,cookie private_content_version
不在其中(不在页面之外执行page-cache.js)。但是cookie section_data_ids
只有'*'和'messages'=>为空(false或null)。
启用页面缓存后private_content_version
,将section_data_ids
具有并带有哪些键和值:
*: null
cart: 123
compare-products: 123
customer: 123
directory-data: 123
last-ordered-items: 123
multiplewishlist: 123
review: 123
wishlist: 123
在启用页面缓存的情况下登录后,在客户仪表板上,还有2个其他的ajax请求加载数据:
http://test.localhost/customer/section/load/?sections=&update_section_id=false&_=123
http://test.localhost/customer/section/load/?sections=directory-data&update_section_id=false&_=123
这些包含具有客户特定数据和目录数据的json对象,例如所有国家和地区。通过这些呼叫,在结帐时,地址摘要将显示国家/地区名称。请参阅:module-customer/view/frontend/web/js/sections-config.js
和module-checkout/view/frontend/web/js/view/shipping-address/address-renderer/default.js
,函数getCountryName
。
这是Magento 2错误还是我搞砸了?谢谢
GET http://example.com/customer/section/load/?sections=&update_section_id=false&_=1462374643065 500 (Internal Server Error)