Cache for compared items #5

Closed
wbdv opened this Issue Jun 3, 2011 · 3 comments

Comments

Projects
None yet
3 participants
@wbdv

wbdv commented Jun 3, 2011

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()) {
@dtremolo

This comment has been minimized.

Show comment Hide comment
@dtremolo

dtremolo Jun 3, 2011

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?

dtremolo commented Jun 3, 2011

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 added a commit that referenced this issue Jun 4, 2011

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

This comment has been minimized.

Show comment Hide comment
@madalinoprea

madalinoprea Jun 4, 2011

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

Owner

madalinoprea commented Jun 4, 2011

@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

@dtremolo

This comment has been minimized.

Show comment Hide comment
@dtremolo

dtremolo Jun 5, 2011

Works like a charm.

dtremolo commented Jun 5, 2011

Works like a charm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment