Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Page 1 of 3
Add the review form on product tab in the modern theme
 
zmove
Guru
 
Total Posts:  317
Joined:  2008-04-30
 

Hi,

I saw that you can add custom tabs on the product page with the modern theme.

I could find how to add review list using this code in review.xml

<catalog_product_view>
        <
reference name="product.info.tabs">
            <
action method="addTab" translate="title" module="review">
                <
alias>avis</alias>
                <
title>Avis/commentaires</title>
                <
block>review/product_view_list</block>
                <
template>review/product/view/list_tab.phtml</template>
            </
action>
        </
reference>
    </
catalog_product_view>

I found how to extend it a little to add the toolbar for example like that :

<reference name="product.info.tabs">
            <
block type="page/html_pager" name="product_review_list.toolbar" as="toolbar"/>
            <
action method="addTab" translate="title" module="review">
                <
alias>avis</alias>
                <
title>Commentaires</title>
                <
block>review/product_view_list</block>
                <
template>review/product/view/list.phtml</template>
            </
action>
</
reference>

But, following the same logic, impossible to output the review form. Though, there is a <?php echo $this->getChildHtml('review_form') ?>
in the review/product/view/list.phtml file, so why the review form is not printed ?

I would add that I’m able to add the review form in a new tab using this :

<catalog_product_view>
        <
reference name="product.info.tabs">
            <
action method="addTab" translate="title" module="review">
                <
alias>form</alias>
                <
title>Review form</title>
                <
block>review/form</block>
                <
template>review/form.phtml</template>
            </
action>            
        </
reference>
    </
catalog_product_view>

Now, how to add the both block into only one tab ?

Any help would be appreciated. Thanks

 
Magento Community Magento Community
Magento Community
Magento Community
 
Dustin
Sr. Member
 
Total Posts:  160
Joined:  2008-03-13
Columbus, OH
 

I am trying to get this to work as well. I can get the tab in the bar and the reviews to load, but not the actual review form.

 
Magento Community Magento Community
Magento Community
Magento Community
 
zmove
Guru
 
Total Posts:  317
Joined:  2008-04-30
 

Any news on it ? I saw several magento shop implementing this feature (don’t remember what stores), so It should be possible.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Hanneman
Jr. Member
 
Avatar
Total Posts:  7
Joined:  2007-11-15
Eindhoven, The Netherlands
 

Try this in the review tab .phtml. Maybe not the most ‘clean’ solution but it works.

The review form should also be defined in your layout xml.

<?php 
    $layout 
Mage::getSingleton('core/layout');
    
$block $layout->getBlock('content')->getChild('product.info')->getChild('info_tabs')->getChild('review_form');
    echo 
$block->toHtml();
?>
 
Magento Community Magento Community
Magento Community
Magento Community
 
zmove
Guru
 
Total Posts:  317
Joined:  2008-04-30
 

Hi,

It seems to work, here is a details how I did it :

I added the call to the review form in the review.xml file, so I have that :

<catalog_product_view>
        <
reference name="product.info.tabs">
        <
block type="review/form" name="product.review.form" as="review_form"/>

            <
action method="addTab" translate="title" module="review">
                <
alias>avis</alias>
                <
title>Avis commentaires</title>
                <
block>review/product_view_list</block>
                <
template>review/product/view/list.phtml</template>
            </
action>        
        </
reference>
    </
catalog_product_view>

In template/review/product/list.phtml, I added your code at the end.

And it works

Thank you

 
Magento Community Magento Community
Magento Community
Magento Community
 
skicrave
Member
 
Total Posts:  51
Joined:  2007-12-02
 

Thanks for posting this information, this has been on my list of features to implement!

Is there any way to link directly to the reviews tab?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Alouette
Jr. Member
 
Total Posts:  24
Joined:  2008-05-23
 
zmove - 11 March 2009 01:58 AM

Hi,

It seems to work, here is a details how I did it :

I added the call to the review form in the review.xml file, so I have that :

<catalog_product_view>
        <
reference name="product.info.tabs">
        <
block type="review/form" name="product.review.form" as="review_form"/>

            <
action method="addTab" translate="title" module="review">
                <
alias>avis</alias>
                <
title>Avis commentaires</title>
                <
block>review/product_view_list</block>
                <
template>review/product/view/list.phtml</template>
            </
action>        
        </
reference>
    </
catalog_product_view>

In template/review/product/list.phtml, I added your code at the end.

And it works


Thank you

Works great!Thank you for your input!!

 
Magento Community Magento Community
Magento Community
Magento Community
 
MarvinToys
Sr. Member
 
Avatar
Total Posts:  194
Joined:  2008-07-27
 

.

i want do this with custom options but it doesnt work:

anybody an Idea ???

 
Magento Community Magento Community
Magento Community
Magento Community
 
Alouette
Jr. Member
 
Total Posts:  24
Joined:  2008-05-23
 

Hello,
but how to you link the ‘ 1 review’ / add your review’ to the new review tab?
I have a new tab showing properly, but if you click on it, it will still go to the other page of review whereas I would want it to go the the Review Tab?
cheers

 
Magento Community Magento Community
Magento Community
Magento Community
 
Paul-xib
Sr. Member
 
Avatar
Total Posts:  116
Joined:  2009-02-02
The Netherlands
 

also struggling with this small problem.

I made some tabs. it all works fine except the reviews. they won’t show/open inside the tab reviews.

when i look at the source it is calling the review options and form. but it’s not showing. also the tabs don’t work when this happens.

What do i need to edit to fix this? i am getting nuts here rasberry

example:

http://www.grafiluxzonwering.be/offerte-aanvragen/jasno-blinds.html

 
Magento Community Magento Community
Magento Community
Magento Community
 
Keith Moon
Jr. Member
 
Avatar
Total Posts:  20
Joined:  2009-03-08
London
 

Hello everyone

I’m trying to call the number of reviews a product has on tabs.phtml by using this command:

<?php echo $this->__('%d Review(s)'$this->getReviewsCount()) ?>
However, it keeps returning 0 Review(s). Am I missing something? Probably a mage, right?

Thanks a lot!

 
Magento Community Magento Community
Magento Community
Magento Community
 
skicrave
Member
 
Total Posts:  51
Joined:  2007-12-02
 
Alouette - 16 June 2009 06:53 AM

Hello,
but how to you link the ‘ 1 review’ / add your review’ to the new review tab?
I have a new tab showing properly, but if you click on it, it will still go to the other page of review whereas I would want it to go the the Review Tab?
cheers

I don’t think it’s possible with the JavaScript used to display the tabs in the modern theme. I would also like to know how to open a specific tab, but I don’t think it can be done.

 
Magento Community Magento Community
Magento Community
Magento Community
 
immaterial thought
Jr. Member
 
Total Posts:  5
Joined:  2008-01-31
 

I have this for the most part figured out and thought I would share. I created a new list.phtml called list_tab.phtml file - shown below template/review/product/view/list_tab.phtml

The key changes are the review title link which changed to

href="review/product/view/id/<?php echo ($_review->getId()) ?>"
and the call for the review form which changed to
<?php echo $this->getLayout()->createBlock('review/form')->setBlockId('')->toHtml() ?>
I also removed the call for the toolbar from the original list.phtml file because I have not been able to get it to work yet (Does anyone have a fix for this)

<?php $_items $this->getReviewsCollection()->getItems();?>
<?php 
if (count($_items)):?>
<div class="padder">
    
    <
ol>
        
<?php foreach ($_items as $_review):?>
            
<li>
                <
a href="review/product/view/id/<?php echo ($_review->getId()) ?>"><strong><?php echo $this->htmlEscape($_review->getTitle()) ?></strong></a<?php echo $this->__('Review by %s'$this->htmlEscape($_review->getNickname())) ?>
                
<table class="ratings-list" cellspacing="0">
                    <
tbody>
                        
<?php foreach ($_review->getRatingVotes() as $_vote): ?>
                        
<tr>
                            <
td class="label"><strong><?php echo $_vote->getRatingCode() ?></strong></td>
                            <
td>
                                <
div class="rating-box">
                                    <
div class="rating" style="width: <?php echo $_vote->getPercent() ?>%;"></div>
                                </
div>
                            </
td>
                        </
tr>
                        
<?php endforeach; ?>
                    
</tbody>
                </
table>
                <
p><?php echo nl2br($this->htmlEscape($_review->getDetail())) ?> <?php echo $this->__('(Posted on %s)'$this->formatDate($_review->getCreatedAt()), 'long'?></p>
            </
li>
        
<?php endforeach; ?>
    
</ol>       

</
div>
<?php endif;?>

<br/>
<?php echo $this->getLayout()->createBlock('review/form')->setBlockId('')->toHtml() ?>

I also made changes to the catalog.xml adding the following line to the product.info.tabs section to create the tab

<action method="addTab" translate="title" module="review"><alias>reviews</alias><title>Reviews</title><block>review/product_view_list</block><template>review/product/view/list_tab.phtml</template></action>

I hope this helps - If anyone has a fix for the toolbar not working I would appreciate it.

 
Magento Community Magento Community
Magento Community
Magento Community
 
skicrave
Member
 
Total Posts:  51
Joined:  2007-12-02
 

I really wish Magento used jQuery (for lots of reasons), because it would make this task much easier.  Currently it’s not possible to link directly to a tab, which means you can send people directly to the review form which makes it very hard to solicit for reviews.  I’m going to have to work on this issue because we noticed a major decrease in the number of reviews when we moved them to a tab, which is unfortunate.

 
Magento Community Magento Community
Magento Community
Magento Community
 
strelok
Member
 
Total Posts:  41
Joined:  2009-05-03
 

Hi,

I’m trying to add the review form to the product page too, i’m using the extension “easytabs”.

I have a big problem: the review form prints correctly, but when I click “submit”, there is no javascript validation (even if the form is empty), and the review is not posted. Instead, the product is added to the cart :-(

Does anyone know what could be happening? I checked the html generated, and the <div class=review-form-div> is exactly the same on the product page, and on the reviews page… Yet on the product page it doesn’t work…

I need help please smile

The form is added to the review tab on the product page with this code:

<div class="review-form-div">
<?php echo $this->getChildHtml('review_form'?> 
<?php 
echo $this->getLayout()->createBlock('review/form')->setBlockId('product.review.form')->toHtml() ?> 
</div>

Strelok

 
Magento Community Magento Community
Magento Community
Magento Community
 
-- Maggi --
Jr. Member
 
Total Posts:  7
Joined:  2008-12-08
 

To show the toolbar just add this code to the “content” part of “catalog_product_view” in the catalog.xml:
<block type="page/html_pager" name="product_review_list.toolbar" />

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top
Page 1 of 3