0

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

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.

New contributor
Mohammad Faizan is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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