0

I have added a code in Magento_Catalog/layout/catalog_product_view.xml

<referenceBlock name="product.info.details">

       <block class="Magento\Reports\Block\Product\Widget\Viewed" name="recently_viewed" template="Magento_Reports::widget/viewed/content/viewed_grid.phtml" group="detailed_info">     
            <arguments>
              <argument translate="true" name="title" xsi:type="string">Recently Viewed</argument>
              <argument name="sort_order" xsi:type="string">50</argument>
            </arguments>                
            <action method="setPageSize">
                    <argument name="page_size" xsi:type="number">4</argument>
                </action>                   
        </block>    
    </referenceBlock>

The above code showing only the recently viewed tab, but products are not showing.

Here i am attaching the screenshot,

enter image description here

Please anyone look into it and update me. Thanks

1 Answer 1

3

Try This :-

<block class="Magento\Catalog\Block\Widget\RecentlyViewed" name="recently_viewed" template="Magento_Catalog::product/widget/viewed/grid.phtml" after="-">
    <arguments>
        <argument name="uiComponent" xsi:type="string">widget_recently_viewed</argument>
        <argument name="page_size" xsi:type="number">4</argument>
        <argument name="show_attributes" xsi:type="string">name,image,price,learn_more</argument>
        <argument name="show_buttons" xsi:type="string">add_to_cart,add_to_compare,add_to_wishlist</argument>
    </arguments>
</block>
14
  • I am trying include this in tabs, can i use this code? Jun 6, 2019 at 7:36
  • yes you can try Jun 6, 2019 at 7:38
  • yes, this working for me, thanks, can we resize the product image there, like upsell prdoucts image size. Jun 6, 2019 at 7:41
  • please attach screen-shot Jun 6, 2019 at 7:49
  • thanks, i made it working.. Jun 6, 2019 at 8:01

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.