0

i have added another rating to product page named Admin Rating which is editable by admin. i created an attribute admin_rating and assign it to the attribute set, and entered a digit for this attribute from 0 to 100, one star is equal to 20 and five stars to 100.

i edited this file:

\app\design\frontend\your package \your theme\template\catalog\product\view.phtml

and added this code into it:

<div class="rating-box">
 <div class="rating" style="width:<?php echo $_product->getAdminRating();?>%;"></div>
</div>

every thing is fine but i want change admin stars view (they are stars and i want them to be other things like circles or ...), but class="rating-box" contains one kind of shapes and when i change it, both of the ratings will change.

how can i do that? i will thankful if you describe it by details.

1 Answer 1

1

Go back to the code you added and change <div class="rating-box"> to <div class="admin-rating-box">. Now you can style the two ratings separately. For example, in the theme's styles.css file copy the old style to make:

.admin-rating-box { width:69px; height:13px; font-size:0; line-height:0; background:url(../images/bkg_admin_rating.gif) 0 0 repeat-x; text-indent:-999em; overflow:hidden; }
.admin-rating-box .rating { float:left; height:13px; background:url(../images/bkg_admin_rating.gif) 0 100% repeat-x; }
.ratings .admin-rating-box { float:left; margin-right:3px; }

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.