1

I'm creating a plugin that will extend the review tab title and content in the frontend. So far I can display some text in the product details page using this in my layout file in app\design\frontend\base\default\layout\my\reviewcontainer.xml:

<?xml version="1.0" encoding="UTF-8"?> <layout version="1.0.0"> <catalog_product_view> <reference name="product.info.additional"> <block type="reviewcontainer/tabs" name="product.info.tabs" as="info_tabs"> <action method="setTemplate"> <template>my/reviewcontainer/tabs.phtml</template> </action> </block> </reference> </catalog_product_view> </layout> 

Which calls the template app\design\frontend\base\default\template\my\reviewcontainer\tabs.phtml which basically has and outputs:

<h1 style="color: #e2000a; font-size: 200px">Hey there!</h1> 

Just bellow the <div class="product-collateral toggle-content tabs">..</div>

How can I edit this script so that the above template changes the review tab title and content instead?

1 Answer 1

2

You can set title of review by setTitle function.

<action method="setTitle" translate="value"><value>Reviews</value></action> 

May there are issue in your code.

Layout code is:

 <catalog_product_view> <reference name="product.reviews"> <action method="setTemplate"> <template>my/reviewcontainer/tabs.phtml</template> </action> <action method="setTitle" translate="value"><value>Bal</value></action> </reference> </catalog_product_view> 

Or try this:

<catalog_product_view> <reference name="product.info"> <action method="unsetChild"><name>product.reviews</name></action> <block type="reviewcontainer/tabs" name="product.reviews" as="reviews" template="my/reviewcontainer/tabs.phtml" after="additional"> <action method="addToParentGroup"><group>detailed_info</group></action> <action method="setTitle" translate="value"><value>Reviewsddddd</value></action> </block> </reference> </catalog_product_view> 
1
  • Thanks Amit, since I'm developping a plugin, is it possible to do this inside a controller or a PHP Bloc/ file instead of the XML? Commented Jul 15, 2015 at 22:27

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.