lat9 / jquery_scrolling_sideboxes Goto Github PK
View Code? Open in Web Editor NEWjQuery Scrolling Sideboxes for Zen Cart
License: GNU General Public License v2.0
jQuery Scrolling Sideboxes for Zen Cart
License: GNU General Public License v2.0
<!DOCTYPE html> <html dir="ltr" lang="en"> <head> <meta charset="utf-8" /> <title>jQuery Scrolling Sideboxes for Zen Cart®</title> <style> <!-- a, a:active, a:visited { color: #006666; text-decoration: none; } a:hover { color:#00CC99; text-decoration: underline; } body, p, h1, h2, h3, h4, h5, h6, li, td, dd, dt { font-family: Verdana, AvantGarde, Tahoma, Arial, sans-serif; font-size: 10pt; color: black; padding: 0px; margin: 20px; } pre { margin: 20px; } H1, H2, H3, H4 { font-weight: bold } h1 { font-size: 20px; } h2 { font-size: 16px; } ol li, ul li { margin: 5px 0; } .corefile, .impt { color: red; } img { margin-left: 20px; max-width: 95%; } .removed { text-decoration: line-through; } --> </style> </head> <body> <h1>jQuery Scrolling Sideboxes — for Zen Cart v1.5.5 and later</h1> <h3>Version 2.1.3, by lat9</h3> <p>Current Support Thread at Zen Cart Forums: <a href="https://www.zen-cart.com/showthread.php?214591" target="_blank">https://www.zen-cart.com/showthread.php?214591</a></p> <hr /> <h2>What it does</h2> <p>This plugin provides four (4) additional sideboxes to your store's configuration:</p> <ol> <li>sideboxes/best_sellers_scrolling.php</li> <li>sideboxes/featured_scrolling.php</li> <li>sideboxes/specials_scrolling.php</li> <li>sideboxes/whats_new_scrolling.php</li> </ol> <p>In each case, the sidebox is <em>heavily</em> modelled after the built-in Zen Cart sidebox of a similar name with one difference: each sidebox uses some jQuery to show one product at a time in the sidebox, cutting down on the screen "real-estate" required.</p> <p><strong>Note:</strong> Starting with v2.0.0 of the plugin, your active template <em><b>must</b></em> load a version of jQuery for the plugin to properly operate!</p> <hr /> <h2>Installation</h2> <p>This plugin currently has no <span class="corefile">core-file overwrites</span>; you should <strong>always</strong> backup your cart's database and files prior to making any changes.</p> <ol> <li>Unzip the plugin's package file, which you've most likely already done if you're reading this!</li> <li>Copy the contents of the /includes/templates/YOUR_TEMPLATE/jscript directory to the like-named subdirectory for your store's active template:<ol> <li>/includes/templates/YOUR_TEMPLATE/jscript/jscript_sidebox_slider.js</li> </ol></li> <li>Copy the plugin's <em>new</em>, default files to your store's file system.<ol> <li>/includes/languages/english/extra_definitions/scrolling_sideboxes.php</li> <li>/includes/modules/sideboxes/best_sellers_scrolling.php</li> <li>/includes/modules/sideboxes/featured_scrolling.php</li> <li>/includes/modules/sideboxes/specials_scrolling.php</li> <li>/includes/modules/sideboxes/whats_new_scrolling.php</li> <li>/includes/templates/template_default/jscript/jscript_sidebox_slider.js</li> <li>/includes/templates/template_default/sideboxes/tpl_best_sellers_scrolling.php</li> <li>/includes/templates/template_default/sideboxes/tpl_featured_scrolling.php</li> <li>/includes/templates/template_default/sideboxes/tpl_specials_scrolling.php</li> <li>/includes/templates/template_default/sideboxes/tpl_whats_new_scrolling.php</li> </ol></li> <li>Log into your Zen Cart admin and use the <em>Tools->Layout Boxes Controller</em> to enable and position the sideboxes for your store's use.</li> </ol> <hr /> <h2>Version History</h2> <ul> <li>v2.1.3, 2021-01-13 (lat9)<ul> <li>BUGFIX: Correct variable usage in best_sellers_scrolling sidebox.</li> <li>The following files were changed:<ol> <li>/includes/templates/template_default/sideboxes/tpl_best_sellers_scrolling.php</li> </ol></li> </ul></li> <li>v2.1.2, 2019-06-01 (lat9/dbltoe)<ul> <li>BUGFIX: Correct (another) PHP parse error, introduced in v2.1.0.</li> <li>The following files were changed:<ol> <li>/includes/templates/template_default/sideboxes/tpl_specials_scrolling.php</li> </ol></li> </ul></li> <li>v2.1.1, 2019-04-27 (lat9)<ul> <li>BUGFIX: Correct PHP parse error, introduced in v2.1.0.</li> <li>The following files were changed:<ol> <li>/includes/modules/sideboxes/specials_scrolling.php</li> </ol></li> </ul></li> <li>v2.1.0, 2019-04-26 (lat9)<ul> <li>CHANGE: Refactoring for PSR2 and more strict PHP/MySQL versions.</li> <li><em>All</em> of the files were updated!</em></li> </ul></li> <li>v2.0.0, 2017-07-23 (lat9)<ul> <li>BUGFIX: Distribute jQuery handler for YOUR_TEMPLATE use.</li> <li>CHANGE: Remove the jQuery loader from this plugin; the store's active template is <em>assumed</em> to include a jQuery load as part of its processing.</li> <li>CHANGE: Drop support for Zen Cart versions prior to 1.5.5.</li> <li>The following files were added or <span class="removed">removed</span>:<ol> <li>/includes/templates/YOUR_TEMPLATE/jscript/jscript_sidebox_slider.js</li> <li><span class="removed">/includes/templates/template_default/jscript_jquery_cdn.js</span></li> </ol></li> </ul></li> <li>v1.1.0, 2014-09-23 (lat9): Added best_sellers_scrolling<ol> <li>/includes/languages/english/extra_definitions/scrolling_sideboxes.php</li> <li>/includes/modules/sideboxes/best_sellers_scrolling.php</li> <li>/includes/templates/template_default/sideboxes/tpl_best_sellers_scrolling.php</li> </ol></li> <li>v1.0.0, 2014-09-13 (lat9): Initial release.</li> </ul> </body> </html>
As reported on the forums:
[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.
... as reported in this Zen Cart support-thread posting.
I'm working on the same thing in 1.5.8 but really like to use this mod instead of the norm and think it should be built-in.
Because of the close proximity of the Image and the Title, using the Title of the item for an alt tag results in a minor hit for accessibility.
With the main information being in the Title of the item, I think accessibility can be better met by making the alt tag for the image blank and setting the role to presentation.
<img src="images/product1.jpg" alt="" role="presentation" title="Product 1" width="100" height="75"
I use the example with both the empty alt and role setting as this would make it compatible with all browsers and readers.
I wish I were able to submit proposed fille changes but, it's just not in my level of expertise. Hopefully, this will explain what might be done to make the mod even better.
While some would remove the H and W for CSS, this also tells the browser that the item is presentational and is ALWAYS overwritten by any CSS setting(s) made.
... to actually enable/place the sidebox into the store's display.
Refactor the plugin's files to conform with the PSR2 formatting.
As noted by @dbltoe on the ZC forums, the jQuery portion of the plugin must reside in the store's active template's /jscript folder; if that folder is present for the template-override, none of the template_default files will be pulled in.
Most of the current templates already include a form of jQuery, making the jQuery-load if not present redundant (and unwanted).
As such, that script will be removed from this plugin's distribution.
See #8.
The four sidebox files in includes/templates/template_default/sideboxes all have <script type="text/javascript">
around line 22 which needs to change to <script>
in order to validate.
Add a best-sellers sidebox, including the product's image.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.