I try to implement rating feature in paypal plugin to allow users to rate products and give review.
Integration is simple, and involves calling just one function that will return the HTML to incorporate into paypal plugin page.
Text Formatted Code
/* start rating code */
if (function_exists('RATING_display_rating'))
{
$product->set_var('rating', RATING_display_rating('paypal_' . $A['id'], 'paypal', $A['id'], 1, 5, CONST_FLAG_DEFAULT_RATING ) );
}
/* end rating code */
where $A['id'] is my product id. I also need to customise my template. This simply require that I add {rating} wherever I wanted to have a rating appear in my products page.
Text Formatted Code
/*
* Current supported types include staticpage, comment, story & autotagged
* If you have a new type that you would like to link properly and display
* a correct title use the following user sample below. For a new type you
* would change in the $_RATING_CONF variable the text "user" to what ever
* you called your type. A sample user type is included below.
*/
// For paypal plugin
$_RATING_CONF['rating_type_paypal'] = 'paypal';
$_RATING_CONF['rating_type_paypal_url'] = '/' . $_PAY_CONF['paypal_folder'] . '/product_detail.php?product=';
$_RATING_CONF['rating_type_paypal_title'] = "SELECT name FROM " . $_TABLES['paypal_products'] . " WHERE id=";
If I add these $_RATING_CONF in the plugins/rating/config.php file it is working... but do I need to update the rating plugin to allow the paypal plugin to work with this feature.