Zen Cart Logo
Forums / All Other Contributions/Addons / Manufacturer Carousel

Manufacturer Carousel

Views: 1,045

Results 1 to 5 of 5
24 Aug 2016, 11:52 AM
#1
mikeyg avatar

mikeyg

Totally Zenned

Join Date:
May 2005
Posts:
515
Plugin Contributions:
0

Manufacturer Carousel

I have installed this on my front page of a test server and it works fine. manufacturer logo's show up and scroll through. However all other carousels on my front page (featured/ new/ specials) are not working now.

The template is the tableau version and the carousel for the featured/new/specials etc is the one that came with that.

My assumption is therefore a jscript clash, but as a non-programmer not sure how I resolve.

I have the JS./CSS loader installed and I thought that was designed to help avoid these clashes so how do I resolve. What do I need to look for to help me start.

Thank you in advance for any help.

Best Regards

MG

24 Aug 2016, 12:39 PM
#2
design75 avatar

design75

Totally Zenned

Join Date:
Dec 2009
Location:
Amersfoort, The Netherlands
Posts:
2,862
Plugin Contributions:
5

Re: Manufacturer Carousel

The clashes are only avoided if all scripts are loaded through the loader. Chances are you have some scripts still being loaded via the "jscript_" function, or by hard coded paths.

24 Aug 2016, 1:48 PM
#3
mikeyg avatar

mikeyg

Totally Zenned

Join Date:
May 2005
Posts:
515
Plugin Contributions:
0

Re: Manufacturer Carousel

Design75,

thank you for the reply.

I can see that the template has this code near the start of the file:

<script src="//code.jquery.com/jquery-1.11.0.min.js"></script> <script src="//code.jquery.com/jquery-migrate-1.2.1.min.js"></script> <script src="<?php echo $template->get_template_dir('',DIR_WS_TEMPLATE, $current_page_base,'jscript/jquery'); ?>/manufacturers_carousel.min.js"></script>

So: I thought if I understood this correctly. I have these files in mytemplate/jscript/jquery folder already. If I remove this code will they be loaded automatically anyway by the JS/CSS loader.

But still seems to be an error with the first product slider not working properly.

How do I get these to load correctly and not conflict?

Chromes developer tools give me errors:

Uncaught TypeError: $ is not a function

Uncaught TypeError: Cannot read property 'jPanelMenu' of undefined

Again thank you in advance for any advice to clear this up.

Best Regards

MG

24 Aug 2016, 4:18 PM
#4
design75 avatar

design75

Totally Zenned

Join Date:
Dec 2009
Location:
Amersfoort, The Netherlands
Posts:
2,862
Plugin Contributions:
5

Re: Manufacturer Carousel

If you post a link to your site it is easier to help.

24 Aug 2016, 9:12 PM
#5
mikeyg avatar

mikeyg

Totally Zenned

Join Date:
May 2005
Posts:
515
Plugin Contributions:
0

Re: Manufacturer Carousel

Design75

Thank you once again for your help. Site is currently localhost. But you earlier pointer has led me to work out a solution and allowed my to have a better understanding of zc.

For the benefit of others who might want to install and had an issue this this is what I have done. If there is any error that I might not have spotted please let me know.

First I have changed the query in line 3 of the file includes\templates\YOUR_TEMPLATE\templates\tpl_manufacturers_carousel.php

I have added a "where m.manufacturers_image is not null" This means if you do not have a manufacturer logo then it will not show a blank or no picture available image. (I seemed to have a few.)

 

 $manufacturers_query = "select m.manufacturers_id, m.manufacturers_name, m.manufacturers_image, mi.manufacturers_url
    from " . TABLE_MANUFACTURERS . " m
    left join " . TABLE_MANUFACTURERS_INFO . " mi on m.manufacturers_id = mi.manufacturers_id where m.manufacturers_image is not null 
    order by manufacturers_name";  

I have then deleted the following lines of code from line 12 to line 14

<script src="//code.jquery.com/jquery-1.11.0.min.js"></script> <script src="//code.jquery.com/jquery-migrate-1.2.1.min.js"></script> <script src="<?php echo $template->get_template_dir('',DIR_WS_TEMPLATE, $current_page_base,'jscript/jquery'); ?>/manufacturers_carousel.min.js"></script>

and also in line 27 I removed:

<?php require($template->get_template_dir('manufacturers_carousel.php',DIR_WS_TEMPLATE, $current_page_base,'jscript/jquery'). '/manufacturers_carousel.php');?>

I have then edited mytemplate\auto_loaders\loader_index.php

I added at line 36

'jquery/manufacturers_carousel.js' => 9,
'jquery/manufacturers_carousel.min.js' => 10,
'jquery/manufacturers_carousel.php' => 11,

I already seemed to have a copy of the "code.jquery.com/jquery-1.11.0.min.js" but guess if you do not then you need to copy the file. This seemed to resolve the conflict with the Jquery and with a bit of tweaking of the css file now seems to be working.

If anyone else thinks I have missed anything then please let me know.

As a definite "non-programmer" it is possible I have missed something.

But I hope this helps some one.

Best wishes

MG