1

we are using following code for displaying review & ratings section. I want to display stars above Title This is really very good product

enter image description here

<?php $_items = $this->getReviewsCollection()->getItems();?>
<div class="box-collateral box-reviews" id="customer-reviews">
    <?php if (count($_items)):?>
        <div class="review-heading">
            <h2>
                <?php echo $this->__('') ?>
                <span class="reviewtab">
                <?php 
            //  echo count($_items); 
                ?> 
                Ratings & Reviews
                </span>
            </h2>
            <?php echo $this->getChildHtml('toolbar') ?>
        </div>
        <dl>
        <?php foreach ($_items as $_review):?>

            <dt>
                <a href="<?php echo $this->getReviewUrl($_review->getId()) ?>">
                    <?php echo $this->escapeHtml($_review->getTitle()) ?>
                </a>
            </dt>
            <dd>
                <?php $_votes = $_review->getRatingVotes(); ?>

                <?php echo nl2br($this->escapeHtml($_review->getDetail())) ?>


                <?php if (count($_votes)): ?>
                <table class="ratings-table">
                    <colgroup>
                        <col class="review-label" />
                        <col class="review-value" />
                    </colgroup>
                    <tbody>
                        <?php foreach ($_votes as $_vote): ?>
                        <tr>
                            <th><?php echo $this->escapeHtml($_vote->getRatingCode()) ?></th>
                            <td>
                                <div class="rating-box">
                                    <div class="rating" style="width:<?php echo $_vote->getPercent() ?>%;"></div>
                                </div>
                            </td>
                        </tr>
                        <?php endforeach; ?>
                    </tbody>
                </table>
                <?php endif; ?>


                <span class="review-meta">
                    <?php echo $this->__('Review by %s', $this->escapeHtml($_review->getNickname())) ?>
                    /
                   <?php echo $this->__('(Posted on %s)', $this->formatDate($_review->getCreatedAt()), 'long') ?>
                </span>
            </dd>
        <?php endforeach; ?>
        </dl>

        <?php // echo $this->getChildHtml('toolbar') ?>
    <?php elseif($this->getParentBlock()): ?>
        <?php echo $this->getParentBlock()->getReviewsSummaryHtml($this->getProduct(), 'short', true)?>
    <?php endif;?>
    <?php echo $this->getChildHtml('review_form') ?>
</div>

2 Answers 2

1

Find the xml where that template is included, most probably catalog.xml or review.xml, but could be local.xml.

Use unsetChild action and include it in your local.xml after the title block.

0
<?php $_items = $this->getReviewsCollection()->getItems();?>
<div class="box-collateral box-reviews" id="customer-reviews">
<?php if (count($_items)):?>
    <div class="review-heading">
        <h2>
            <?php echo $this->__('') ?>
            <span class="reviewtab">
            <?php 
        //  echo count($_items); 
            ?> 
            Ratings & Reviews
            </span>
        </h2>
        <?php echo $this->getChildHtml('toolbar') ?>
    </div>
    <dl>
    <?php foreach ($_items as $_review):?>

        <dt>
        <?php $_votes = $_review->getRatingVotes(); ?>
            <?php if (count($_votes)): ?>
            <table class="ratings-table">
                <colgroup>
                    <col class="review-label" />
                    <col class="review-value" />
                </colgroup>
                <tbody>

                    <?php foreach ($_votes as $_vote): ?>
                    <tr>
                        <th><?php echo $this->escapeHtml($_vote->getRatingCode()) ?></th>
                        <td>
                            <div class="rating-box">
                                <div class="rating" style="width:<?php echo $_vote->getPercent() ?>%;"></div>
                            </div>
                        </td>
                    </tr>
                    <?php endforeach; ?>
                </tbody>
            </table>
            <?php endif; ?>
            <a href="<?php echo $this->getReviewUrl($_review->getId()) ?>">
                <?php echo $this->escapeHtml($_review->getTitle()) ?>
            </a>
        </dt>
        <dd>

            <?php echo nl2br($this->escapeHtml($_review->getDetail())) ?>




            <span class="review-meta">
                <?php echo $this->__('Review by %s', $this->escapeHtml($_review->getNickname())) ?>
                /
               <?php echo $this->__('(Posted on %s)', $this->formatDate($_review->getCreatedAt()), 'long') ?>
            </span>
        </dd>
    <?php endforeach; ?>
    </dl>

    <?php // echo $this->getChildHtml('toolbar') ?>
<?php elseif($this->getParentBlock()): ?>
    <?php echo $this->getParentBlock()->getReviewsSummaryHtml($this->getProduct(), 'short', true)?>
<?php endif;?>
<?php echo $this->getChildHtml('review_form') ?>

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.