Skip to content
This repository

Cache for compared items #5

Closed
wbdv opened this Issue · 3 comments

3 participants

wbdv 3molo Madalin Oprea
wbdv
wbdv commented

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();

    if($compare>0)
            return false;
    else
            return true;
}

then in Model/Observer.php change line 32 in

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

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?

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

@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

3molo

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.