hi everyone,

i dont know how to show the rating average of a product with jquery's
star rating. like products abc rating is 3.5, i want 3.5 stars filled.
this is what i got so far.

in my table "ratings" i save the average rating value. this is the
view: a user rates by clicking one the stars

$(document).ready(function() {

        $("#rating_stars_list").stars({
                inputType: "select",
                cancelShow: false,
                callback:  function(value, link){
                saveRating();
        }
        });


        function saveRating()
        {
                                        var ui = 
$("#rating_stars_list").data("stars");
                                        var rating = ui.options.value;
                                        $('#attachments').load('rate', {data: 
rating});
        }



the action "rate" that is called from jquery's saveRating and saves
the rating:

        function rate()
        {


                $result = $_POST['data'];

                $this->Vote->save(array(product_id' => $this->Session-
>read('product.thisID'),
                                                                'user_id' => 
$this->Session->read('User.id'),
                                                                'rating' => 
$result
                                                        ));

        }


I know I can get this value with "find" from the table, but how the
heck can I represent the value with filled stars? how. I dont even
know how to pass the php variable (that has the average rating) to
jquery...

any idea? thank you :)

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to