WP e-Commerce  is a pretty full featured WordPress plugin for creating an online store. But, if you're reading this post, you already know about WP-ecommerce, and are more interested in extending it's product review capabilities. Currently, a user can assign a star rating to any given WP-eCommerce product, but what about an actual review?

While I've implemented solutions in the past, they were highly customized, so I will instead give a high level overview of the process I used to add product reviews to the existing star rating system:

  1. Add another column to the existing wp_wpsc_product_rating database table for the actual product review.

    alter table wp_wpsc_product_rating add column review text after rated;
     

  2. Create your own form for submitting a product rating and a review. This should be placed in the wpsc-single_product.php
    template.
     
  3. Create the form processing script, which creates a new record in the wp_wpsc_product_rating table. The SQL might look something like:

    INSERT INTO wp_wpsc_product_rating
            (
                ipnum,
                productid,
                rated,
                review,
                time
            )
            VALUES
            (
            '{$_SERVER['REMOTE_ADDR']}',
            {$_REQUEST['productid']},
            {$_REQUEST['rated']},
            '{$_REQUEST['review']}',       
            UNIX_TIMESTAMP()
            );

     

With this procedure, you will tie into the existing WP e-Commerce rating system, creating a more seamless integration with the product.

Tags:

2 Comments

  1. Is there any chance that this has already been implemented into a plugin?  I'm not proficient enough to be able to put this together based only on the info in this post, though I am literate enough to recognize the function of what it is doing.  
     
    If nothing else, let me just say THANK YOU for showing us how it's possible. 
    Regards, 
    Jason H.

    1. Not that I’m aware of unfortunately, although I’d be amazed if a later version of the product doesn’t include them.

      Is there any step in the process you need help with?

Leave a Reply

Your email address will not be published. Required fields are marked *