Fix layout.xml caching causing blocks to render other blocks in Magento
来源:互联网 发布:淘宝 确认收货 换货 编辑:程序博客网 时间:2024/05/06 12:52
http://davemacaulay.com/fix-layout-xml-caching-causing-blocks-render-blocks-magento/
缓存开启后 在付款页面 点击 next无法继续
If you’re building a system which uses Ajax and makes numerous calls to $this->getLayout()->getUpdate()->load() (which enables you to load sections of the layout.xml file) and render these all on the same page you’ll come across an error where the blocks all render as the first block in the call. This is due to the way the cache id’s work against these blocks.
You can see this functionality used within the checkout such as in the _getShippingMethodsHtml() withinOnepageController.php function:
To overcome this issue you’ll need to manually set the cache ids at the top of every call to load() like the following:
This will make sure the layout caching knows that this block is different from any others called on the same page.
So for instance in the code example above you could change the function code to read the following and avoid any caching issues. You’ll need to add custom cache ids into all calls to $this->getLayout()->getUpdate()->load():
- Fix layout.xml caching causing blocks to render other blocks in Magento
- magento -----Structural Blocks and Content Blocks
- Adding static blocks to specific CMS pages with Magento layouts
- blocks
- Blocks
- Blocks
- Blocks
- Blocks
- Blocks
- Blocks
- Blocks
- Understanding layout.xml syntax in Magento
- Understanding layout.xml syntax in Magento
- Brief Intro to Blocks 5:Using Blocks
- static blocks in java
- Retain Cycle in Blocks
- Static Blocks in Java
- Error in deleting blocks.
- 如何清除Oracle控制文件中的无用记录,例如v$archived_log中的deleted归档日志记录
- 高效分布式数据库缓存经典解决方案
- 运行Hadoop伪分布式实例
- 关于旋转后缩放产生的问题解决方案
- POJ 2391 最大流 二分 拆点 floyd
- Fix layout.xml caching causing blocks to render other blocks in Magento
- Java快速从一个文件夹复制到另外一个文件夹
- Appium 服务关键字
- HTTP Header 详解
- Android灵动分析入门指南
- 建行E商贸通支付开发系列之四(测试环境搭建)
- PhoneGap架构介绍及NodeJS插件系统设计(一)
- HTML5(javascript) Audio/video标签属性常用方法
- 遍历Map的四种方法