0

Looking for some help with the recently viewed products block/widget in Magento2.3.2. Have tried three different approaches - creating the widget in the widget section, creating the widget as a new block, and using an existing (functioning) product list block (best sellers) as a template - yet each time the block just appears as this on the frontend:

enter image description here

This is the code in editor for reference:

{{widget type="Magento\Catalog\Block\Widget\RecentlyViewed" uiComponent="widget_recently_viewed" page_size="5" show_attributes="name,image,price" show_buttons="add_to_cart" template="product/widget/viewed/grid.phtml"}}

Any help would be greatly appreciated.

Thanks.

0
0

Just keep below code in your template file for get recently viewed products in any place,


<?php echo $this->getLayout()->createBlock("Magento\Reports\Block\Product\Widget\Viewed")->setDisplayType("recently.view.products")->setProductsCount("5")->setTemplate("widget/viewed/content/viewed_list.phtml")->toHtml(); ?>

reference link.

1
  • Thanks Ranjeet. Doesn't appeared to have fixed the issue though. – fredc Mar 9 at 21:34

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.