I have category landing page, in which another vendor has customized to add "Purchased" text instead of "Add to cart" in case the user has purchased it, hence this will be different for each user.
All iz well till now, until we turned on "The" FPC.
While I understand Holepunching a little better now I had this plan:
- We keep rest code in list.phtml as the same.
- I just cut the logic of the showing of the "Add To Cart" or "Purchased" and put it in another phtml.
- I would add this new block as the child of catalog/product/list block in the catalog.xml with this new phtml.
- Have a container model responsible for the _renderBlock. We say _saveCache false for this block and it would not be cached.
Question / Difficulties
- I am not really aware of the exact implementation for this plan.
- For step 4 what should be the implementation of _renderBlock like ?
- How whould I get the productobject inside this phtml ? as The list.phtml works on the productCollection and we just loop over this and get product object. now, how does one get the project object now in the child block ?
- I need a few pointers on how this can be done best. while I read about a product view page holepunch method I am not exactly sure how to do this for category page.
- If nothing works I just want FPC to not cache the list block at all , but again not sure how to disable caching for only this block ?