-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Recently viewed products block not working in product page with enabled cache #3890
Comments
Is there any solution to this? |
any solution on this? |
@choukalos can you have Oleh check into this if it may be caching related? |
I am having the same problem, any update on this Magento? |
@pboisvert @choukalos - Any update please? This has been going on for a while (sorry for asking again but this is proving to be pretty problematic). |
@kandrejevs , @BenSpace48 |
I do have 2.1 and the issue is still not resolved. btw. disabling cache, but keeping varnish on = blocks will show up; |
I was noticing similar issues where my private_content_version cookie (used for the AJAX fetching of private content) wasn't set, and requesting the page didn't recreate it for me. Interestingly, adding an item to cart recreates the cookie and I'm able to see these blocks again. In Steps I've used to produce:
Expected result: widget appears Now, add a product to the cart and navigate back to the page where the widget appears and it will render as expected. |
Internal issue MAGETWO-56062 |
The simple solution I've used is disable caching of the Recently Viewed block by PageCache module.
Update: It's just working for me, but it's a terrible solution, see below comment of @BenSpace48. |
@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 |
@BenSpace48 Yes, you're right. It's my fault, so my teammate suggests me to using AJAX alternative. Is it a better solution? |
@dhduc I only know about that because I did the exact same workaround 😱 Yeah I'd say so, I think hole punching that block so it isn't cached but the rest is is the best solution but that is more back-end which is not my speciality so take that with a pinch of salt. |
@BenSpace48 (y) Thanks for letting me know about my solutions. |
Unfortunately, this still appears to be an issue on 2.2.2 |
Still in |
I'm running into a strange issue where sometimes the recently viewed block shows and other times it does not, this is in Magento Where the block should show I'm seeing these tags: The block was added with this XML:
|
@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? |
Did u find a solution yet ? This behaviour is happening for me as well in 2.2.6 |
[2.3.1-qwerty] Sync with 2.3.1-release
I fixed this via my custom script :
|
issue is still exists in magento 2.3.1 |
@sumeetmobiwebtech Did you check my above comment ?#3890 (comment) |
@anupamyx
my.phtml
When cache is disable then this code working but when cache is enable then it is not working. |
Only use this #3890 (comment) . Magento (2.3.0) puts recently viewed in browser's local storage. This uses that. Once you get the product ids you'll have to write a controller which sends you the product information from product ids |
Sorry,i am not getting. |
Issue still exists on 2.3.4. |
Some more info; the However, the Magento DevDocs on Private Content states;
This appears to be the case in this core code. So the recently viewed block code should be rewritten to not rely on |
Shouldn't this be closed since there was |
I agree with @Bartlomiejsz . If anyone want to show the recently viewed product then please use the below code
@sidolov Can we close this issue? |
Thanks @Bartlomiejsz , @konarshankar07 ! Closing the issue according to the comment above. |
Steps to reproduce
<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 containerExpected 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.
The text was updated successfully, but these errors were encountered: