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

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

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.

  • 1
    Cool! it working fine! – Jugal Kishor May 11 '19 at 6:28
  • Thanks for feedback @Jugal Kishor. – Mohammad Faizan May 13 '19 at 6:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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