Author Topic: Allow review only if customer has purchased the product.  (Read 7506 times)

aravot

  • Peter
  • Quality&Testing Team
  • Sr. Member
  • *
  • Posts: 2874
    • VirtueMart Extensions
Allow review only if customer has purchased the product.
« on: April 18, 2006, 04:25:32 am »
Option to allow review only if customer has purchased the product.

Virtue Monkey

  • Jr. Member
  • **
  • Posts: 107
    • Church of the Flying Spaghetti Monster
Re: Allow review only if customer has purchased the product.
« Reply #1 on: June 13, 2006, 06:38:11 am »
I'd like to second this one.

Switch

  • Jr. Member
  • **
  • Posts: 67
Re: Allow review only if customer has purchased the product.
« Reply #2 on: August 20, 2006, 04:59:33 am »
Yeah, this would be a great addition
If you show you have tried to solve your problem and explain the steps you took people will be more willing to help :)
USE THE SEARCH!

Reincha

  • Jr. Member
  • **
  • Posts: 137
Re: Allow review only if customer has purchased the product.
« Reply #3 on: November 24, 2010, 20:58:04 pm »
have anyone done it?

aravot

  • Peter
  • Quality&Testing Team
  • Sr. Member
  • *
  • Posts: 2874
    • VirtueMart Extensions
Re: Allow review only if customer has purchased the product.
« Reply #4 on: November 24, 2010, 21:02:16 pm »
have anyone done it?

I have but it is a paid add-on/hack, see my signature for link.

mautabar

  • Beginner
  • *
  • Posts: 2
Re: Allow review only if customer has purchased the product.
« Reply #5 on: May 16, 2012, 05:09:44 am »
You have to edit this file \administrator\components\com_virtuemart\html\shop.product_details.php

Modify following code (line no 358)

/* LIST ALL REVIEWS **/
if (PSHOP_ALLOW_REVIEWS == '1') {
   /*** Show all reviews available ***/
   $product_reviews = ps_reviews::product_reviews( $product_id );
   /*** Show a form for writing a review ***/

   if( $auth['user_id'] > 0 ) {
      $product_reviewform = ps_reviews::reviewform( $product_id );
   }

to

/* LIST ALL REVIEWS **/
if (PSHOP_ALLOW_REVIEWS == '1') {
   /*** Show all reviews available ***/
   $product_reviews = ps_reviews::product_reviews( $product_id );
   /*** Show a form for writing a review ***/

//akbar ali
$db =& JFactory::getDBO();
$query = "
  SELECT ".$db->nameQuote('oui.user_id')."
    FROM ".$db->nameQuote('#__vm_order_user_info')." oui
   join ".$db->nameQuote('#__vm_order_item')." oi
    WHERE ".$db->nameQuote('oi.order_status')." = 'C'
    and ".$db->nameQuote('oi.product_id')." = ".$db->quote($product_id)."
   and ".$db->nameQuote('oui.user_id')." = ".$db->quote($auth['user_id'])."";
$db->setQuery($query);
$result = $db->loadResult();
//ali akbar
   if( $auth['user_id'] > 0 && $result> 0) {
      $product_reviewform = ps_reviews::reviewform( $product_id );
   }

mautabar

  • Beginner
  • *
  • Posts: 2
Re: Allow review only if customer has purchased the product.
« Reply #6 on: May 16, 2012, 05:12:14 am »
This will allow customer to add review only after the order is confirmed