Magento:关闭会话消息/错误的缓存?
有没有办法关闭magento中某些页面区域的页面缓存?
我们在产品页面之一上触发自定义会话消息,但由于页面缓存已打开,因此我们永远不会看到它,直到我们到达未缓存的页面(例如结账)。
magento 是否有任何类型的“无缓存”块?
谢谢
Is there a way to turn off the page cache in magento for some page areas?
We're triggering custom session message on one of our product pages, but since the page cache is on, we never see it till we hit an uncached page (say, checkout).
Is there any sort of 'no cache' block for magento?
thx
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我真的认为缓存根本不应该影响消息。我希望我能就此提供可靠的建议,但由于从未对产品级消息做过任何事情,所以我只是提出一些想法。
我认为产品级消息的行为方式与您进入购物车时看到的会话消息不同。我不太确定产品视图如何获取消息,但可能在布局级别上做得更多。我正在挖掘了一下,也许你可以尝试的一件事是这样的:
Mage::getSingleton('core/message')->notice($message)
如果失败,请挖掘 app/code/core/ Mage/Catalog/ 并查看是否可以找到 Magento 如何设置要在产品视图上拾取的消息的示例。
我希望你能找到答案!
I really don't think that caching should effect the messages at all. I wish I could give solid advice on this, but having never had to do anything with product-level messages, I'm just throwing some ideas out there.
I don't believe that product-level messages behave in the same way as the session messages you see when you get to the cart. I'm not exactly sure how the product view picks up messages, but it might be more done on the layout level. I was digging around a bit, and perhaps one thing you could try is something like this:
Mage::getSingleton('core/message')->notice($message)
If that fails, dig through app/code/core/Mage/Catalog/ and see if you can find examples of how Magento sets messages to be picked up on the product view.
I hope you find the answer!