How to add product rating (stars) to a product on main page
Hi,
my define_main-page.php has6 products.
PHP Code:
<h2 align="center">Willkommen im Shop von Jean Pütz Produkte GmbH</h2>
<h3 align="center">Unsere Topprodukte</h3>
<table align="center">
<tbody>
<tr>
<td align="center"><a href="http://www.jean-puetz-produkte.de/shopdev/hygienebleiche-jp-1000-ml-fuer-buntes-und-feines-p-22.html"><img title="Hygienebleiche JP" src="/shopdev/images/topseller/bild1.jpg" alt="Hygienebleiche JP" /><br /><strong>Hygienebleiche<br />5.95 €</strong></a></td>
<td align="center"><a href="http://www.jean-puetz-produkte.de/shopdev/orangenreiniger-jp-das-original-500-ml-p-44.html"><img title="Orangenreiniger JP" src="/shopdev/images/topseller/bild2.jpg" alt="Orangenreiniger JP" /><br /><strong>Orangenreiniger<br />7.95 €</strong></a></td>
<td align="center"><a href="http://www.jean-puetz-produkte.de/shopdev/zimt-fuer-die-fuesse-zimteinlegesohlen-c-14_33.html"><img title="Zimteinlegesohlen" src="/shopdev/images/topseller/bild3.jpg" alt="Zimteinlegesohlen" /><br /><strong>Zimteinlegesohlen<br />4.50 €</strong></a></td>
</tr>
<tr>
<td align="center"><a href="http://www.jean-puetz-produkte.de/shopdev/joghurtkultur-jp-3x2-g-starterkultur-fuer-die-joghurtherstellung-p-217.html"><img title="Joghurtkulturen" src="/shopdev/images/topseller/bild4.jpg" alt="Joghurtkulturen" /><br /><strong>Joghurtkulturen<br />10.45 €</strong></a></td>
<td align="center"><a href="http://www.jean-puetz-produkte.de/shopdev/essen-und-trinken-suessstoff-c-6_46.html"><img title="Süßstoff JP" src="/shopdev/images/topseller/bild5.jpg" alt="Süßstoff JP" /><br /><strong>Süßstoff<sup>JP</sup> <br />ab 6.25 €</strong></a></td>
<td align="center"><a href="http://www.jean-puetz-produkte.de/shopdev/niemoel-neemoel-emulgator-gebrauchsfertig-1-l-p-442.html"><img title="Niemöl und Emulgator" src="/shopdev/images/topseller/bild6.jpg" alt="Lavendelöl" /><br /><strong>Niemöl und Emulgator<br />25.95 €</strong></a></td>
</tr>
</tbody>
</table>
<p><strong>
Now I would like to show the average ratings (stars) under the product title.
I have no idea how to "link" the ratings (which can be found a the product page) to the product description at the main page.
Could anyone help me please?
Re: How to add product rating (stars) to a product on main page
Instead of hardcoding the products have you considered using the featured products module centerbox? This would give you alot more flexibility to designate products to show on the main page or other pages like the product listing or shopping cart. Also you can change the defines for featured products and have the heading say something else or nothing at all and with a little css tweaking you can get it exactly like you have now but with added flexibility.
Now for the rating system if you want the average rating I think their is a mod that would do that. However it is made to show on the product info pages so you would use that code as a guideline. Use the module/product_info/main_template_vars file and find the snippet of code that has the average rating pulled from the database. Then you will find how to echo it in the template/tpl_product_info_display file. That should get you started to get it shown on your main page table.
Re: How to add product rating (stars) to a product on main page
There's this (http://www.zen-cart.com/downloads.php?do=file&id=398) Average Stars Rating plugin (I haven't used it).
Re: How to add product rating (stars) to a product on main page
I would like to use this plugin but it only has 0.5, 1.5 stars, does anybody know a plugin the will give me the full stars?
Re: How to add product rating (stars) to a product on main page
To my remembrance, that plugin enables 0, 0.5, 1, 1.5 ... up to 5 stars.