Support Forum

  • Page:
  • 1

Suspected jTweet conflict with FoxyCart jquery...

zentoolsIf you use Zentools please post a review at the Joomla! Extensions Directory.

To troubleshoot an issue I'm having, I loaded a new install of Joomla 1.5 on a local XAMPP server. All I've installed into it is the FoxyCart integration software from www.joomextend.com , JTweet, JBFAQ and JB Library. I've tried turning off / on JB Library but I don't think I should need it. jbFAQ would seem to work just fine without it when FoxyCart is also working. jTweet works well until I add FoxyCart to the mix. I've got a question going over at there forums as well. So, jbFAQ on the same page works whether the FoxyCart is there or not. However, jTweet only seems to want to work when I the FoxyCart code is disabled.

I placed this FoxyCart code in the template (rhuk_milkyway) just before the end of the "head" which makes FoxyCart work fine. Since, jQuery 1.3.2 gets loaded by the javascript include, I thought I wouldn't need jbLibrary to do it.
<script src="mystore.foxycart.com/files/foxycart_includes.js" type="text/javascript" charset="utf-8"></script>

<script type="text/javascript" charset="utf-8"> var $j = jQuery.noConflict(); </script>

<link rel="stylesheet" href="mystore.foxycart.com/files/foxybox.css" type="text/css" media="screen" charset="utf-8" />

<link rel="stylesheet" href="mystore.foxycart.com/themes/standard/theme.foxybox.css" type="text/css" media="screen" charset="utf-8" />

Any insight appreciated.

1) Why does the jbFAQ module work while jTweet doesn't ?

2) Do the modules go about getting a reference to jquery library instance differently ?

3) If so, the jbFAQ method would seem superior ?

4) Could jTweet be modded to get the reference like jbFAQ ?

5) If so, how can I do this ?
  • MattB75's Avatar
  • MattB75
  • Previous Member
  • 4 posts
  • Karma: 0
The administrator has disabled public write access.
Hi Matt,

Basically you only need one version of jQuery loading and it needs to get loaded before all other jQuery scripts. The jTweet module loads its scripts into the head on the fly and so it comes before all template scripts are loaded and any references that might get out put in the body.

So it sounds like you have JB LIbrary loading then jTweet then Foxycart which includes a reference to the jQuery Library.

So basically if you can remove the FoxyCart reference then JB LIbrary should be able to handle everything for you. jQuery will only get loaded once and all of the other scripts will be able to use that instance of the library.

This is a bugbear I have with developers that load jQuery with their extensions ... there should be a parameter to switch the library off.

Hope that helps.

Anthony
  • Anthony Olsen's Avatar
  • Anthony Olsen
  • LIfetime Developer - Big Bamboo
  • 23925 posts
  • 788 Thanks
  • Karma: 433
The administrator has disabled public write access.
Thanks! Sadly, no option like that seems to exist at the moment.Though, I posted a question over there as well before coming here. There was an existing (potentially forgotten) thread that discussed providing a version of the foxycart includes without jQuery already added. So, I revived it and asked the status of that. I don't know what will come of it.

Until I'm able to disable the jQuery from loading in FoxyCart (i.e. doing it the right way)...

Is there a way you can suggest to get FoxyCart to load first instead ?

Would doing this in addition to also disabling JB Library be enough ?
  • MattB75's Avatar
  • MattB75
  • Previous Member
  • 4 posts
  • Karma: 0
The administrator has disabled public write access.
Hey Matt,

I had a look at the script you are using and the line
<script src="mystore.foxycart.com/files/foxycart_includes.js"  type="text/javascript" charset="utf-8"></script>

Is getting the javascript for foxycart from the file.

mystore.foxycart.com/files/foxycart_includes.js

If you view the contents of the file, you will see that it loads jQuery in addition with a lot of the other js necessary for foxycart.

You could try copying that javascript into a local js file and removing the lines
// jquery 1.1.3.1 RAW: https://admin.foxycart.com/v/0.2.5/raw/jquery.js
// note: modification made to fix safari crash: http://dev.jquery.com/changeset/2256
eval(function(p,a,c,k,e,r).....

You can then call it in your script
<script src="yoursite.com/location_to_file/altered_foxycart_includes.js"  type="text/javascript" charset="utf-8"></script>

Hope that was clear enough. Let me know if that works for you.

Cheers,
Jason.
  • Jason D's Avatar
  • Jason D
  • 6 Month Developer
  • 2957 posts
  • 12 Thanks
  • Karma: 75
The administrator has disabled public write access.
I did get jTweet to finally work again. What I did was...

I saved out the individual foxybox.js and foxycart.js individually by visiting them at their "raw" locations.

I placed them in the includes / js folder of my joomla install as it just seemed a fitting place for them.

Then I created a FoxyCart "includes module" containing the code to include both js files from the above folder. Any relevant css is still being loaded from their site. Now I was able to enable it / disable it at will from the modules manager. jbLibrary is the only thing loading jquery now.

jTweet and FoxyCart both work on the same page. So, I thought I was done.

Not quite. jbFAQ which was working before, is now the only module that I can't get to work now. It showed up in an completely expanded state (not how I have it setup) and all animation was non-functional.

However, I found that if I specifically exclude any page the FAQ module appears on from loading the FoxyCart includes, the FAQ module works properly (initially appearing collapsed with working animation) at the cost the FoxyCart being disabled for any page it inhabits.

So close, but not quite there yet. Any thoughts ?
  • MattB75's Avatar
  • MattB75
  • Previous Member
  • 4 posts
  • Karma: 0
Last Edit: 14 years 3 months ago by MattB75.
The administrator has disabled public write access.
Hey Matt,

That is very interesting. Good work on getting it working but I am not sure why JB FAQ is now having trouble. Do you have a link to your site we could look at?
If it is locked down then you could log us a support ticket and leave some login details for us there.

Cheers,
Jason.
  • Jason D's Avatar
  • Jason D
  • 6 Month Developer
  • 2957 posts
  • 12 Thanks
  • Karma: 75
The administrator has disabled public write access.
I was testing this all out on a local xampp install. In addition to jTweet working again, I then added other jquery modules that weren't working before (on the remote site) after I got things working. I was pleased to see they all work again as well.

Now that I've got it working, I'll apply the solution to the remote site. Though before I do that, I'm replacing jbFAQ with JoomlaNook's AccordionFAQ which is also jquery based and is working fine so far. Swapping out this one module is small price to pay since I don't really want to spend anymore time investigating these issues. ;-)

I've also written a "how-to", etc including all necessary files and submitted it to JoomExtend in hopes that they'll offer it to everyone / include with their existing package. FoxyCart's wiki already links back to them, so everyone should be covered. While FoxyCart's support wasn't that helpful, I still feel their cart is excellent and it works now!

So, problems are all resolved. Thanks for the assist! Until next time. :-)
  • MattB75's Avatar
  • MattB75
  • Previous Member
  • 4 posts
  • Karma: 0
The administrator has disabled public write access.
Glad things are working,
Jeremy
  • Jeremy's Avatar
  • Jeremy
  • 12 Month Developer
  • 407 posts
  • Karma: 15
The administrator has disabled public write access.

zentoolsIf you use Zentools please post a review at the Joomla! Extensions Directory.

Happy Campers