magento2: Recently viewed products block not working in product page with enabled cache
Steps to reproduce
- add:
<block class="Magento\Reports\Block\Product\Widget\Viewed" page_size="4" name="recently_viewed" template="widget/viewed/content/viewed_grid.phtml" cacheable="false" />
to catalog_product_view.xml in any container
Expected result: With enabled cache you should see recently viewed products block in product page.
Actual result: Block is visible only with disabled cache, when cache is enabled, it does not have output.
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 1
- Comments: 36 (17 by maintainers)
Commits related to this issue
- MAGETWO-56062: [Github #3890] Recently Viewed Products block does not appear when FPC is enabled --fix health index — committed to magento/magento2 by deleted user 7 years ago
- MAGETWO-56062: [Github #3890] Recently Viewed Products block does not appear when FPC is enabled --fix diff — committed to magento/magento2 by deleted user 7 years ago
- MAGETWO-56062: [Github #3890] Recently Viewed Products block does not appear when FPC is enabled --fix functional test — committed to magento/magento2 by deleted user 7 years ago
- MAGETWO-56062: [Github #3890] Recently Viewed Products block does not appear when FPC is enabled --add descriptions — committed to magento/magento2 by deleted user 7 years ago
- MAGETWO-56062: [Github #3890] Recently Viewed Products block does not appear when FPC is enabled — committed to magento/magento2 by VladimirZaets 7 years ago
- MAGETWO-56062: [Github #3890] Recently Viewed Products block does not appear when FPC is enabled — committed to magento/magento2 by deleted user 7 years ago
- MAGETWO-56062: [Github #3890] Recently Viewed Products block does not appear when FPC is enabled --remove regular price from tax calculations — committed to magento/magento2 by deleted user 7 years ago
- MAGETWO-56062: [Github #3890] Recently Viewed Products block does not appear when FPC is enabled — committed to magento/magento2 by VladimirZaets 7 years ago
- MAGETWO-56062: [Github #3890] Recently Viewed Products block does not appear when FPC is enabled — committed to magento/magento2 by VladimirZaets 7 years ago
- MAGETWO-56062: [Github #3890] Recently Viewed Products block does not appear when FPC is enabled — committed to magento/magento2 by VladimirZaets 7 years ago
- MAGETWO-56062: [Github #3890] Recently Viewed Products block does not appear when FPC is enabled --change required options field — committed to magento/magento2 by deleted user 7 years ago
- MAGETWO-56062: [Github #3890] Recently Viewed Products block does not appear when FPC is enabled --change required options field — committed to magento/magento2 by deleted user 7 years ago
- MAGETWO-56062: [Github #3890] Recently Viewed Products block does not appear when FPC is enabled --make rows observable — committed to magento/magento2 by deleted user 7 years ago
- MAGETWO-56062: [Github #3890] Recently Viewed Products block does not appear when FPC is enabled --make rows observable — committed to magento/magento2 by deleted user 7 years ago
- MAGETWO-56062: [Github #3890] Recently Viewed Products block does not appear when FPC is enabled --fix tests — committed to magento/magento2 by deleted user 7 years ago
- MAGETWO-56062: [Github #3890] Recently Viewed Products block does not appear when FPC is enabled --fix tests — committed to magento/magento2 by deleted user 7 years ago
- MAGETWO-56062: [Github #3890] Recently Viewed Products block does not appear when FPC is enabled — committed to magento/magento2 by VladimirZaets 7 years ago
- MAGETWO-56062: [Github #3890] Recently Viewed Products block does not appear when FPC is enabled — committed to magento/magento2 by deleted user 7 years ago
- MAGETWO-56062: [Github #3890] Recently Viewed Products block does not appear when FPC is enabled — committed to magento/magento2 by deleted user 7 years ago
- MAGETWO-56062: [Github #3890] Recently Viewed Products block does not appear when FPC is enabled — committed to magento/magento2 by deleted user 7 years ago
Hi @slavvka,
Please keep the
2.1.x
issues open until the fix is backported to2.1-develop
If there isn’t a backport scheduled via an internal MAGETWO task, please mark the issue with anup for grabs
label so that anyone from the community was able to notice it and make a backport PR voluntarily.@dhduc Doesn’t that stop the whole page from being cached though? I’m sure I’ve heard that a few times, and if so that is a terrible workaround as the side effect is potentially worse than the initial issue.
Edit: It does stop the whole page from being cached:
Source - http://devdocs.magento.com/guides/v2.1/config-guide/cache/cache-priv-over.html
issue is still exists in magento 2.3.1 when cache is enable then recently products is not showing Anyone know how to solve this ?
@dan-advantec and @crantron - Have you tried adding a product to bag?
For some weird reason recently viewed products will only load once a product has been added to bag, I can replicate this on two completely separate production websites.
Any update on this @magento-engcom-team? Should we create a new issue?
what is wrong with using:
`<?php /**
namespace Magento\Reports\Block\Product;
use \Magento\Framework\DataObject\IdentityInterface;
/**
Reports Recently Viewed Products Block
@author Magento Core Team core@magentocommerce.com */ class Viewed extends AbstractProduct implements IdentityInterface { protected function _construct() { $this->addData(array(‘cache_lifetime’ => false)); }
/**
`
Internal ticket to track issue progress: MAGETWO-66615