Zen Cart Logo
Forums / Addon Sideboxes / jQuery Scrolling Sideboxes [Support Thread]

jQuery Scrolling Sideboxes [Support Thread]

Views: 79,929

Results 61 to 80 of 80
13 Jan 2021, 11:54 AM
#61
generikz avatar

generikz

New Zenner

Join Date:
Sep 2011
Location:
Tokyo
Posts:
26
Plugin Contributions:
0

jQuery Scrolling Sideboxes [Support Thread]

Hello!

Small typo (pname/name) in tpl_best_sellers_scrolling.php:

    $bss_[B]pname[/B] = $best_sellers_scrolling->fields['products_name'];
(...)
    $content .= "<br />#$count: $bss_[B]name[/B]</a>";

Somehow only best_sellers_scrolling shows up in my 1.5.6c ZC shop and simply reloads the next best sellers after a while.
Should there be some kind of animation?

Other 3 do not show up at all even when enabled as a sidebox from the admin side, no error message in log or on screen.

I'm puzzled. What is it supposed to look like?

Julien

13 Jan 2021, 2:16 PM
#62
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,102
Plugin Contributions:
56

Re: jQuery Scrolling Sideboxes [Support Thread]

Oh my!:shocking: That bug's been present forever (thanks for the report).

I use the featured_scrolling (My Services) and whats_new_scrolling (Recently Updated) sideboxes on My Website. The 'normal' Zen Cart limits are used for those displays.

That is, if you have no featured products, the featured_scrolling won't display. If you have no 'new' products (as limited by Configuration :: Maximum Values :: New Product Listing .. Limited To), the whats_new_scrolling doesn't display.

13 Jan 2021, 2:34 PM
#63
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,102
Plugin Contributions:
56

Re: jQuery Scrolling Sideboxes [Support Thread]

I've just submitted v2.1.3 of the jQuery Scrolling Sideboxes.

 This release contains changes associated with the following GitHub issues:

#11: Correct variable usage in best_sellers_scrolling

13 Jan 2021, 7:18 PM
#64
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,102
Plugin Contributions:
56

Re: jQuery Scrolling Sideboxes [Support Thread]

lat9:

I've just submitted v2.1.3 of the jQuery Scrolling Sideboxes.

 This release contains changes associated with the following GitHub issues:

#11: Correct variable usage in best_sellers_scrolling
Now available for download: https://www.zen-cart.com/downloads.php?do=file&id=1909

14 Jan 2021, 4:00 PM
#65
generikz avatar

generikz

New Zenner

Join Date:
Sep 2011
Location:
Tokyo
Posts:
26
Plugin Contributions:
0

Re: jQuery Scrolling Sideboxes [Support Thread]

lat9:

Now available for download: https://www.zen-cart.com/downloads.php?do=file&id=1909

Thank you!

I get it now.

I thought "scrolling" sounded like a visual effect (carousel maybe?) but it's actually a timed rotation, which is fine as well.

Julien

14 Sep 2021, 4:39 AM
#66
rlexyd avatar

rlexyd

Zen Follower

Join Date:
Nov 2006
Location:
Sydney, Australia
Posts:
473
Plugin Contributions:
0

Re: jQuery Scrolling Sideboxes [Support Thread]

DivaVocals:

Question: (yep here I go pushing the envelope again.. :laugh:)

I haven't downloaded this yet to take a looksee, but I would like to add this kind of functionality to the Testimonials and reviews sideboxes.. In your opinion, will it be fairly OBVIOUS looking at your code to figure out how to apply this to the Testimonials and reviews sideboxes??

Hi Crystal, did you ever get this plugin to work with the Reviews Box?
I started to copy/merge some info from this plugin to the review files but my brain started to fade away and I gave up :(
Hope you had luck with this at least.

lat9:

Yes. In each case, the plugin's sideboxes were cloned from their built-in Zen Cart sidebox of a similar name. The jQuery that handles the scrolling is a common function, invoked via the sidebox's tpl_ file.

Thank you very much Cindy for this plugin, works well out of the box on 1.5.7c on PHP 7.4 on responsive_classic :)
Hopefully I can manage to expand it to the reviews box.

22 Sep 2021, 9:56 PM
#67
rlexyd avatar

rlexyd

Zen Follower

Join Date:
Nov 2006
Location:
Sydney, Australia
Posts:
473
Plugin Contributions:
0

Re: jQuery Scrolling Sideboxes [Support Thread]

Ok, so I had another go at it and I'm almost there, just need more help please as I'm very sure I've done a few things wrong :(
Can't seem to get the product to change, it stays on the same product.
Here's the snapshot of the reviews box at the test site: https://i.imgur.com/JegnOTQ.png

1) This is the new file created in (includes/modules/sideboxes/reviews_scrolling.php):

  $review_status = " and r.status = 1 ";


  $scrolling_review_sql = "select r.reviews_id, r.reviews_rating, p.products_id, p.products_image, pd.products_name,
                    substring(reviews_text, 1, 70) as 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'])) {
    $scrolling_review .= " and p.products_id = '" . (int)$_GET['products_id'] . "'";
  }


  $scrolling_review = $db->ExecuteRandomMulti($scrolling_review_sql, MAX_RANDOM_SELECT_REVIEWS);
  
  
  if (!$scrolling_review->EOF) {
    require($template->get_template_dir('tpl_reviews_random_scrolling.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_reviews_random_scrolling.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_SCROLLING;
  $title_link = FILENAME_REVIEWS;
  require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default);
?>

2) This is the new file created in (includes/templates/template_default/sideboxes/tpl_reviews_random_scrolling.php):

  $content = '<div class="sideBoxContent centeredContent">';
  $review_box_counter = 0;
  while (!$scrolling_review->EOF) {
    $review_box_counter++;
	$rs_pid = $scrolling_review->fields['products_id'];
    $rs_pname = $scrolling_review->fields['products_name'];
    $content .= '<br />' . $rs_pname . '</a>';
//	$content .= "\n" . '  <div class="sideBoxContentItem hiddenField reviewsScroller">'; (If I un-comment this, website jumbles up)
    $content .= '<div class="' . str_replace('_', '-', $box_id . 'Content') . ' sideBoxContent centeredContent">';
//    $content .= '<a href="' . zen_href_link(zen_get_info_page($rs_pid), 'cPath=' . zen_get_generated_category_path_rev($scrolling_review->fields['master_categories_id']) . "&products_id=$rs_pid") . '">' . zen_image(DIR_WS_IMAGES . $scrolling_review->fields['products_image'], $rs_pname, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '<br />' . nl2br(zen_trunc_string(zen_output_string_protected(stripslashes($scrolling_review->fields['reviews_text'])), 60)) . '</a><br /><br />' . zen_image(DIR_WS_TEMPLATE_IMAGES . 'stars_' . $scrolling_review->fields['reviews_rating'] . '.gif' , sprintf(BOX_REVIEWS_TEXT_OF_5_STARS, $scrolling_review->fields['reviews_rating']));
    $content .= '<a href="' . zen_href_link(FILENAME_PRODUCT_REVIEWS_INFO, 'products_id=' . $scrolling_review->fields['products_id'] . '&reviews_id=' . $scrolling_review->fields['reviews_id']) . '">' . zen_image(DIR_WS_IMAGES . $scrolling_review->fields['products_image'], $scrolling_review->fields['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '<br />' . nl2br(zen_trunc_string(zen_output_string_protected(stripslashes($scrolling_review->fields['reviews_text'])), 60)) . '</a><br /><br />' . zen_image(DIR_WS_TEMPLATE_IMAGES . 'stars_' . $scrolling_review->fields['reviews_rating'] . '.gif' , sprintf(BOX_REVIEWS_TEXT_OF_5_STARS, $scrolling_review->fields['reviews_rating']));
    $content .= '</div>';
    $scrolling_review->MoveNextRandom();
  }
$content .= '</div><script type="text/javascript">$("div.reviewsScroller").cycle(5000);</script>' . "\n";

3) I added this to includes/languages/english/extra_definitions/scrolling_sideboxes.php:

define('BOX_HEADING_REVIEWS_SCROLLING', 'Reviews');
23 Sep 2021, 5:36 AM
#68
rlexyd avatar

rlexyd

Zen Follower

Join Date:
Nov 2006
Location:
Sydney, Australia
Posts:
473
Plugin Contributions:
0

Re: jQuery Scrolling Sideboxes [Support Thread]

p.s: If I set the Admin/Configuration/Maximum Value --> **Random Product Reviews for SideBox **to a value More than 1, the sidebox will display several reviews all at once under each other in the sidebox, not scrolling.

23 Sep 2021, 8:48 AM
#69
rlexyd avatar

rlexyd

Zen Follower

Join Date:
Nov 2006
Location:
Sydney, Australia
Posts:
473
Plugin Contributions:
0

Re: jQuery Scrolling Sideboxes [Support Thread]

Ok woow :shocking: seems I have finally made it work after a heap of trial and error.
But I still need help with a couple of things please.

  1. When you click on the review, it takes you to product page, I would like it to take the customer to that actual review page!
  2. Remove some of the space showing UNDER the review stars (too much white space which is making box too long).

This is the new file created in (includes/templates/template_default/sideboxes/tpl_reviews_random_scrolling.php):

$content  = '<div id="scrolling_review" class="sideBoxContent centeredContent">';
$count = 1;
while (!$scrolling_review->EOF) {
    $rs_pid = $scrolling_review->fields['products_id'];
    $rs_pname = $scrolling_review->fields['products_name'];
    $content .= PHP_EOL . '  <div class="sideBoxContentItem hiddenField reviewsScroller">';
	$content .= "$rs_pname<br /><br /></a>";
    $content .= '<a href="' . zen_href_link(zen_get_info_page($rs_pid), "products_id=$rs_pid") . '">' . zen_image(DIR_WS_IMAGES . $scrolling_review->fields['products_image'], $rs_pname, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT)	. '<br />' . nl2br(zen_trunc_string(zen_output_string_protected(stripslashes($scrolling_review->fields['reviews_text'])), 60)) . '</a><br /><br />' . zen_image(DIR_WS_TEMPLATE_IMAGES . 'stars_' . $scrolling_review->fields['reviews_rating'] . '.gif' , sprintf(BOX_REVIEWS_TEXT_OF_5_STARS, $scrolling_review->fields['reviews_rating']));
    $content .= '</div>';
    $count++;
    $scrolling_review->MoveNextRandom();
}
$content .= '</div><script type="text/javascript">$("div.reviewsScroller").cycle(5000);</script>' . "\n";
23 Sep 2021, 9:47 PM
#70
rlexyd avatar

rlexyd

Zen Follower

Join Date:
Nov 2006
Location:
Sydney, Australia
Posts:
473
Plugin Contributions:
0

Re: jQuery Scrolling Sideboxes [Support Thread]

Ok, managed to solve one of the above queries, No. 1:

I changed the PHP code to this:

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

Could still use help with the above no. 2 query, plus if there is a way to may the product name a little bigger as it seems a bit small & the below error log.

I'm also getting this ERROR Log:
--> PHP Notice: Undefined variable: scrolling_review in /02/includes/modules/sideboxes/**reviews_scrolling.php **on line 28.

This is Line 28:
if (isset($_GET['products_id'])) { $scrolling_review .= " and p.products_id = '" . (int)$_GET['products_id'] . "'"; }

Thank you.

24 Sep 2021, 9:21 PM
#71
rlexyd avatar

rlexyd

Zen Follower

Join Date:
Nov 2006
Location:
Sydney, Australia
Posts:
473
Plugin Contributions:
0

Re: jQuery Scrolling Sideboxes [Support Thread]

I managed to stop the above Error log generating by commenting out the following line in /includes/modules/sideboxes/reviews_scrolling.php.

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

The scrolling review box still seems to work fine, not sure if this was the correct way to stop that error log or if doing this will effect any other function on my website?!

Hope someone can confirm :lookaroun

25 Sep 2021, 2:16 PM
#72
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,102
Plugin Contributions:
56

Re: jQuery Scrolling Sideboxes [Support Thread]

rlexyd:

I managed to stop the above Error log generating by commenting out the following line in /includes/modules/sideboxes/reviews_scrolling.php.

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

> 
> The scrolling review box still seems to work fine, not sure if this was the correct way to stop that error log or if doing this will effect any other function on my website?!
> 
> Hope someone can confirm :lookaroun
You're appending that AND clause to the wrong variable:
 if (isset($_GET['products_id'])) {  $scrolling_review[B]_sql[/B] .= " and p.products_id = '" . (int)$_GET['products_id'] . "'";  }
25 Sep 2021, 9:31 PM
#73
rlexyd avatar

rlexyd

Zen Follower

Join Date:
Nov 2006
Location:
Sydney, Australia
Posts:
473
Plugin Contributions:
0

Re: jQuery Scrolling Sideboxes [Support Thread]

Thank you Cindy, that stopped the error log :)
Can you Please have a peak at the final code changes below and if you can give them your thumbs up :thumbsup: before I add them to my live site? Thanking you in advance!

1) includes/templates/MYTEMPLATE/sideboxes/tpl_reviews_random_scrolling.php:

$content  = '<div id="scrolling_review" class="sideBoxContent centeredContent">';
$count = 1;
while (!$scrolling_review->EOF) {
    $rs_pid = $scrolling_review->fields['products_id'];
    $rs_pname = $scrolling_review->fields['products_name'];
    $content .= PHP_EOL . '  <div class="sideBoxContentItem hiddenField reviewsScroller">';
    $content .= "$rs_pname<br /><br /></a>";
    $content .= '<a href="' . zen_href_link(FILENAME_PRODUCT_REVIEWS_INFO, 'products_id=' . $scrolling_review->fields['products_id'] .	'&reviews_id=' . $scrolling_review->fields['reviews_id']) . '">' . zen_image(DIR_WS_IMAGES . $scrolling_review->fields['products_image'], $rs_pname, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT)	. '<br />' . nl2br(zen_trunc_string(zen_output_string_protected(stripslashes($scrolling_review->fields['reviews_text'])), 60)) . '</a><br /><br />' . zen_image(DIR_WS_TEMPLATE_IMAGES . 'stars_' . $scrolling_review->fields['reviews_rating'] . '.png' , sprintf(BOX_REVIEWS_TEXT_OF_5_STARS, $scrolling_review->fields['reviews_rating']));
    $content .= '</div>';
    $count++;
    $scrolling_review->MoveNextRandom();
}
$content .= '</div><script type="text/javascript">$("div.reviewsScroller").cycle(5000);</script>' . "\n";

2) includes/modules/sideboxes/reviews_scrolling.php:

  $review_status = " and r.status = 1 ";


  $scrolling_review_sql = "select r.reviews_id, r.reviews_rating, p.products_id, p.products_image, pd.products_name,
                    substring(reviews_text, 1, 70) as 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'])) {
    $scrolling_review_sql .= " and p.products_id = '" . (int)$_GET['products_id'] . "'";
  }


  $scrolling_review = $db->ExecuteRandomMulti($scrolling_review_sql, (int)MAX_RANDOM_SELECT_REVIEWS);  
  
  if (!$scrolling_review->EOF) {
    require($template->get_template_dir('tpl_reviews_random_scrolling.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_reviews_random_scrolling.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_SCROLLING;
  $title_link = FILENAME_REVIEWS;
  require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default);
?>

3) includes/languages/english/extra_definitions/scrolling_sideboxes.php:

define('BOX_HEADING_REVIEWS_SCROLLING', 'Reviews');
26 Sep 2021, 2:07 PM
#74
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,102
Plugin Contributions:
56

Re: jQuery Scrolling Sideboxes [Support Thread]

Looks similar to what I've got staged for release. The major differences are using HTML5 so I've changed all the <br /> to <br> and removed the type="text/javascript" from the <script> tag.

27 Sep 2021, 9:51 PM
#75
rlexyd avatar

rlexyd

Zen Follower

Join Date:
Nov 2006
Location:
Sydney, Australia
Posts:
473
Plugin Contributions:
0

Re: jQuery Scrolling Sideboxes [Support Thread]

lat9:

Looks similar to what I've got staged for release. The major differences are using HTML5 so I've changed all the <br /> to <br> and removed the type="text/javascript" from the <script> tag.

Thanks for the confirmation Cindy.
Just noticed the write review box on mobile view is not aligned well. https://i.imgur.com/qo45Xya.jpg
It's displaying half way, which is weird as this seems to only display that way when there is NO reviews to display on that product page.
If there is a product review for that product, than the scrolling review box appears correctly on the page.

Any suggestions on how to center that write review box correctly?

Thank you.

28 Sep 2021, 2:20 PM
#76
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,102
Plugin Contributions:
56

Re: jQuery Scrolling Sideboxes [Support Thread]

rlexyd:

Thanks for the confirmation Cindy.
Just noticed the write review box on mobile view is not aligned well. https://i.imgur.com/qo45Xya.jpg
It's displaying half way, which is weird as this seems to only display that way when there is NO reviews to display on that product page.
If there is a product review for that product, than the scrolling review box appears correctly on the page.

Any suggestions on how to center that write review box correctly?

Thank you.
No suggestions in this support-thread, since that's template-dependent. How about posting in the support-thread for the template you're using.

15 Apr 2024, 1:13 AM
#77
honrheart avatar

honrheart

Zen Follower

Join Date:
Jul 2008
Posts:
139
Plugin Contributions:
0

Re: jQuery Scrolling Sideboxes [Support Thread]

Will this work on 2.0?

15 Apr 2024, 11:31 AM
#78
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,102
Plugin Contributions:
56

Re: jQuery Scrolling Sideboxes [Support Thread]

honrheart:

Will this work on 2.0?
I see no reason why these sideboxes should not work on zc200's responsive_classic template or a clone thereof.

15 Apr 2024, 5:40 PM
#79
honrheart avatar

honrheart

Zen Follower

Join Date:
Jul 2008
Posts:
139
Plugin Contributions:
0

Re: jQuery Scrolling Sideboxes [Support Thread]

is there a trick to get it to scroll in 2.0? The box shows up but there is no scrolling as it's only showing 1 product although there are more new products in the store.

15 Apr 2024, 9:20 PM
#80
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,102
Plugin Contributions:
56

Re: jQuery Scrolling Sideboxes [Support Thread]

honrheart:

is there a trick to get it to scroll in 2.0? The box shows up but there is no scrolling as it's only showing 1 product although there are more new products in the store.
I dunno, haven't tried. When you're viewing the site, press your browser's F12 (in Windows or the equivalent for your OS) to view the Developers' Tools. Click the "Console" tab to see if there are any errors.

If the site's accessible, you can post a link like https://mysite(dot)com so that others can view but search engines won't.