Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


Cache for compared items #5

wbdv opened this Issue · 3 comments

3 participants


Cached page is show even If a product is added to compare.
To fix that, you need to add a function in Helper/Cacheable.php like

public function hasCompareItems()
    $compare = Mage::helper('catalog/product_compare')->getItemCount();

            return false;
            return true;

then in Model/Observer.php change line 32 in

    if ($helper->quoteHasItems() || $helper->hasCompareItems()) {

Hello wbdv,

I tested your function on a completely fresh magento installation, and all I get it a white page (which might be because of nginx or magento), but that indicates that the code does not work.
Im just guessing here, but could it be ' $compare = Mage::helper('catalog/product_compare')->getItemCount();' that does not work because it's a fresh installation?

@madalinoprea madalinoprea referenced this issue from a commit
@madalinoprea Bypass cache when item is added to be compared #5
Thanks wbdv for the patch.
Updates varnish config to not cache wishlist.

@wbdv, thanks for the patch, it was pushed to github.
@dtremolo, try to update the repo and see if this time is working.

For all of you who we're using modman update the extension running: modman magneto-varnish update


Works like a charm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.