2

I have created a customized popup, on list page for submitting review. Use of the popup,

  1. When user clicks on write review on list page, it generates a popup with form to submit the review.
  2. Here is my custom form for the popup, I want to add "rating box" in the form.
  3. I tried adding default rating table of "rwd" review/form.phtml but it's not working.

Suggest solution to add rating input:

 <div class="p_content_list write_review">
       <h2>Write A Review</h2>
       <div class="close_box"><a href="#" class="p_close js__p_close" title="Close"></a></div>
       <span class="border-bottom"></span>
       <div class="col-main">
        <form id="review-form" action="" method="post">
            <?php echo $this->getBlockHtml('formkey'); ?>
            <div class="fieldset wide">
                <div class="wide">
                    <div class="left-form">
                        <label for="billing:street1">Title</label>
                        <div class="input-box">
                            <input type="text" name="title" title="Title" id="summary_field" class="input-text required-entry" value="" /> 
                        </div>
                     </div>
                     <div class="rate">
                        <p>Click To Rate</p>
                        **I WANT CODE FOR RATING ON THIS TAG**
                     </div>     
                </div>
                <div class="wide">
                    <label for="billing:street1">Review</label>
                    <div class="input-box">
                        <textarea type="text" name="detail" id="review_field" class="input-text  required-entry" value="" title="Review"></textarea>
                    </div>
                </div>
             <div class="buttons-set" id="billing-buttons-container">
                <button type="submit" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Submit Review')) ?>" class="button color-border">Submit</button>
                <button type="reset" title="Continue" class="button cancel">Cancel</button>
             </div>
            </div>
        </form>
    </div>    
 </div>
1
  • 1
    Sorry I forgot this one Commented Nov 24, 2016 at 4:03

1 Answer 1

2

I am not sure but you can try below code This might work for you.

<?php 
  $_product = Mage::getModel('catalog/product')->load($product_id);  
  echo $this->getLayout()->createBlock('review/product_view_list')->setProduct($_product)->setTemplate('review/product/view/list.phtml')->toHtml(); 
?>
7
  • @MrunmayDeswandikar You are always welcome Commented Nov 23, 2016 at 12:26
  • @MurtuzaZabuawala do you have an Idea how to do this on magento 2.1? Commented Dec 29, 2016 at 10:34
  • @RonakChauhan same syntax just change block type as in magento 2 and change template as in magento 2 Commented Dec 29, 2016 at 11:05
  • I want to show review form in custom page magento.stackexchange.com/questions/152353/… Pls help you have any idea Commented Dec 29, 2016 at 11:07
  • I have product object but not getting how would i call review block directly Commented Dec 29, 2016 at 11:08

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.