{"id":402,"date":"2011-11-01T17:46:32","date_gmt":"2011-11-01T17:46:32","guid":{"rendered":"http:\/\/www.sitekickr.com\/blog\/?p=402"},"modified":"2011-11-01T17:46:50","modified_gmt":"2011-11-01T17:46:50","slug":"wp-ecommerce-product-review","status":"publish","type":"post","link":"https:\/\/www.sitekickr.com\/blog\/wp-ecommerce-product-review\/","title":{"rendered":"WP e-Commerce Product Reviews"},"content":{"rendered":"<p><em>WP e-Commerce<\/em>&nbsp; is a pretty full featured WordPress plugin for creating an online store. But, if you&#39;re reading this post, you already know about WP-ecommerce, and are more interested in extending it&#39;s product review capabilities. Currently, a user can assign a star rating to any given WP-eCommerce product, but what about an actual review?<\/p>\n<p>While I&#39;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:<\/p>\n<ol>\n<li>Add another column to the existing wp_wpsc_product_rating database table for the actual product review.\n<p>\t\t<code>alter table wp_wpsc_product_rating add column review text after rated;<\/code><br \/>\n\t\t&nbsp;<\/li>\n<li>Create your own form for submitting a product rating and a review. This should be placed in the wpsc-single_product.php <br \/>\n\t\ttemplate.<br \/>\n\t\t&nbsp;<\/li>\n<li>Create the form processing script, which creates a new record in the wp_wpsc_product_rating table. The SQL might look something like:\n<p>\t\t<code>INSERT INTO wp_wpsc_product_rating<br \/>\n\t\t&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; (<br \/>\n\t\t&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ipnum,<br \/>\n\t\t&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; productid,<br \/>\n\t\t&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; rated,<br \/>\n\t\t&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; review,<br \/>\n\t\t&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; time<br \/>\n\t\t&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; )<br \/>\n\t\t&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; VALUES<br \/>\n\t\t&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; (<br \/>\n\t\t&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &#39;{$_SERVER[&#39;REMOTE_ADDR&#39;]}&#39;,<br \/>\n\t\t&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {$_REQUEST[&#39;productid&#39;]},<br \/>\n\t\t&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {$_REQUEST[&#39;rated&#39;]},<br \/>\n\t\t&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &#39;{$_REQUEST[&#39;review&#39;]}&#39;,&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br \/>\n\t\t&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; UNIX_TIMESTAMP()<br \/>\n\t\t&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; );<\/code><br \/>\n\t\t&nbsp;<\/li>\n<\/ol>\n<p>With this procedure, you will tie into the existing WP e-Commerce rating system, creating a more seamless integration with the product.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>WP e-Commerce&nbsp; is a pretty full featured WordPress plugin for creating an online store. But, if you&#39;re reading this post, you already know about WP-ecommerce,&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"amp_status":""},"categories":[103],"tags":[135],"_links":{"self":[{"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/posts\/402"}],"collection":[{"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/comments?post=402"}],"version-history":[{"count":2,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/posts\/402\/revisions"}],"predecessor-version":[{"id":404,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/posts\/402\/revisions\/404"}],"wp:attachment":[{"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/media?parent=402"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/categories?post=402"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/tags?post=402"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}