Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Review Approval System


Recommended Posts

Hello,

 

I've a suggestion.At the moment,customer didn't know that their review need to be approve first.Some of them might think that something was wrong,their review did not show up after their submit it.So,can anyone make a notification for this?

 

Thanks

Link to comment
Share on other sites

I`m pretty sure that when a person fills out and submits a review that a message box is displayed telling them that their review has been successfully submitted and will be displayed after being approved.

 

At least thats a message that I get .. but I think it is standard with oscommerce installation. I did change the wording though.

 

If not than you can add a success message by using the meessagestack

 

ADD:

$messageStack->add_session('review', SUCCESS_REVIEW_SENT, 'success');

 

BEFORE the tep_redirect statement in your product_reviews_write.php file (note mine may be different or modded)

 

tep_redirect(tep_href_link(FILENAME_REVIEW_NOTICE, tep_get_all_get_params(array('action'))));

 

So looks something like:

$messageStack->add_session('reviews', SUCCESS_REVIEW_SENT, 'success');

tep_redirect(tep_href_link(FILENAME_REVIEW_NOTICE, tep_get_all_get_params(array('action'))));

 

 

ADD the message to catalog/includes/languages/english/product_reviews_write.php

 

define(SUCCESS_REVIEW_SENT, 'Thank you for your product review. It has been submitted to the Site Administrator for content approval. After approval it will be displayed in the product reviews listing.');

Link to comment
Share on other sites

Ignore that last post. I`m sorry I do have a review mod installed.

 

You could install the Better Reviews System mod which actually redirects the person to a review notice page .. or if you just want a success message try the following.

 

You can add a success message by using the meessagestack

 

ADD:

$messageStack->add_session('review', SUCCESS_REVIEW_SENT, 'success');

 

BEFORE the tep_redirect statement in your product_reviews_write.php file

tep_redirect(tep_href_link(FILENAME_PRODUCT_REVIEWS, tep_get_all_get_params(array('action'))));

 

So looks something like:

 

if ($error == false) {

tep_db_query("insert into " . TABLE_REVIEWS . " (products_id, customers_id, customers_name, reviews_rating, date_added) values ('" . (int)$HTTP_GET_VARS['products_id'] . "', '" . (int)$customer_id . "', '" . tep_db_input($customer['customers_firstname']) . ' ' . tep_db_input($customer['customers_lastname']) . "', '" . tep_db_input($rating) . "', now())");

$insert_id = tep_db_insert_id();

 

tep_db_query("insert into " . TABLE_REVIEWS_DESCRIPTION . " (reviews_id, languages_id, reviews_text) values ('" . (int)$insert_id . "', '" . (int)$languages_id . "', '" . tep_db_input($review) . "')");

 

$messageStack->add_session('reviews', SUCCESS_REVIEW_SENT, 'success');

tep_redirect(tep_href_link(FILENAME_PRODUCT_REVIEWS, tep_get_all_get_params(array('action'))));

}

}

 

 

ADD the message to catalog/includes/languages/english/product_reviews_write.php

 

define(SUCCESS_REVIEW_SENT, 'Thank you for your product review. It has been submitted to the Site Administrator for content approval. After approval it will be displayed in the product reviews listing.');

Edited by insomniac2
Link to comment
Share on other sites

Ignore that last post. I`m sorry I do have a review mod installed.

 

You could install the Better Reviews System mod which actually redirects the person to a review notice page .. or if you just want a success message try the following.

 

You can add a success message by using the meessagestack

 

ADD:

$messageStack->add_session('review', SUCCESS_REVIEW_SENT, 'success');

 

BEFORE the tep_redirect statement in your product_reviews_write.php file

tep_redirect(tep_href_link(FILENAME_PRODUCT_REVIEWS, tep_get_all_get_params(array('action'))));

 

So looks something like:

 

if ($error == false) {

tep_db_query("insert into " . TABLE_REVIEWS . " (products_id, customers_id, customers_name, reviews_rating, date_added) values ('" . (int)$HTTP_GET_VARS['products_id'] . "', '" . (int)$customer_id . "', '" . tep_db_input($customer['customers_firstname']) . ' ' . tep_db_input($customer['customers_lastname']) . "', '" . tep_db_input($rating) . "', now())");

$insert_id = tep_db_insert_id();

 

tep_db_query("insert into " . TABLE_REVIEWS_DESCRIPTION . " (reviews_id, languages_id, reviews_text) values ('" . (int)$insert_id . "', '" . (int)$languages_id . "', '" . tep_db_input($review) . "')");

 

$messageStack->add_session('reviews', SUCCESS_REVIEW_SENT, 'success');

tep_redirect(tep_href_link(FILENAME_PRODUCT_REVIEWS, tep_get_all_get_params(array('action'))));

}

}

ADD the message to catalog/includes/languages/english/product_reviews_write.php

 

define(SUCCESS_REVIEW_SENT, 'Thank you for your product review. It has been submitted to the Site Administrator for content approval. After approval it will be displayed in the product reviews listing.');

 

Which one is correct? :'( <_< >_<

Link to comment
Share on other sites

Hi there a notification does work to tell customer, but theres a mistake or ommision in the installation instructions.

 

In catalog/product_reviews_write.php you are asked to find and replace:

 

Around line 22

 

Change this:

 

tep_redirect(tep_href_link(FILENAME_PRODUCT_REVIEWS, tep_get_all_get_params(array('action'))));

 

to this:

 

 tep_redirect(tep_href_link(FILENAME_REVIEW_NOTICE, tep_get_all_get_params(array('action'))));

On my installation this command exists twice within catalog/product_reviews_write.php, second line around Line 51.

 

Also a further enhancement to this contrib is the ability to use it like product/categories, where you have the green approval and red reject icons side by side and are clickable.

 

To apply, Find in Admin/Reviews Line 236 (Approx)

 

<td class="dataTableContent" align="center"><?php echo $reviews['approved']==1?tep_image(DIR_WS_IMAGES . 'icon_status_green.gif', IMAGE_ICON_STATUS_GREEN, 10, 10):tep_image(DIR_WS_IMAGES . 'icon_status_red.gif', IMAGE_ICON_STATUS_RED, 10, 10); ?></td>

 

CHANGE TO:

 

<td class="dataTableContent" align="center"><?php echo $reviews['approved']==1? '<a href="' . tep_href_link(FILENAME_REVIEWS, tep_get_all_get_params(array('action', 'info')) . 'action=disapprove_review&rID=' . $reviews['reviews_id'], 'NONSSL') . '">' . tep_image(DIR_WS_IMAGES . 'icon_status_green.gif', IMAGE_ICON_STATUS_GREEN, 10, 10) . '</a>?<a href="' . tep_href_link(FILENAME_REVIEWS, tep_get_all_get_params(array('action', 'info')) . 'action=disapprove_review&rID=' . $reviews['reviews_id'], 'NONSSL') . '">' . tep_image(DIR_WS_IMAGES . 'icon_status_red_light.gif', IMAGE_ICON_STATUS_RED, 10, 10) . '</a>':'<a href="' . tep_href_link(FILENAME_REVIEWS, tep_get_all_get_params(array('action', 'info')) . 'action=approve_review&rID=' . $reviews['reviews_id'], 'NONSSL') . '">' . tep_image(DIR_WS_IMAGES . 'icon_status_green_light.gif', IMAGE_ICON_STATUS_GREEN, 10, 10) . '</a>?<a href="' . tep_href_link(FILENAME_REVIEWS, tep_get_all_get_params(array('action', 'info')) . 'action=approve_review&rID=' . $reviews['reviews_id'], 'NONSSL') . '">' . tep_image(DIR_WS_IMAGES . 'icon_status_red.gif', IMAGE_ICON_STATUS_RED, 10, 10) . '</a>' ?></td>

Edited by stu2000
Link to comment
Share on other sites

  • 4 months later...

i got a strange problem, the customer leave a review with quote in it because of the french language word like : andrew's father then i see in the admin the correct text but when i approve it , hte review is rewritten with escape slash on it :

 

andrew's father BECOMES andrew\'s father

 

any ideas ?

MS2

Link to comment
Share on other sites

  • 1 month later...

I have two languages - if a review is written and approved in one language, the counter for reviews on the product_info.php page shows fine, but unfortunately also on the "other" language, which must be a mistake....

 

How can I solve this?

 

Helle :-)

Link to comment
Share on other sites

  • 4 months later...

I have this review approve contribution installed along with related products and CCGV (trad) after i approve a review the same review shows up in any product clicked on to review. I uninstalled it and the review system works normally. Any ideas what is wrong?

 

Thanks,

 

George

Link to comment
Share on other sites

  • 4 months later...
  • 6 months later...

Can someone help me with this mod, for security reasons, i would need that the reviews only show the first name. when i look at the code i see customer_name. which it shooting out both names im basically lost with the code,

Anyone able to assist?

Link to comment
Share on other sites

  • 1 month later...

Dont know if its usefull , but here the little change you have to do that it works with the contrib Reviews in Product display v.2.3 together.

Find the code below from this contrib in product_info.php. ( Should be somewhere on the begin, can't remember now exactly because i changed it a bit for myself and deleted a few parts) The code down has only a little change "r.approved='1'"

If have not the original file on my pc and at the mometn not the time to search or download it.

 

 

NEW CODE:

<?php
if (MAX_REVIEWS_IN_PRODUCT_INFO > 0) {
 $reviews_query = tep_db_query("select r.reviews_id, rd.reviews_text, r.reviews_rating, r.date_added, r.customers_name from " . TABLE_REVIEWS . " r, " . TABLE_REVIEWS_DESCRIPTION . " rd where r.products_id = '" . $HTTP_GET_VARS['products_id'] . "' and rd.reviews_id = r.reviews_id and rd.languages_id = '" . $languages_id . "' and r.approved = '1' order by r.reviews_id DESC");
 $num_rows = tep_db_num_rows($reviews_query);
?>

 

I have the contrib allow guest reviews installed. Each time when a guest wrote a review you could see it without approval on the p info page. Also was installed review approval system. This code now works together with the the 2 other review contribs.

Thanks for the great contrib you made. i like the layout very much.

bye bye

Link to comment
Share on other sites

Can someone help me with this mod, for security reasons, i would need that the reviews only show the first name. when i look at the code i see customer_name. which it shooting out both names im basically lost with the code,

Anyone able to assist?

Hi, there is a contrib you can look for discreed reviews etc. is easy to modify.if not you can write me or in the forum.

but try at first the contrib.

hope could help a bit

Link to comment
Share on other sites

  • 9 months later...

Hi there,

 

I have a problem with this contrib.

I have installed the new version 1.3_1 and it works fine, but have one mistake.

 

If a customer is not logged in into his account,

1.) customer is on product detail page and clicks on the button "reviews"

2.) customer is now coming to file "product_reviews.php", where the reviews are shown.

3.) when customer clicks on the button to write his own statement/review, he will reach the file "product_reviews_write.php" AND is immediately redirected to the login-page

4.) But after he logged in into his account, he will get to file "review_notice.php", telling the customer directly, that the review is submitted INSTEAD of leading him to file "product_reviews_write.php" in order to write his review.

 

Can anyone tell me please, what might be wrong in my installation ??

 

Thanks in advance,

kind regards

Andreas

Link to comment
Share on other sites

  • 2 weeks later...

BUMP

 

The problem seems to be in the product_reviews_write.php.

 

I placed the following in the login.php to see the output of the redirect_variable

	echo "Redirect to : " . $navigation->snapshot['page'];

 

The output is correct (coming from the product_reviews_write.php) by redirecting to product_reviews_write.php

BUT still there is no possibility to write a comment, because the user is (again) redirected to the review_notice.php.

 

My code in the product_reviews_write.php for the tep_redirect's is:

  if (!tep_session_is_registered('customer_id')) {
$navigation->set_snapshot();
tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
 }

 $product_info_query = tep_db_query("select p.products_id, p.products_model, p.products_image, p.products_price, p.products_tax_class_id, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "'");
 if (!tep_db_num_rows($product_info_query)) {
// BOF Review Approval System	
tep_redirect(tep_href_link(FILENAME_REVIEW_NOTICE, tep_get_all_get_params(array('action'))));
// EOF Review Approval System
 } else {
$product_info = tep_db_fetch_array($product_info_query);
 }

and the second place in the code:

	tep_mail(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, $subject, $message, $from_name, STORE_OWNER_EMAIL_ADDRESS);

//end notify store owner

  tep_redirect(tep_href_link(FILENAME_REVIEW_NOTICE, tep_get_all_get_params(array('action'))));
}
 }

 

In the original file from the osC RC1 repository, both places in the code have this here:

tep_redirect(tep_href_link(FILENAME_PRODUCT_REVIEWS

but this variant is also not working.

 

Any more ideas ?

 

Thanks in advance,

Andreas

Link to comment
Share on other sites

  • 4 weeks later...
  • 1 month later...

Everything with this contribution is working well for me except once a customer adds a review, they are directed back to the product info page, instead of the review notice page. I've checked the product_reviews_write.php page and it all seems to be in there correctly, but obviously it's not because it's not working.

 

Any ideas?

Link to comment
Share on other sites

  • 7 months later...

This contribution works fine, except my reviews are showing on the product_info before I ever approved them. Does anyone have any idea where I should look for the mistake?

Thanks.

 

It looks like your reviews are "pre-approved".

 

Try changing from 1 to 0 the default setting in the 'approved' column of your reviews table in your database

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...