Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

voting with based on xxx votes?!?

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #1  
Old 03-06-2003, 10:21 AM
 
mickna mickna is offline
 

Newbie
  
Join Date: Feb 2003
Location: Munich, germany
Posts: 6
 

Default voting with based on xxx votes?!?

Hi there!

I asked myself if there is a nice way to put a txt beside the voting-stars with something like "based on xxx votes"?!

A five-star-rating is nothing, if there is only one voting


Cheers,
Mickna
Reply With Quote
  #2  
Old 03-07-2003, 12:54 AM
 
mickna mickna is offline
 

Newbie
  
Join Date: Feb 2003
Location: Munich, germany
Posts: 6
 

Default

Done!

I think this should work:

Have to hack customer/vote.php. Insert the line
$smarty->assign ("vote_total", $vote_result["total"]);

Code:
..... ..... $vote_max_cows = floor ($vote_result["rating"]); $vote_little_cow = round (($vote_result["rating"]-$vote_max_cows) * 4); $vote_free_cows = 5 - $vote_max_cows - (($vote_little_cow==0) ? 0 : 1); $smarty->assign ("vote_max_cows", $vote_max_cows); $smarty->assign ("vote_little_cow", $vote_little_cow); $smarty->assign ("vote_free_cows", $vote_free_cows); ###################variable for votingtotals $smarty->assign ("vote_total", $vote_result["total"]); ###################end ..... .....

Next open /modules/Customer_Reviews/vote.tpl and insert:
{$lng.lbl_votetotal_1} {$vote_total} {$lng.lbl_votetotal_2}
after the stars:

Code:
..... ..... {section name=free_cows loop=$vote_free_cows} [img]{$ImagesDir}/star_0.gif[/img] {/section} {$lng.lbl_votetotal_1} {$vote_total} {$lng.lbl_votetotal_2} </TD></TR> {/if} .... ....

Well and then open the language in the admin-section and add two new fields:

Code:
lbl_votetotal_1 | Based on | Based on lbl_votetotal_1 | reviews | reviews

Think this is right

Cheers,
mickna
Reply With Quote
  #3  
Old 01-18-2004, 06:11 PM
 
NuAlpha NuAlpha is offline
 

X-Adept
  
Join Date: Aug 2003
Location: US
Posts: 598
 

Default

In vote.tpl you could alternatively add the following to determine plurality of review(s).
Code:
{$lng.lbl_votetotal_1} {$vote_total} {if $vote_total > 1} {$lng.lbl_votetotal_2|cat:"s"}{else}{$lng.lbl_votetotal_2}{/if}.

Probably wouldn't work so great with languages other than English, so you if you go this route you may just want to create two seperate language variables, 'review' and 'reviews' which would end up something like...
Code:
{$lng.lbl_votetotal_1} {$vote_total} {if $vote_total > 1} {$lng.lbl_votetotal_2}{else}{$lng.lbl_votetotal_2_plural}{/if}.

Heh...well anyway, there's my two cents.
Reply With Quote
  #4  
Old 01-04-2005, 08:57 PM
 
ghhoz ghhoz is offline
 

Advanced Member
  
Join Date: Oct 2004
Posts: 40
 

Default

Great mod contribution for any cart, thanks for sharing with us all.
__________________
Cheers from Melanie
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Xcart V4.0.4 (Unix) - LIVE
AOM, Fancy Categories
Marketing Manager,
Reward Points & Refer Rewards
Advanced Site Map
Easy Checkout

Gift & Homeware House
www.giftandhomewarehouse.com.au
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 08:59 PM.

   

 
X-Cart forums © 2001-2020