Move cart & compare blocks to top links - Problem with dynamic/lazy block
-
12-12-2019 - |
Question
I'm trying to move the cart & compare blocks to top links and when the user goes over the li
the cart/product compare appears: it works.
Minicart
<reference name="header">
<reference name="top.links">
<remove name="checkout_cart_link"/>
<block type="minicart/view" name="minicart_toplink" template="minicart/toplink.phtml" >
<block type="checkout/cart_sidebar" name="cart_sidebar" as="topcart" template="checkout/cart/sidebar.phtml"/>
</block>
<action method="addLinkBlock"><blockName>minicart_toplink</blockName></action>
<block type="checkout/links" name="checkout_cart_link_minicart">
<action method="addCheckoutLink"></action>
</block>
</reference>
</reference>
Minicompare
<!-- Disable compare product block on left and right sidebar -->
<reference name="right">
<action method="unsetChild">
<name>catalog.compare.sidebar</name>
</action>
</reference>
<reference name="left">
<action method="unsetChild">
<name>catalog.compare.sidebar</name>
</action>
</reference>
<!-- Add Compare product block to top links -->
<reference name="header">
<reference name="top.links">
<block type="minicompare/view" name="minicompare_toplink" template="minicompare/toplink.phtml" >
<block type="catalog/product_compare_sidebar" name="catalog.compare.sidebar" as="topcompare" template="catalog/product/compare/sidebar.phtml"/>
</block>
<action method="addLinkBlock"><blockName>minicompare_toplink</blockName></action>
</reference>
</reference>
The problem is that when I use Lesti:FPC
or Varnish
these blocks create problems: with varnish they are duplicated(double link for cart, checkout and product cmopare) and with Lesti (if added under lazy blocks
) they don't appear when I visit the (any and every) page for the first time, if I relaod they appear, but if I change the page the block reset (no item, total=0, but the items are in the cart) and I have to refresh.
Any idea?
Solution
Lesti FPC: this solved my problem (I have removed any reference to these blocks from the Dynamic section)
Lazy Block
catalog.compare.sidebar,
minicart_head
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange