X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   product rating for registered members only (https://forum.x-cart.com/showthread.php?t=26500)

razorblade 11-09-2006 05:08 PM

product rating for registered members only
 
i have searched the forum and can't find an answer. i do not want anyone who visits my site to be able to rate a product. how do i make this feature only available to members that are signed into their account?

balinor 11-09-2006 06:38 PM

Re: product rating for registered members only
 
There isn't a setting in admin for that, only for adding reviews. You would need to tweak the code to hide the rating option for non-logged in people.

jdiehl 11-10-2006 11:37 AM

Re: product rating for registered members only
 
And it shouldn't very hard. Look at the code for the auth panel that shows a logout button, it obviously only displays if someone is logged in.

razorblade 11-10-2006 12:15 PM

Re: product rating for registered members only
 
Quote:

Originally Posted by jdiehl
And it shouldn't very hard. Look at the code for the auth panel that shows a logout button, it obviously only displays if someone is logged in.


thanks, i checked it out, but honestly i am a ant in the world of xcart. any mod i incorpaorate has only come from detailed instructions, blind luck, or trial and error. and i am terrified of wrecking my xcart.

could you possibly be a little more specific as to which templates and what i need to change. if not no biggy, thanks!

jdiehl 11-10-2006 03:04 PM

Re: product rating for registered members only
 
It must be your lucky day. I'm working in a fresh X-Cart install and I'm feeling generous so I looked it up for you. Try this and see if it works:

Open /xcart/skin1/modules/Customer_Reviews/vote.tpl and in version 4.0.19 it is line 24-36, find the following:
Code:

<TR>
<TD><BR>{$lng.lbl_customer_voting}</TD>
<TD>
<BR>
<SELECT name="vote">
<OPTION value="" selected>{$lng.lbl_select_rating}</OPTION>
<OPTION value="5">{$lng.lbl_excellent}</OPTION>
<OPTION value="4">{$lng.lbl_very_good}</OPTION>
<OPTION value="3">{$lng.lbl_good}</OPTION>
<OPTION value="2">{$lng.lbl_fair}</OPTION>
<OPTION value="1">{$lng.lbl_poor}</OPTION>
</SELECT>&nbsp;<INPUT type="submit" value="{$lng.lbl_rate_it}">
</TD></TR></FORM>


And replace with this:
Code:

{if $login ne ""}
<TR>
<TD><BR>{$lng.lbl_customer_voting}</TD>
<TD>
<BR>
<SELECT name="vote">
<OPTION value="" selected>{$lng.lbl_select_rating}</OPTION>
<OPTION value="5">{$lng.lbl_excellent}</OPTION>
<OPTION value="4">{$lng.lbl_very_good}</OPTION>
<OPTION value="3">{$lng.lbl_good}</OPTION>
<OPTION value="2">{$lng.lbl_fair}</OPTION>
<OPTION value="1">{$lng.lbl_poor}</OPTION>
</SELECT>&nbsp;<INPUT type="submit" value="{$lng.lbl_rate_it}">
</TD></TR>{/if}</FORM>


And that should work. I didn't try it myself though. Keep in mind that if you can also add an else statement to notify people that they must be logged in to set a rating.

razorblade 11-13-2006 02:47 PM

Re: product rating for registered members only
 
worked like a charm. but the lbl_customer_voting causes the word "Voting" to appear twice. so i created a new one called

lbl_customer_votinglimit

"Voting - members only"

and change the first lbl_customer_voting to lbl_customer_votinglimit

looks great. (and i think i am finally starting to see how it all works)

thanks!


All times are GMT -8. The time now is 08:06 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.