0

Can anyone tell me how can I show a recently viewed product section in the customer account sidebar?

Any help would be appreciated.

Thanks in advance..!

1 Answer 1

0

I have done using below way

app/design/frontend/vendorname/themename/Magento_Customer/layout/default.xml
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
    <referenceContainer name="sidebar.additional">
         <block class="Magento\Reports\Block\Product\Widget\Viewed" before="-" name="recently_viewed" cacheable="false" template="Magento_Reports::widget/viewed/content/viewed_grid.phtml">
                    <action method="setPageSize">
                        <argument name="page_size" xsi:type="number">5</argument>
                    </action>
        </block>
    </referenceContainer>
  </body>
</page>

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.