4

Why recently view products not showing on product view page if any customer not logged.
When customer logged in their account then recently view product showing on product view page.
if customers log out from their account then recently view products not showing on product view page.
Anyone know above problem why above error generating?
using code below
<?php echo $this->getLayout() ->createBlock("Magento\Reports\Block\Product\Widget\Viewed") ->setDisplayType("recently.view.products")->setProductsCount("4") ->setTemplate("widget/viewed/content/viewed_list.phtml")->toHtml(); ?>

4
  • Did u make it work ? Not working for me either Jan 1, 2019 at 16:05
  • It's session error. visitor_id not inserted in reports table. fetch it by custom mysql query. Jan 4, 2019 at 13:37
  • 1
    Can u post your answer with code and configurations clearly so its easier to understand ? Jan 6, 2019 at 7:03
  • please add your code of viewed_list.phtml and Widget\Viewed block file. Jan 7, 2019 at 6:42

2 Answers 2

4

There is an Admin setting that will show the Recently Viewed Products for Not Logged in Customers.

Go to Admin => Stores > Settings > Configuration > Catalog > Recently Viewed/Compared Products select Yes to ( Synchronize widget products with backend storage )

Clear cache and check.

6
  • 1
    Cool! it working fine! May 11, 2019 at 6:28
  • Thanks for feedback @Jugal Kishor. May 13, 2019 at 6:26
  • @JugalKishor not worked for me. please help
    – Divyesh
    Mar 5, 2020 at 6:53
  • @MohammadFaizan Not worked for me. please help
    – Divyesh
    Mar 5, 2020 at 6:53
  • @Divyesh Caching Enable or Not? Mar 5, 2020 at 11:45
2

I got the sollution for this, Goto Store -> Setting -> Configuration -> General ->Reports -> General Options -> Enable reports -> Yes Then refresh statistics and clear cache then ,ready to go Thanks

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.