1

In magento 1.9.2.4, in the product details page, I want to display 'Recently viewed products' in place of description. How to do that? How to call the product_viewed.phtml into the place where description section is residing now as below: enter image description here

1

For replacing Description with Recently View products replace this code from catalog.xml

<block type="catalog/product_view_description" name="product.description" as="description" template="catalog/product/view/description.phtml">
    <action method="addToParentGroup"><group>detailed_info</group></action>
    <action method="setTitle" translate="value"><value>Description</value></action>
</block>

TO :

<block type="reports/product_viewed" name="product.description" as="description" template="reports/product_viewed.phtml">
    <action method="addToParentGroup"><group>detailed_info</group></action>
    <action method="setTitle" translate="value"><value>Description</value></action>
</block>

For Adding NEW TAB for Recently View products, Replace

<block type="catalog/product_view_description" name="product.description" as="description" template="catalog/product/view/description.phtml">
    <action method="addToParentGroup"><group>detailed_info</group></action>
    <action method="setTitle" translate="value"><value>Description</value></action>
</block>

WITH:

<block type="catalog/product_view_description" name="product.description" as="description" template="catalog/product/view/description.phtml">
    <action method="addToParentGroup"><group>detailed_info</group></action>
    <action method="setTitle" translate="value"><value>Description</value></action>
</block>
<block type="reports/product_viewed" name="product.recentview" as="recentview" template="reports/product_viewed.phtml">
    <action method="addToParentGroup"><group>detailed_info</group></action>
    <action method="setTitle" translate="value"><value>Recently View</value></action>
</block>
| improve this answer | |
  • When I change the value field it is changing. But phtml file is not changing – Ramya May 7 '16 at 8:52
  • not getting , ?? – Anil Suthar May 7 '16 at 12:22
  • I replaced the code with yours. But the recently viewd products are not getting displayed. – Ramya May 7 '16 at 12:54
  • 1
    plz, clear cache and visit one or more VISIBLE product – Anil Suthar May 7 '16 at 12:58
0

Just add below code after Description block in catalog.xml files

<block type="reports/product_viewed" name="Your_attribute_name" as="reportsproductviewed" template="reports/product_viewed.phtml">
    <action method="addToParentGroup"><group>detailed_info</group></action>
    <action method="setTitle" translate="value"><value>Your tab name</value></action>
 </block>
| improve this answer | |
  • no changes are happening – Ramya May 7 '16 at 9:41

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.