Post by QenTox » Sun Oct 24, 2010 5:05 pm

I have maybe a strange request, but I believe it should be done this way. Now everyone can rate products without even having an account in my e-shop, so they can spam my site and their ratings will be with no value for me and for the customers. I wonder, if there is any way how to allow to rate products on my site only for customers with account (registered users)?

I was trying to find something like this here, but was'nt succesful. Thank you for your help and advices in advance.

Newbie

Posts

Joined
Sun Aug 15, 2010 8:03 am

Post by Johnathan » Sun Oct 24, 2010 10:38 pm

To make the review writing ability only available to logged-in customers, do the following:

IN:

Code: Select all

/catalog/view/theme/YOURTHEME/template/product/product.tpl
AFTER:

Code: Select all

<div id="review"></div> 
ADD:

Code: Select all

<?php if ($this->customer->isLogged()) { ?>
AND BEFORE:

Code: Select all

</div>
<?php } ?>
<div id="tab_image" class="tab_page">
ADD:

Code: Select all

<?php } ?>
This effectively puts a conditional block around the review writing portion, so it'll only show if the customer has an account and is logged in. I tested it briefly and it seems to work fine.

Image Image Image Image Image


User avatar
Administrator

Posts

Joined
Fri Dec 18, 2009 3:08 am


Post by QenTox » Mon Oct 25, 2010 12:37 am

It works like a charm. Thanks a lot for your help! :-)

Newbie

Posts

Joined
Sun Aug 15, 2010 8:03 am
Who is online

Users browsing this forum: No registered users and 58 guests