1

we are displaying Reviews tab above & other 2 tabs Product secription & Features below in Product view page , I want to display Reviews tab next to other 2 tabs.

enter image description here

code for 2 tabs [view.phtml]

<div id="tab-container">
    <div class="tabs active" onclick="changeTab(0)">Product Description</div>
    <div class="tabs" onclick="changeTab(1)">Features</div>
    <div id="tab-1" class="tab-text active">
        INSERT FIRST TAB CONTENT HERE
    </div>
    <div id="tab-2" class="tab-text">
        INSERT SECOND TAB CONTENT HERE
    </div>
</div>

code for Review tab [ app/design/frontend/rwd/theme/template/review/helper/summary_short.phtml ]

<?php if ($this->getReviewsCount()): ?>
    <div class="ratings">
        <?php if ($this->getRatingSummary()):?>
            <div class="rating-box">
                <div class="rating" style="width:<?php echo $this->getRatingSummary() ?>%"></div>
            </div>
        <?php endif;?>
        <span class="amount"><a href="#" onclick="var t = opener ? opener.window : window; t.location.href='<?php echo $this->getReviewsUrl() ?>'; return false;"><?php echo $this->__('%d Review(s)', $this->getReviewsCount()) ?></a></span>
    </div>
<?php elseif ($this->getDisplayIfEmpty()): ?>
    <p class="no-rating"><a href="<?php echo $this->getReviewsUrl() ?>#review-form"><?php echo $this->__('Be the first to review this product') ?></a></p>
<?php endif; ?>
  • So you want, "Reviews" tab to go to the bottom next to the other 2 or the other 2 to go top the top next to "Reviews"? Do you want to have 3 tabs? – user41363 Jul 4 '16 at 14:22
  • @Paul i want to display review tab on right side of other 2 tabs. – Baby in Magento Jul 4 '16 at 18:12
  • Check my answer below @BabyinMagento and if you don't understand something just let me know. – user41363 Jul 5 '16 at 9:07
  • @Paul can you please help here – Baby in Magento Jul 5 '16 at 12:40
2

Here is what you need to do:

enter image description here If you do not understand something please let me know.

| improve this answer | |
1

Add below code under html code

<?php
    $reviewListBlock = $this->getLayout()->createBlock('review/product_view_list');
    $reviewFormBlock = $this->getLayout()->createBlock('review/form');

    echo $reviewListBlock->setTemplate('review/product/view/list.phtml')->toHtml();
    echo $reviewFormBlock->setTemplate('review/form.phtml')->toHtml();
?>
| improve this answer | |

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.