By default in woocommerce when a user wants to add a review of a product, they click 'add a review' and this opens up a pop-up lightbox. I want to disable this part and just display the review form. Anybody has any ideas?
1 Answer
Here's a hack you can use.
Update: As Andrew Bartel mentioned below. It's best to copy the template files into your theme so that they override the default woo commerce template files.
In your woocommerce plugin folder, look for a file called product-reviews.php
woocommerce/templates/single-product-reviews.php
Look for a line that says
<div id="review_form_wrapper">
Either remove the class review_form_wrapper, or add a 1 in front of it. That will make the hidden form visible.
Next you will want to remove the other buttons that says ADD REVIEW (triggers lightbox), because you will already have the SUBMIT REVIEW button at the end.
You will want to modify these lines to your needs:
<a href="#review_form" class="inline show_review_form">submit yours</a>
<a href="#review_form" class="inline show_review_form button" title="' . __( 'Add Your Review', 'woocommerce' ) . '">' . __( 'Add Review', 'woocommerce' ) . '</a>
You could either remove the lines above, or you could just add a display:none to each paragraph element to hide the whole thing
style="display:none"
-
Am I not supposed to answer plugin questions? Why was my answer down voted?– gdanielCommented Apr 29, 2013 at 18:29
-
I down voted because you're committing (basically) the same sin as hacking core. I know you put a caveat at the top of the answer but did you investigate an alternate solution? Commented Apr 29, 2013 at 21:46
-
My only other solution would be to change those lines with javascript. Something that would run after the page loads. But this would also be a temporary solution since those lines can chance with any update. What's a better solution?– gdanielCommented Apr 30, 2013 at 14:25
-
@Andrew Bartel What solution do you have? It's not hacking the core, these are template files are ok to modify.– KeithCommented May 1, 2013 at 10:43
-
@KeithDonegan Best practices are to copy the template files into your theme so that they override the default woo commerce template files. gdaniel, If you want to edit your answer to reflect that, I'd be happy to upvote. Commented May 1, 2013 at 17:21