-
jQuery Scrolling Sideboxes [Support Thread]
I'll be uploading the subject plugin for review shortly and will post its download URL when I receive it.
This plugin provides three new sideboxes: featured_scrolling, specials_scrolling and whats_new_scrolling. In each case, the sidebox is based on the Zen Cart built-in sidebox with a similar name ... except it only displays one product at a time to reduce the amount of screen "real-estate" required!
-
Re: jQuery Scrolling Sideboxes [Support Thread]
-
Re: jQuery Scrolling Sideboxes [Support Thread]
Now available from the Plugins area ...
-
Re: jQuery Scrolling Sideboxes [Support Thread]
Quote:
Originally Posted by
lat9
Now available from the Plugins area ...
What are the differences between the new module and this one:
http://www.zen-cart.com/downloads.php?do=file&id=871
Thanks,
Anne
-
Re: jQuery Scrolling Sideboxes [Support Thread]
I don't know; I didn't see that one before I developed this plugin. Do you have a site where I could see Clyde's contribution in action?
-
Re: jQuery Scrolling Sideboxes [Support Thread]
Quote:
Originally Posted by
lat9
I don't know; I didn't see that one before I developed this plugin. Do you have a site where I could see Clyde's contribution in action?
no ;) But if I remember correctly, it has the product scrolling vertically for new, featured, specials, and possibly best sellers.
Thanks,
Anne
-
Re: jQuery Scrolling Sideboxes [Support Thread]
I installed Clyde's contribution on a local test site; here are the differences:
- javascript (6KB) vs. jQuery (1KB)
- The selections actually scroll, rather than simply changing the image at a defined rate
- Replaces existing sideboxes, rather than providing additional ones
- Includes best-sellers, which is on my list ...
-
Re: jQuery Scrolling Sideboxes [Support Thread]
You can see this contribution in action at http://test.vinosdefrutastropicales.com.
-
Re: jQuery Scrolling Sideboxes [Support Thread]
Quote:
Originally Posted by
lat9
I installed Clyde's contribution on a local test site; here are the differences:
- javascript (6KB) vs. jQuery (1KB)
- The selections actually scroll, rather than simply changing the image at a defined rate
- Replaces existing sideboxes, rather than providing additional ones
- Includes best-sellers, which is on my list ...
That sounds great. I am thinking of including this in my new free responsive template packages that I am working on ;)
Thanks,
Anne
-
Re: jQuery Scrolling Sideboxes [Support Thread]
Quote:
Originally Posted by
picaflor-azul
That sounds great. I am thinking of including this in my new free responsive template packages that I am working on ;)
Thanks,
Anne
I'd be honored!:smile:
-
Re: jQuery Scrolling Sideboxes [Support Thread]
I just submitted v1.1.0 of this plugin; it now includes a best_sellers_scrolling sidebox.
-
Re: jQuery Scrolling Sideboxes [Support Thread]
v1.1.0 is now available for download.
-
Re: jQuery Scrolling Sideboxes [Support Thread]
hi
nice module, but can we have something like a slider, with buttons, would be a great module to work with
cheers
-
Re: jQuery Scrolling Sideboxes [Support Thread]
I'll make a note of your enhancement request!
-
Re: jQuery Scrolling Sideboxes [Support Thread]
How does this work? I can see new "Featured [MORE]" and "WHAT'S NEW [MORE]" and the rest if I turn it on in Layout Boxes Controller, but these are empty and useless.
-
Re: jQuery Scrolling Sideboxes [Support Thread]
Quote:
Originally Posted by
khejit
How does this work? I can see new "Featured [MORE]" and "WHAT'S NEW [MORE]" and the rest if I turn it on in Layout Boxes Controller, but these are empty and useless.
Just like with the built-in featured and what's new sideboxes, if you don't have any products defined as featured or up-coming then these sideboxes won't have content ... so you should turn them off.
-
Re: jQuery Scrolling Sideboxes [Support Thread]
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??
-
Re: jQuery Scrolling Sideboxes [Support Thread]
Quote:
Originally Posted by
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??
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.
-
Re: jQuery Scrolling Sideboxes [Support Thread]
Quote:
Originally Posted by
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.
Cool!!! Thanks.. I'll have a looksee..
-
Re: jQuery Scrolling Sideboxes [Support Thread]
Quote:
Originally Posted by
lat9
I took down that test subdomain a while ago; you can view their operation on http://vinosdefrutastropicales.com, though!
-
Re: jQuery Scrolling Sideboxes [Support Thread]
I've checked this plugin; it's compatible with Zen Cart v1.5.4 and v1.5.5 (no core-file changes).
-
Re: jQuery Scrolling Sideboxes [Support Thread]
Hi.
Is there a simple way to change one of these side boxes into displaying Expected Products? I'm still getting my head around the MySQL queries that would be needed to do so.
Thanks in advance :)
-
Re: jQuery Scrolling Sideboxes [Support Thread]
You could re-use the SQL queries from /includes/modules/upcoming.php (that's the centerbox implementation).
-
Re: jQuery Scrolling Sideboxes [Support Thread]
OK thanks .. I am looking at it .. just as a trial though I installed the Best Sellers scroller but ti doesn't scroll it just produces a list of the top 10 books??
-
Re: jQuery Scrolling Sideboxes [Support Thread]
Great Add-on!!
For the what's new scroller, what changes would have to be made to "tpl_whats_new_scrolling.php" to display the product description under the product name?
Thanks,
-
Re: jQuery Scrolling Sideboxes [Support Thread]
Quote:
Originally Posted by
allmart
Great Add-on!!
For the what's new scroller, what changes would have to be made to "tpl_whats_new_scrolling.php" to display the product description under the product name?
Thanks,
To make the change you're requesting, you'll need to change (at least) two files, adding the portions identified like this:
/includes/modules/sideboxes/YOUR_TEMPLATE/whats_new_scrolling.php:
Code:
// -----
// Scrolling "what's new" sidebox, based on the whats_new.php sidebox that's built into Zen Cart!
//
// Copyright (c) 2014, Vinos de Frutas Tropicales (lat9)
// Copyright 2003-2010 Zen Cart Development Team
// Copyright 2003 osCommerce
// License: http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
//
$display_limit = zen_get_new_date_range();
$whats_new_scrolling_sql = "SELECT p.products_id, p.products_image, p.products_tax_class_id, p.products_price, pd.products_name, p.master_categories_id, pd.products_description
FROM (" . TABLE_PRODUCTS . " p LEFT JOIN " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id )
WHERE p.products_id = pd.products_id
AND pd.language_id = '" . (int)$_SESSION['languages_id'] . "'
AND p.products_status = 1 " . $display_limit;
$whats_new_scrolling = $db->ExecuteRandomMulti ($whats_new_scrolling_sql, MAX_RANDOM_SELECT_NEW);
if (!$whats_new_scrolling->EOF) {
require ($template->get_template_dir('tpl_whats_new_scrolling.php', DIR_WS_TEMPLATE, $current_page_base, 'sideboxes') . '/tpl_whats_new_scrolling.php');
$title = BOX_HEADING_WHATS_NEW_SCROLLING;
$title_link = FILENAME_PRODUCTS_NEW;
require ($template->get_template_dir ($column_box_default, DIR_WS_TEMPLATE, $current_page_base, 'common') . '/' . $column_box_default);
}
and then change the /includes/templates/YOUR_TEMPLATE/sideboxes/tpl_whats_new_scrolling.php to display that information:
Code:
// -----
// Scrolling "what's new" sidebox, based on the whats_new.php sidebox that's built into Zen Cart!
//
// Copyright (c) 2014, Vinos de Frutas Tropicales (lat9)
// Copyright 2003-2011 Zen Cart Development Team
// Copyright 2003 osCommerce
// License: http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
//
$content = '<div class="sideBoxContent centeredContent">';
while (!$whats_new_scrolling->EOF) {
$whats_new_price = zen_get_products_display_price ($whats_new_scrolling->fields['products_id']);
$content .= "\n" . ' <div class="sideBoxContentItem hiddenField whatsNewScroller">';
$content .= '<a href="' . zen_href_link (zen_get_info_page ($whats_new_scrolling->fields['products_id']), 'cPath=' . zen_get_generated_category_path_rev ($whats_new_scrolling->fields['master_categories_id']) . '&products_id=' . $whats_new_scrolling->fields['products_id']) . '">' . zen_image (DIR_WS_IMAGES . $whats_new_scrolling->fields['products_image'], $whats_new_scrolling->fields['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT);
$content .= '<br />' . $whats_new_scrolling->fields['products_name'] . '</a>';
$content .= '<div>' . zen_trunc_string (zen_clean_html ($whats_new_scrolling->fields['products_description'])) . '</div>';
$content .= '<div>' . $whats_new_price . '</div>';
$content .= '</div>';
$whats_new_scrolling->MoveNextRandom();
}
$content .= '</div><script type="text/javascript">$("div.whatsNewScroller").cycle(10000);</script>' . "\n";
-
1 Attachment(s)
Re: jQuery Scrolling Sideboxes [Support Thread]
Thank you very much... worked like a charm. I am hoping you can give me guidance to where I can change the css to address the following minor issue I have. in responsive mode/mobile the scrolling box is not centered on the screen I would guess because it is designed for the sidebox. Is it possible to centre the scrolling box and have the heading box full width.
Attachment 16488
Thanks,
-
Re: jQuery Scrolling Sideboxes [Support Thread]
You're very welcome. If you'd post a link to the site, perhaps I can help further.
-
Re: jQuery Scrolling Sideboxes [Support Thread]
Here's the link http://www.allmart.ca/store/ it's work in progress, learning slowly.
-
Re: jQuery Scrolling Sideboxes [Support Thread]
It's looking good! Unfortunately, there's more change required that just a CSS centering for the mobile display, since the scrolling somehow sets the page at the top after every image-update.
It's going to be easier to simply hide that display for mobile devices by editing your /includes/templates/responsive_classic/jscript/jscript_responsive_framework.php, adding the following to the mobile-device clause:
Code:
$('#whatsnewscrolling).css({ 'display': 'none', 'visibility': 'hidden' });
P.S. You're letting yourself in for a "world of hurt" by directly modifying the responsive_classic files, since you'll need to merge any updates in with your changes from the get-go on the next Zen Cart update. Better to use the Clone a Template plugin, clone what you've currently got for the responsive_classic and then make further edits on your cloned version.
-
Re: jQuery Scrolling Sideboxes [Support Thread]
Thanks again for your prompt response and solution that worked like a charm. Your advice for using the Clone a Template plugin is also appreciated. I have made detailed notes pertaining to my changes but since I am a NEWB I was always worried I wouldn't remember what I did when the next update came along. I am going to start from scratch while my memory is fresh and take your advice it might be a little work now but will save me a lot in the future. I still have a lot of work before I go live.
Thanks again... you truly are "Totally Zenned"
-
Re: jQuery Scrolling Sideboxes [Support Thread]
Just a note, when you "clone" the responsive_classic template, you'll be pulling in/cloning that template with all your current changes.
-
Re: jQuery Scrolling Sideboxes [Support Thread]
Sorry but I am a little unclear on the procedure of cloning the template. After I clone my template, through admin, do I then select the cloned template as the master where I do my mods and re-clone that template after changes have been made or do I after cloning the original template, select the original template as the master and clone that one after after changes.
Thanks again.
-
Re: jQuery Scrolling Sideboxes [Support Thread]
@allmart, rather than cluttering this support thread, let's take your questions to the Clone a Template support thread.
-
Re: jQuery Scrolling Sideboxes [Support Thread]
-
Re: jQuery Scrolling Sideboxes [Support Thread]
lat9,
You have been so helpful and was hoping you could provide a solution to this minor problem. Is it possible to have a fixed box height for the scrolling box. If the product name is wider than the column/box width, the text wraps which shifts everything below the box down because of the extra line and back up if the name is less than the box width.
-
Re: jQuery Scrolling Sideboxes [Support Thread]
allmart, I've used a couple of the "equal heights" jQuery scripts for other purposes. Let me investigate and I'll get back with you, since your request is one that I've had on my list for this plugin for a while now.
-
Re: jQuery Scrolling Sideboxes [Support Thread]
Was not able to get this to work with 1.5.5e without adding files to the newer overides directories.
Code:
Copy the plugin's files to your store's file system.
- /includes/languages/english/extra_definitions/scrolling_sideboxes.php
- /includes/modules/sideboxes/best_sellers_scrolling.php
- /includes/modules/sideboxes/featured_scrolling.php
- /includes/modules/sideboxes/specials_scrolling.php
- /includes/modules/sideboxes/whats_new_scrolling.php
- /includes/templates/template_default/jscript/jscript_jquery_cdn.js
- /includes/templates/template_default/jscript/jscript_sidebox_slider.js
- /includes/templates/template_default/sideboxes/tpl_best_sellers_scrolling.php
- /includes/templates/template_default/sideboxes/tpl_featured_scrolling.php
- /includes/templates/template_default/sideboxes/tpl_specials_scrolling.php
- /includes/templates/template_default/sideboxes/tpl_whats_new_scrolling.php
works just fine as
Code:
Copy the plugin's files to your store's file system.
- /includes/languages/english/extra_definitions/YOUR_TEMPLATE/scrolling_sideboxes.php
- /includes/modules/sideboxes/YOUR_TEMPLATE/best_sellers_scrolling.php
- /includes/modules/sideboxes/YOUR_TEMPLATE/featured_scrolling.php
- /includes/modules/sideboxes/YOUR_TEMPLATE/specials_scrolling.php
- /includes/modules/sideboxes/YOUR_TEMPLATE/whats_new_scrolling.php
- /includes/templates/YOUR_TEMPLATE/jscript/jscript_jquery_cdn.js
- /includes/templates/YOUR_TEMPLATE/jscript/jscript_sidebox_slider.js
- /includes/templates/YOUR_TEMPLATE/sideboxes/tpl_best_sellers_scrolling.php
- /includes/templates/YOUR_TEMPLATE/sideboxes/tpl_featured_scrolling.php
- /includes/templates/YOUR_TEMPLATE/sideboxes/tpl_specials_scrolling.php
- /includes/templates/YOUR_TEMPLATE/sideboxes/tpl_whats_new_scrolling.php
Note: with the responsive_classic, the boxes are properly centered in the mobile phone testing I've done.
-
Re: jQuery Scrolling Sideboxes [Support Thread]
@dbltoe, that's weird; I've been using those sideboxes on my site since 1.5.5a with a clone of the responsive_classic template.
In what way did it "not work" out-of-the-box?
-
Re: jQuery Scrolling Sideboxes [Support Thread]
Until i moved the files to the YOUR_TEMPLATE override folders, it was as if nothing had been loaded. Got all listings with no scroll.
Went back thru twice to verify files loaded, correct boxes turned on, etc.
Pulled out the old zc_overrides and said "hmmm, let me throw them all in the overrides." Worked first shot.
-
Re: jQuery Scrolling Sideboxes [Support Thread]
As to overrides, if your YOUR_TEMPLATE folder has a "jscript" folder, then all lookups to template_default for "jscript" files will be completely ignored, and only your YOUR_TEMPLATE/jscript folder will be used.
So, it's quite possible that if this plugin relies on such files then yes you'd need to put those into YOUR_TEMPLATE instead of template_default.
But strictly speaking, for all the "sidebox" files (module and template), you don't strictly have to use an override folder, if you want the feature to apply regardless of which template you're using.
-
Re: jQuery Scrolling Sideboxes [Support Thread]
Quote:
Originally Posted by
DrByte
As to overrides, if your YOUR_TEMPLATE folder has a "jscript" folder, then all lookups to template_default for "jscript" files will be completely ignored, and only your YOUR_TEMPLATE/jscript folder will be used.
So, it's quite possible that if this plugin relies on such files then yes you'd need to put those into YOUR_TEMPLATE instead of template_default.
But strictly speaking, for all the "sidebox" files (module and template), you don't strictly have to use an override folder, if you want the feature to apply regardless of which template you're using.
Thanks, DrByte; you hit the nail on the head. I need to update the plugin's distribution to ensure that there's a copy of the /jscript/jscript_sidebox_slider.js file in the /YOUR_TEMPLATE/jscript directory. No need to move all other files out of template-default.
While I'm at it, I noticed that the readme doesn't indicate that you'll have to use the Layout Box controller to enable/place the sideboxes so I'll get that squished, too.
Thanks, @dbltoe, for the report and persistence in getting the issue corrected.
-
Re: jQuery Scrolling Sideboxes [Support Thread]
I've just submitted v2.0.0 of the plugin for review. This version:
- Drops support for Zen Cart versions prior to 1.5.5.
- Includes a template-override folder (YOUR_TEMPLATE) version of the jQuery script that performs the scrolling.
- Removes the plugin's default jQuery load; your active template is "presumed" to include jQuery at this point!
- Updates the readme to note that, like with all sideboxes, the Layout Boxes Controller must be run as part of the plugin's installation.
I'll post back here once the update is available from the Zen Cart plugins.
-
Re: jQuery Scrolling Sideboxes [Support Thread]
v2.0.0 is now available for download.
-
Re: jQuery Scrolling Sideboxes [Support Thread]
I've decided that nothing in life is absolute. I've got several sites working with this mod and one that won't cooperate. The other sites are mostly using the same mods with two using exactly the same mods.
On the other sites, the sideboxes shuffle through the proper items. On russianradiantsaDOTcom, the images do not change until a page change is done. The images flicker at the appointed time but do not change.
I've verified files, file placement, etc but still no image change.
:frusty:
-
Re: jQuery Scrolling Sideboxes [Support Thread]
I don't know if this is the issue, but ... I compared that site to the one that was having issues with EMP. The differences that I saw were that on the site that's having the jQuery Scrolling Sideboxes issue:
- The console-log shows mixed-content loading blocked on a couple of .woff files.
- There's a stray </div> just above the parse-time-display HTML comment
My best guess is that both of those are playing into the root-cause of the site's issue.
-
Re: jQuery Scrolling Sideboxes [Support Thread]
Turns out the stray div ships out-of-the-box in the responsive classic template. Both sites had it as both cloned the responsive_classic before modification.
I'll investigate the other further.
-
Re: jQuery Scrolling Sideboxes [Support Thread]
Quote:
Originally Posted by
dbltoe
Turns out the stray div ships out-of-the-box in the responsive classic template. Both sites had it as both cloned the responsive_classic before modification.
I'll investigate the other further.
:blush:
Turns out the extra </div> was actually the closing div for the MainWrapper. Might need it there after all. Continuing the look.
-
Re: jQuery Scrolling Sideboxes [Support Thread]
I've just submitted v2.1.0 to be reviewed by the plugin moderators and will post back when it's available for download (https://www.zen-cart.com/downloads.php?do=file&id=1909).
This version "refactors" the plugin's files per PSR2 styling and provides additional "sanitization" needed for more recent versions of PHP and MySQL and is compatible with Zen Cart 1.5.5 and 1.5.6 variants.
-
Re: jQuery Scrolling Sideboxes [Support Thread]
Could be a glitch in includes/modules/sideboxes/specials_scrolling.php. Am getting
Code:
[26-Apr-2019 20:38:34 UTC] PHP Parse error: syntax error, unexpected '{' in /home/******/public_html/155_new/includes/modules/sideboxes/specials_scrolling.php on line 10
[26-Apr-2019 20:38:34 UTC] Request URI: /155_new/index.php?main_page=index, IP address: 216.177.186.199
--> PHP Parse error: syntax error, unexpected '{' in /home/******/public_html/155_new/includes/modules/sideboxes/specials_scrolling.php on line 10.
-
Re: jQuery Scrolling Sideboxes [Support Thread]
Quote:
Originally Posted by
dbltoe
Could be a glitch in includes/modules/sideboxes/specials_scrolling.php. Am getting
Code:
[26-Apr-2019 20:38:34 UTC] PHP Parse error: syntax error, unexpected '{' in /home/******/public_html/155_new/includes/modules/sideboxes/specials_scrolling.php on line 10
[26-Apr-2019 20:38:34 UTC] Request URI: /155_new/index.php?main_page=index, IP address: 216.177.186.199
--> PHP Parse error: syntax error, unexpected '{' in /home/******/public_html/155_new/includes/modules/sideboxes/specials_scrolling.php on line 10.
Of course, I validated each of these ... except the specials. I'll get another point-release going. Thanks, as always, for keeping me honest.
-
Re: jQuery Scrolling Sideboxes [Support Thread]
I've just submitted v2.1.1 for review, correcting that parse-error introduced in v2.1.0.
-
Re: jQuery Scrolling Sideboxes [Support Thread]
Was just hoping the new files would cure the non-changing images on one site. Will try the new file.
I'm sure you don't get told enough how those of us ZCers appreciate your work on our behalf.
Used to have a sign on my desk that said, "Pobody's Nerfect!" It's my mantra!
-
Re: jQuery Scrolling Sideboxes [Support Thread]
No more errors but, the images still do not change.:frusty:
Think I'll be going to a new install test site.
-
Re: jQuery Scrolling Sideboxes [Support Thread]
Quote:
Originally Posted by
dbltoe
No more errors but, the images still do not change.:frusty:
Think I'll be going to a new install test site.
Make sure that the jscript_side_box_slider.js is present in the site's active template's /jscript sub-directory and that there are no console-logs (indicating that there's a jQuery conflict/issue).
-
Re: jQuery Scrolling Sideboxes [Support Thread]
Seems that there is a php error in putting the new files together. Includes/templates/template_default/sideboxes/tpl_specials_scrolling.php line 16
Code:
$content .= '<a href="' . zen_href_link(zen_get_info_page($ss_pid), 'cPath=' . zen_get_generated_category_path_rev($scrolling_specials->fields["master_categories_id"]) . "&products_id=$ss_pid"]) . '">' . zen_image(DIR_WS_IMAGES . $scrolling_specials->fields['products_image'], $ss_pname, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT);
should be
Code:
$content .= '<a href="' . zen_href_link(zen_get_info_page($ss_pid), 'cPath=' . zen_get_generated_category_path_rev($scrolling_specials->fields["master_categories_id"]) . ["&products_id=$ss_pid"]) . '">' . zen_image(DIR_WS_IMAGES . $scrolling_specials->fields['products_image'], $ss_pname, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT);
-
Re: jQuery Scrolling Sideboxes [Support Thread]
The above gets the images to change on a new install with demo items. I get the exact same console readings from the new and the old although the old never changes the image. :frusty:
I'll slowly add other mods to see when it breaks.
-
Re: jQuery Scrolling Sideboxes [Support Thread]
Actually, the change should be to remove those brackets:
Code:
$content .= '<a href="' . zen_href_link(zen_get_info_page($ss_pid), 'cPath=' . zen_get_generated_category_path_rev($scrolling_specials->fields['master_categories_id']) . "&products_id=$ss_pid") . '">' . zen_image(DIR_WS_IMAGES . $scrolling_specials->fields['products_image'], $ss_pname, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT);
This is staged on the plugin's GitHub repository for a v2.1.2 release.
-
Re: jQuery Scrolling Sideboxes [Support Thread]
I've just submitted v2.1.2 to the Zen Cart Plugins for review, correcting the issue that @dbltoe identified in post #56. I'll update this thread when the plugin is available for download.
-
Re: jQuery Scrolling Sideboxes [Support Thread]
Quote:
Originally Posted by
lat9
I've just submitted v2.1.2 to the Zen Cart Plugins for review, correcting the issue that @dbltoe identified in post #56. I'll update this thread when the plugin is available for download.
Now available for download: https://www.zen-cart.com/downloads.php?do=file&id=1909
-
Re: jQuery Scrolling Sideboxes [Support Thread]
Hello!
Small typo (pname/name) in tpl_best_sellers_scrolling.php:
Code:
$bss_pname = $best_sellers_scrolling->fields['products_name'];
(...)
$content .= "<br />#$count: $bss_name</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
-
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.
-
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
-
Re: jQuery Scrolling Sideboxes [Support Thread]
Quote:
Originally Posted by
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
-
Re: jQuery Scrolling Sideboxes [Support Thread]
Quote:
Originally Posted by
lat9
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
-
Re: jQuery Scrolling Sideboxes [Support Thread]
Quote:
Originally Posted by
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.
Quote:
Originally Posted by
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.
-
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):
Code:
$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):
Code:
$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:
Code:
define('BOX_HEADING_REVIEWS_SCROLLING', 'Reviews');
-
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.
-
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):
Code:
$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";
-
Re: jQuery Scrolling Sideboxes [Support Thread]
Ok, managed to solve one of the above queries, No. 1:
I changed the PHP code to this:
Code:
$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.
-
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.
Code:
// 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
-
Re: jQuery Scrolling Sideboxes [Support Thread]
Quote:
Originally Posted by
rlexyd
I managed to stop the above Error log generating by commenting out the following line in /includes/modules/sideboxes/reviews_scrolling.php.
Code:
// 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:
Code:
if (isset($_GET['products_id'])) { $scrolling_review_sql .= " and p.products_id = '" . (int)$_GET['products_id'] . "'"; }
-
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:
Code:
$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:
Code:
$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:
Code:
define('BOX_HEADING_REVIEWS_SCROLLING', 'Reviews');
-
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.
-
Re: jQuery Scrolling Sideboxes [Support Thread]
Quote:
Originally Posted by
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.
-
Re: jQuery Scrolling Sideboxes [Support Thread]
Quote:
Originally Posted by
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.
-
Re: jQuery Scrolling Sideboxes [Support Thread]
-
Re: jQuery Scrolling Sideboxes [Support Thread]
Quote:
Originally Posted by
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.
-
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.
-
Re: jQuery Scrolling Sideboxes [Support Thread]
Quote:
Originally Posted by
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.