Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Reviews on Product Info Page v1.0


assembler

Recommended Posts

  • 5 weeks later...

Hi there,

 

I like this contribution and am using it on my site www.myfirstchopper.com but this is not working with the review approval system contribution.

 

Any ideas how to remedy this?

 

thanks

 

stubbsy

Link to comment
Share on other sites

  • 5 weeks later...

Hi,

 

ive just uploaded your contrib. Ive been looking for something like this for a while. Thanks.

 

Ive made a minor change to it to make the review look nicer in same way as standard product_review_info.php - putting line breaks into it.

 

find around line 21:
$reviews['reviews_text']);

replace with:
tep_break_string(nl2br(tep_output_string_protected($reviews['reviews_text'])), 60, '-<br>'));

 

I also plan to mod the product_info.php so that the existing review links and stars are not displayed. I think that may have been from another contrib but am not sure at the moment.

 

Thanks for the contrib anyway.

 

regards

mark

Regards

Mark Brindle

Link to comment
Share on other sites

  • 3 weeks later...

For anyone wishing to use this with the Review Approval System contribution then I have found the change required to make sure the review doesn't appear in your product info unless it is approved...

 

In product_reviews_info.php find this

 

$reviews_query = tep_db_query("select r.reviews_id, r.customers_name, r.date_added, rd.reviews_text, r.reviews_rating FROM reviews r, reviews_description rd WHERE r.reviews_id = rd.reviews_id AND r.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' AND rd.languages_id = '" . (int)$languages_id . "' ORDER BY r.date_added DESC LIMIT " . MAX_REVIEWS);

 

and replace with this

 

$reviews_query = tep_db_query("select r.reviews_id, r.customers_name, r.date_added, rd.reviews_text, r.reviews_rating FROM reviews r, reviews_description rd WHERE r.reviews_id = rd.reviews_id AND r.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' AND rd.languages_id = '" . (int)$languages_id . "' and r.approved = '1' ORDER BY r.date_added DESC LIMIT " . MAX_REVIEWS);

 

hope this is of use to someone

 

stubbsy

Link to comment
Share on other sites

  • 2 weeks later...
For anyone wishing to use this with the Review Approval System contribution then I have found the change required to make sure the review doesn't appear in your product info unless it is approved...

 

In product_reviews_info.php find this

 

$reviews_query = tep_db_query("select r.reviews_id, r.customers_name, r.date_added, rd.reviews_text, r.reviews_rating FROM reviews r, reviews_description rd WHERE r.reviews_id = rd.reviews_id AND r.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' AND rd.languages_id = '" . (int)$languages_id . "' ORDER BY r.date_added DESC LIMIT " . MAX_REVIEWS);

 

and replace with this

 

$reviews_query = tep_db_query("select r.reviews_id, r.customers_name, r.date_added, rd.reviews_text, r.reviews_rating FROM reviews r, reviews_description rd WHERE r.reviews_id = rd.reviews_id AND r.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' AND rd.languages_id = '" . (int)$languages_id . "' and r.approved = '1' ORDER BY r.date_added DESC LIMIT " . MAX_REVIEWS);

 

hope this is of use to someone

 

stubbsy

 

Thanks! I have been trying to make the two contribution play well together. You solved it for me.

 

:thumbsup:

Link to comment
Share on other sites

  • 4 months later...

Anybody know what is necessary to get the reviews count appearing on the index page with the code inserted into the modules/products_reviews_info.php file?

 

Reason for this is because I'd like to integrate it in between the 'Read All Reviews' and the 'Write a review' links.

Link to comment
Share on other sites

  • 1 month later...
  • 3 weeks later...
Anybody know what is necessary to get the reviews count appearing on the index page with the code inserted into the modules/products_reviews_info.php file?

 

Reason for this is because I'd like to integrate it in between the 'Read All Reviews' and the 'Write a review' links.

 

The stock code to display the number of reviews a product has is in product_info.php is:

 

<?php
$reviews_query = tep_db_query("select count(*) as count from " . TABLE_REVIEWS . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'");
$reviews = tep_db_fetch_array($reviews_query);
if ($reviews['count'] > 0) {
?>
  <tr>
	<td class="main"><?php echo TEXT_CURRENT_REVIEWS . ' ' . $reviews['count']; ?></td>
  </tr>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
<?php
}

 

You could also change the contribution to find this information with the main review query. However, you would also have to change the way that the reviews box gets created.

Link to comment
Share on other sites

  • 2 months later...
Does anyone know how I would get just the first name of the reviewer to appear insted of first and last name?

 

The names are stored in the table reviews, in one column called customers_name. You would have to explode this field to get the first name. You could do something like:

 

$name_array = explode(" ",$reviews['customers_name']);
$firstname = $name_array[0];

Link to comment
Share on other sites

  • 7 months later...

hello,

 

love this contribution, but have a small problem. i've installed it and it works fine, but when ever i submit a comment then go back to the product page the item number (right above the price) has extra escapes and a quote like so:

 

 

Item 208\\\"

 

what's the deal here?

 

thanks in advance!

Link to comment
Share on other sites

  • 5 months later...
  • 1 month later...
  • 5 months later...

I like this contrib and use it.

 

I have 1 big wish for someone clever enough to do it.

 

As it is now all the text from a review is shown: Example

Vivi - 07/01/2008

Jeg/vi bruger cremen imod psoriasis i ansigtet. Jeg smører cremen på den angrebne hud hver morgen og aften. Om aftenen inden sengetid, har jeg smurt et lidt tykkere lag creme på den angrebne hud. Og om morgenen et tyndt lag creme på, da cremen er meget fed og ikke absorberes helt. Jeg kunne hurtigt se en virkning. Det meste røde og irriterede udslæt blev hurtigt mindre og den brændende og kløende fornemmelse i huden forsvandt. Den skællede hud, som også har været et stort problem, er så godt som forsvundet. Forbedringen har betydet meget for psyken, når man nu har psoriasis i ansigtet og det at slippe for den irriterende brændende og kløene fornemmelse, er også en stor befrielse. Jeg kan bestemt anbefale cremen til andre. Pengene er givet godt ud og den er meget drøj i brug. Alle tiders at produktet sendes uden yderligere omkostninger for kunden. jeg har prøvet mange forskellige cremer, også lægeordinerede – men uden den store effekt og løsning på problemet. På trods af, at jeg kun har brugt cremen en god måneds tid, vil jeg tildele den topkarakter på 5 stjerner.

 

- I would like to have it like this: example

Vivi - 07/01/2008

Jeg/vi bruger cremen imod psoriasis i ansigtet. Jeg smører cremen på den angrebne hud hver morgen og aften. Om aftenen inden sengetid, har jeg smurt et lidt tykkere.... read more (link to click on)

 

 

(dont mind the danish :rolleyes: )

 

Anyone able to fix this....

 

I think it should be an apeticer for reading more and not showing the complete review.

 

Best regards

 

Michael / AgentJensen

Link to comment
Share on other sites

  • 2 months later...
I like this contrib and use it.

 

I have 1 big wish for someone clever enough to do it.

 

As it is now all the text from a review is shown: Example

Vivi - 07/01/2008

Jeg/vi bruger cremen imod psoriasis i ansigtet. Jeg smører cremen på den angrebne hud hver morgen og aften. Om aftenen inden sengetid, har jeg smurt et lidt tykkere lag creme på den angrebne hud. Og om morgenen et tyndt lag creme på, da cremen er meget fed og ikke absorberes helt. Jeg kunne hurtigt se en virkning. Det meste røde og irriterede udslæt blev hurtigt mindre og den brændende og kløende fornemmelse i huden forsvandt. Den skællede hud, som også har været et stort problem, er så godt som forsvundet. Forbedringen har betydet meget for psyken, når man nu har psoriasis i ansigtet og det at slippe for den irriterende brændende og kløene fornemmelse, er også en stor befrielse. Jeg kan bestemt anbefale cremen til andre. Pengene er givet godt ud og den er meget drøj i brug. Alle tiders at produktet sendes uden yderligere omkostninger for kunden. jeg har prøvet mange forskellige cremer, også lægeordinerede – men uden den store effekt og løsning på problemet. På trods af, at jeg kun har brugt cremen en god måneds tid, vil jeg tildele den topkarakter på 5 stjerner.

 

- I would like to have it like this: example

Vivi - 07/01/2008

Jeg/vi bruger cremen imod psoriasis i ansigtet. Jeg smører cremen på den angrebne hud hver morgen og aften. Om aftenen inden sengetid, har jeg smurt et lidt tykkere.... read more (link to click on)

 

 

(dont mind the danish :rolleyes: )

 

Anyone able to fix this....

 

I think it should be an apeticer for reading more and not showing the complete review.

 

Best regards

 

Michael / AgentJensen

 

hello my friend, i think the code you need is similar to the code of includes/boxes/reviews.php and i think i need this too and i am working on it. I am not a developer or anything good on coding, i am just making small changes so maybe i'll make it. If i have news i'll post it ok?

I am Maintaining :

Product_Short_Description (i added it on specials.php and in shopping_cart.php)

City Shipping Rates With Admin (fixed the error that was giving wrong total shipping charges)

I had Created :

UTF bug fix on standard reviews system (admin & block)

Corrupted character on mysql with utf-8

Link to comment
Share on other sites

  • 2 months later...
  • 9 months later...

Has anyone used this mod in conjunction with the product tabs mod? I'd like to be able to call up the reviews as one of the tabs in the product tabs.

 

Thanks.

Link to comment
Share on other sites

  • 6 months later...

I like this contrib and use it.

 

I have 1 big wish for someone clever enough to do it.

 

As it is now all the text from a review is shown: Example

Vivi - 07/01/2008

Jeg/vi bruger cremen imod psoriasis i ansigtet. Jeg smører cremen på den angrebne hud hver morgen og aften. Om aftenen inden sengetid, har jeg smurt et lidt tykkere lag creme på den angrebne hud. Og om morgenen et tyndt lag creme på, da cremen er meget fed og ikke absorberes helt. Jeg kunne hurtigt se en virkning. Det meste røde og irriterede udslæt blev hurtigt mindre og den brændende og kløende fornemmelse i huden forsvandt. Den skællede hud, som også har været et stort problem, er så godt som forsvundet. Forbedringen har betydet meget for psyken, når man nu har psoriasis i ansigtet og det at slippe for den irriterende brændende og kløene fornemmelse, er også en stor befrielse. Jeg kan bestemt anbefale cremen til andre. Pengene er givet godt ud og den er meget drøj i brug. Alle tiders at produktet sendes uden yderligere omkostninger for kunden. jeg har prøvet mange forskellige cremer, også lægeordinerede – men uden den store effekt og løsning på problemet. På trods af, at jeg kun har brugt cremen en god måneds tid, vil jeg tildele den topkarakter på 5 stjerner.

 

- I would like to have it like this: example

Vivi - 07/01/2008

Jeg/vi bruger cremen imod psoriasis i ansigtet. Jeg smører cremen på den angrebne hud hver morgen og aften. Om aftenen inden sengetid, har jeg smurt et lidt tykkere.... read more (link to click on)

 

 

(dont mind the danish :rolleyes: )

 

Anyone able to fix this....

 

I think it should be an apeticer for reading more and not showing the complete review.

 

Best regards

 

Michael / AgentJensen

 

Hello,

 

I have try this with this Code

tep_break_string(substr(tep_output_string_protected($reviews['reviews_text'])),0, 200) . "...");

but i doesn´t working.

 

Has anyone an Idea?

Link to comment
Share on other sites

  • 11 months later...

Should this code still work?

When I try it, it looks as though it is not picking up any data from the database, as it always returns "There are currently no reviews for this product" even though there is!

 

I think this is one of two things:

 

1. This piece of code is old and does not work with osc rc2.2a.

$reviews_query = tep_db_query("select r.reviews_id, r.customers_name, r.date_added, rd.reviews_text, r.reviews_rating FROM reviews r, reviews_description rd WHERE r.reviews_id = rd.reviews_id AND r.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' AND rd.languages_id = '" . (int)$languages_id . "' ORDER BY r.date_added DESC LIMIT " . MAX_REVIEWS);

Does it look right?

 

2. Or the code is not picking up the PRODUCT ID, hence is returning the following:

else {
 $info_box_contents[][0] = array('align' => 'left',
                         'params' => 'class="smallText" valign="top"',
                         'text' => NO_REVIEWS_TEXT);
}

 

Is there a test I could do to see what the problem is?

Link to comment
Share on other sites

  • 5 months later...

Hi

I am having some problems with the product_reviews_info contribution (places reviews on product_info page)

Basically it is only set up in english and i need it in 3 other languages

 

The heading text is defined in the file that is in catalog/includes/modules

 

I have removed the definitions from the file and placed in a requires command at the top of the file

 

I have added define language file in the language folder

 

But no luck just keep getting php errors cant find the file

 

Any ideas

Link to comment
Share on other sites

  • 5 months later...

Has anyone used this mod in conjunction with the product tabs mod? I'd like to be able to call up the reviews as one of the tabs in the product tabs.

 

Thanks.

 

Hi im looking for the same thing? has anyone found the fix for that?

 

ive tried adding <? include(DIR_WS_MODULES . 'product_reviews_info.php'); ?> into tabs section but it doesnot work that way :(

outside links are not allowed in signatures

Link to comment
Share on other sites

ive tried adding <? include(DIR_WS_MODULES . 'product_reviews_info.php'); ?> into tabs section but it doesnot work that way sad.png

 

What do you expect to work?

 

Do you have a file named "product_reviews_info.php" in the includes/modules/ directory? Is the file pulling the reviews from the database using the product_id of the product you are on right now?

 

If not, this is what you need to create, then you can include your new module

Link to comment
Share on other sites

 

What do you expect to work?

 

Do you have a file named "product_reviews_info.php" in the includes/modules/ directory? Is the file pulling the reviews from the database using the product_id of the product you are on right now?

 

If not, this is what you need to create, then you can include your new module

 

Hi,

ive installed this addon:

http://www.oscommerc...tributions,3340

to retrieve the reviews and yes its working fine if i put it anywhere except the product_tabs.php module.

 

ive attached the product_tabs.php

p.s. i want to show the reviews under:

<li><a href="#EXTRA1"><?PHP ECHO TEXT_TAB_EXTRA1;

?></a></li>

product_tabs.php

Edited by nahi_sonu

outside links are not allowed in signatures

Link to comment
Share on other sites

  • 2 weeks later...

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...