Upgrading to v1.5.6c - Wondering what jQuery is used for on catalog side
Morning everyone.
I'm in the final stages of testing my template after upgrading my store from 1.5.1 to 1.5.6.c
As far as I can tell, everything on the catalog & admin side is running perfectly & without any debug errors when using my own migrated template.
When comparing my own html_header.php in my templates overrides to the one now bundled with template_default I can see that jQuery is now included on the catalog side as follows:-
Code:
<script type="text/javascript">window.jQuery || document.write(unescape('%3Cscript type="text/javascript" src="https://code.jquery.com/jquery-3.4.0.min.js" integrity="sha256-BJeo0qm959uMBGb65z40ejJYGSgR7REI4+CW1fNKwOg=" crossorigin="anonymous"%3E%3C/script%3E'));</script>
<script type="text/javascript">window.jQuery || document.write(unescape('%3Cscript type="text/javascript" src="<?php echo $template->get_template_dir('.js',DIR_WS_TEMPLATE, $current_page_base,'jscript'); ?>/jquery.min.js"%3E%3C/script%3E'));</script>
I've not included these lines myself as I already use jQuery on my template for mobile menus etc. I self host & keep up to date my own jquery.min.js and I currently run 3.4.1
My question is, what is jQuery included for on a stock catalog? What functionality does it bring in the latest versions to the catalog side? I'm asking this in case I need to add in any jquery calls anywhere in my template files to support anything such as form validation or other functionality.
If anyone knows what jquery is utilized for on a standard catalog I'd love to know, it will help me immensely with making sure my template is fully compatible.
Thanks
Re: Upgrading to v1.5.6c - Wondering what jQuery is used for on catalog side
In 1.5.4, the config PADSS_AJAX_CHECKOUT was added, and jQuery is used with that. But you may use it whereever you want; lots of mods make use of it.
Re: Upgrading to v1.5.6c - Wondering what jQuery is used for on catalog side
While I haven't tried running without jQuery, I thought that added features such as the use of zcAjax used jQuery allowing/offering compatible Ajax operations which may be included in plugins but are becoming more and more a part of the core operation then various form verifications at least use javascript if not jQuery which may mmakethe associated javascript available.
Re: Upgrading to v1.5.6c - Wondering what jQuery is used for on catalog side
jQuery is also used by the responsive classic template for various effects.
Re: Upgrading to v1.5.6c - Wondering what jQuery is used for on catalog side
Thanks for your help folks.
My migrated template was based on the old Responsive Avonlee template but I've heavily modified it. I like to keep my websites as light as possible, so don't use sliders or any fancy JavaScript effects on page.
My migrated template already uses jQuery for various things including my mobile dropdown menu & I've always called it in the html_header.php in the following way :-
Code:
<script src="jquery.min.js" type="text/javascript"></script>
I keep my own self hosted jquery.min.js file up to date (currently using 3.4.1) & prefer not to serve code from third parties were at all possible, so I've removed the following code from my header so as not to double up on jQuery with two different versions.
Code:
<script type="text/javascript">window.jQuery || document.write(unescape('%3Cscript type="text/javascript" src="https://code.jquery.com/jquery-3.4.0.min.js" integrity="sha256-BJeo0qm959uMBGb65z40ejJYGSgR7REI4+CW1fNKwOg=" crossorigin="anonymous"%3E%3C/script%3E'));</script>
<script type="text/javascript">window.jQuery || document.write(unescape('%3Cscript type="text/javascript" src="<?php echo $template->get_template_dir('.js',DIR_WS_TEMPLATE, $current_page_base,'jscript'); ?>/jquery.min.js"%3E%3C/script%3E'));</script>
Everything seems to be working as expected & I like serving my own jquery.min.js from my own server as I can set a longer expires header for javascript served from my own domain using .htaccess, speeding up repeat visits for my users.
I've tested everything I can since removing the two stock lines and just serving jquery the same way I always have & everything seems to be working as expected.
Thanks so much for the clarification.
Re: Upgrading to v1.5.6c - Wondering what jQuery is used for on catalog side
Say .... you seem like you might be just the kind of person who could write a FAQ on template customization for the development documentation! :)
Take a look at https://github.com/zencart/documentation
The article would go under
https://docs.zen-cart.com/dev/code/