Zen Cart Logo
Forums / Basic Configuration / reviews sidebox!? main page problem

reviews sidebox!? main page problem

Views: 12,283

Results 1 to 20 of 35
8 Dec 2008, 1:18 PM
#1
mb1 avatar

mb1

Totally Zenned

Join Date:
Jun 2006
Posts:
565
Plugin Contributions:
0

reviews sidebox!? main page problem

my review sidebox doesn't rotate the products on the main page. it's allways stuck on one product. but when i'm browsing the site it will change if i'm looking at a product that has client reviews the sidebox will then show that product.

what em i missing here. or is this the way it's supposed to work?

https://www.gorillagear.ca = zencart v1.3.9h with 40+ mods

13 Dec 2008, 2:41 PM
#2
steve_1 avatar

steve_1

Zen Follower

Join Date:
Sep 2008
Location:
London UK
Posts:
100
Plugin Contributions:
0

Re: reviews sidebox!? main page problem

have you added mod to 'rotate' products .. it will not rotate/scroll without a mod

22 Mar 2009, 2:56 AM
#3
grafx2g avatar

grafx2g

New Zenner

Join Date:
Jan 2009
Location:
Los Angeles, CA
Posts:
69
Plugin Contributions:
0

Re: reviews sidebox!? main page problem

So where in admin do we go to activate the rotation so that it's not stuck on the same review. I'm having the same problem and I can't find it in admin. Am I missing something here?

22 Mar 2009, 1:54 PM
#4
tony_sar avatar

tony_sar

Totally Zenned

Join Date:
Jul 2006
Location:
Montreal, Canada
Posts:
2,276
Plugin Contributions:
0

Re: reviews sidebox!? main page problem

there are no rotation for review side box , the review changes as you navigate from page to page , showing product review randomly

im not sure if there is mod specifically made for review , but there is scroll mod for side box that might work for review side box or might be customized for review

28 Apr 2009, 8:50 PM
#5
manage_it avatar

manage_it

Inactive

Join Date:
May 2006
Posts:
80
Plugin Contributions:
0

Re: reviews sidebox!? main page problem

It is actually not changing to another review when browsing to other pages. Is there a bug?

7 Feb 2010, 10:02 PM
#6
mb1 avatar

mb1

Totally Zenned

Join Date:
Jun 2006
Posts:
565
Plugin Contributions:
0

Re: reviews sidebox!? main page problem

has anyone figured out this issue yet

https://www.gorillagear.ca = zencart v1.3.9h with 40+ mods

7 Feb 2010, 11:49 PM
#7
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: reviews sidebox!? main page problem

Test this ... use in the:
/includes/modules/sideboxes/reviews.php

<?php
/**
 * reviews sidebox - displays a random product-review
 *
 * @package templateSystem
 * @copyright Copyright 2003-2009 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: reviews.php 14007 2009-07-30 14:35:22Z ajeh $
 */

// if review must be approved or disabled do not show review
  $review_status = " and r.status = 1 ";

  $random_review_sidebox_select = "select r.reviews_id, r.reviews_rating, p.products_id, p.products_image, pd.products_name,
                    reviews_text
                    from " . TABLE_REVIEWS . " r, " . TABLE_REVIEWS_DESCRIPTION . " rd, "
                           . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd
                    where p.products_status = '1'
                    and p.products_id = r.products_id
                    and r.reviews_id = rd.reviews_id
                    and rd.languages_id = '" . (int)$_SESSION['languages_id'] . "'
                    and p.products_id = pd.products_id
                    and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'" .
                    $review_status;

  if (isset($_GET['products_id'])) {
    $random_review_sidebox_select .= " and p.products_id = '" . (int)$_GET['products_id'] . "'";
  }

  $random_review_sidebox_product = $db->ExecuteRandomMulti($random_review_sidebox_select, MAX_RANDOM_SELECT_REVIEWS);
  if ($random_review_sidebox_product->RecordCount() > 0) {
    require($template->get_template_dir('tpl_reviews_random.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_reviews_random.php');
  } elseif (isset($_GET['products_id']) and zen_products_id_valid($_GET['products_id'])) {
// display 'write a review' box
    require($template->get_template_dir('tpl_reviews_write.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_reviews_write.php');
  } else {
// display 'no reviews' box
    require($template->get_template_dir('tpl_reviews_none.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_reviews_none.php');
  }
  $title =  BOX_HEADING_REVIEWS;
  $title_link = FILENAME_REVIEWS;
  require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default);
?>

does this work for you?

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

15 Feb 2010, 4:12 PM
#8
mb1 avatar

mb1

Totally Zenned

Join Date:
Jun 2006
Posts:
565
Plugin Contributions:
0

Re: reviews sidebox!? main page problem

thank you i'll play with it tonight and let you know

https://www.gorillagear.ca = zencart v1.3.9h with 40+ mods

21 Feb 2010, 5:00 PM
#9
mb1 avatar

mb1

Totally Zenned

Join Date:
Jun 2006
Posts:
565
Plugin Contributions:
0

Re: reviews sidebox!? main page problem

problem now solved thank you again your always a great help

https://www.gorillagear.ca = zencart v1.3.9h with 40+ mods

21 Feb 2010, 5:06 PM
#10
mb1 avatar

mb1

Totally Zenned

Join Date:
Jun 2006
Posts:
565
Plugin Contributions:
0

Re: reviews sidebox!? main page problem

the name on the product is gone in the sidebox it just shows 2 dots in place of the name of product

https://www.gorillagear.ca = zencart v1.3.9h with 40+ mods

21 Feb 2010, 5:34 PM
#11
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: reviews sidebox!? main page problem

Try using this as the:
/includes/templates/your_template_dir/sideboxes/tpl_reviews_random.php

<?php
/**
 * Side Box Template
 *
 * @package templateSystem
 * @copyright Copyright 2003-2009 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: tpl_reviews_random.php 14007 2009-07-30 14:35:22Z ajeh $
 */
  $content = "";
  $review_box_counter = 0;
  while (!$random_review_sidebox_product->EOF) {
    $review_box_counter++;
    $content .= '<div id="' . str_replace('_', '-', $box_id . 'Content') . '" class="sideBoxContent centeredContent">';
    $content .= '<a href="' . zen_href_link(FILENAME_PRODUCT_REVIEWS_INFO, 'products_id=' . $random_review_sidebox_product->fields['products_id'] . '&reviews_id=' . $random_review_sidebox_product->fields['reviews_id']) . '">' . zen_image(DIR_WS_IMAGES . $random_review_sidebox_product->fields['products_image'], $random_review_sidebox_product->fields['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '<br />' . zen_break_string(nl2br(zen_output_string_protected(stripslashes($random_review_sidebox_product->fields['reviews_text']))), 60, '-<br />') . ' ..</a><br /><br />' . zen_image(DIR_WS_TEMPLATE_IMAGES . 'stars_' . $random_review_sidebox_product->fields['reviews_rating'] . '.gif' , sprintf(BOX_REVIEWS_TEXT_OF_5_STARS, $random_review_sidebox_product->fields['reviews_rating']));
    $content .= '</div>';
    $random_review_sidebox_product->MoveNextRandom();
  }
?>

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

22 Feb 2010, 4:37 AM
#12
mb1 avatar

mb1

Totally Zenned

Join Date:
Jun 2006
Posts:
565
Plugin Contributions:
0

Re: reviews sidebox!? main page problem

that's kinda cool that code adds the reviewers content text in the side box, which is nicer then then just having the product name but can you cut down the content to 30 characters, as it looks like it displays the whole review in the sidebox

again thanks again linda

https://www.gorillagear.ca = zencart v1.3.9h with 40+ mods

22 Feb 2010, 5:11 AM
#13
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: reviews sidebox!? main page problem

Change the 60 to what you want ...

If you need the name in there, you could add it between the image and the description by referencing it like it is on the alt tag of the image:
$random_review_sidebox_product->fields['products_name']

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

22 Feb 2010, 5:25 AM
#14
mb1 avatar

mb1

Totally Zenned

Join Date:
Jun 2006
Posts:
565
Plugin Contributions:
0

Re: reviews sidebox!? main page problem

yeah i was hoping that was it but nothing happens until i get it don to about 8 then then it start screwing around with the width of the content in the side box but the full review is still displayed just over more rows

right now i changed the 60 to a 10 with no real change

https://www.gorillagear.ca = zencart v1.3.9h with 40+ mods

22 Feb 2010, 2:52 PM
#15
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: reviews sidebox!? main page problem

Put the 60 back and add a substr around the text ... for example:

substr($random_review_sidebox_product->fields['reviews_text'], 0, 20)

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

22 Feb 2010, 7:24 PM
#16
mb1 avatar

mb1

Totally Zenned

Join Date:
Jun 2006
Posts:
565
Plugin Contributions:
0

Re: reviews sidebox!? main page problem

worked perfectly thank you again

https://www.gorillagear.ca = zencart v1.3.9h with 40+ mods

22 Feb 2010, 7:37 PM
#17
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: reviews sidebox!? main page problem

You are most welcome ... thanks for the update! :smile:

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

22 Feb 2010, 10:38 PM
#18
mb1 avatar

mb1

Totally Zenned

Join Date:
Jun 2006
Posts:
565
Plugin Contributions:
0

Re: reviews sidebox!? main page problem

ohh if you want feedback i tried to adjust how much text could be displayed in the side box with this part of the code ```
, 0, 20)

https://www.gorillagear.ca = zencart v1.3.9h with 40+ mods

23 Feb 2010, 12:08 AM
#19
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: reviews sidebox!? main page problem

I used:

    $content .= '<a href="' . zen_href_link(FILENAME_PRODUCT_REVIEWS_INFO, 'products_id=' . $random_review_sidebox_product->fields['products_id'] . '&reviews_id=' . $random_review_sidebox_product->fields['reviews_id']) . '">' . zen_image(DIR_WS_IMAGES . $random_review_sidebox_product->fields['products_image'], $random_review_sidebox_product->fields['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '<br />' . zen_break_string(nl2br(zen_output_string_protected(stripslashes([B]substr($random_review_sidebox_product->fields['reviews_text'], 0, 20)[/B]))), 60, '-<br />') . ' ..</a><br /><br />' . zen_image(DIR_WS_TEMPLATE_IMAGES . 'stars_' . $random_review_sidebox_product->fields['reviews_rating'] . '.gif' , sprintf(BOX_REVIEWS_TEXT_OF_5_STARS, $random_review_sidebox_product->fields['reviews_rating']));

Meanwhile, glad you have it working now ... :smile:

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

22 Apr 2010, 12:46 AM
#20
liamv avatar

liamv

New Zenner

Join Date:
Feb 2010
Posts:
73
Plugin Contributions:
0

Re: reviews sidebox!? main page problem

Ajeh:

You are most welcome ... thanks for the update! :smile:

Great mod it worked for me too. However having made the mod I now have two strange problems and I am not sure if it is related to the mod.

my site is https://www.fastbikegear.co.nz and I am using the ZJ black template.

The first problem is that my manufacturer's info side box now has the same contents as my new products info side box?

The second problem is that the order that my side boxes appears in does not match that set in my Layout Box Controller?

Is anyone able to shed any light on what I have done wrong and what I need to do to fix this?

Many thanks in advance