JQuery in v1.1 checkout?

GeoffreyGeoffrey Member
in Help edited February 2014
So I'm playing around with version 1.1 on a side project right now, and when I tried to port over the checkout template I created for Verdant into v1.1 (from v0.7.2), none of the jQuery calls work. Do you have to do something differently in v1.1 to make jQuery calls work? In v0.7.2, stuff like this just works:
$('caption').hide();

But not so in v 1.1. What do I need to change?
Comments
  • fc_adamfc_adam FoxyCart Team
    @Geoffrey,

    At a guess - I'd say that the way you have your <head> section ordered is causing some of your javascript to be included before jQuery is included. If you look at the source of the rendered template, check where your jQuery dependant scripts are and where the checkout's jQuery include is placed. It's automatically included right after the last style block or the title tag, whatever is last in the DOM. So if you have some style blocks after your script blocks, jQuery will be included after your scripts which can cause issues.

    If that's not it, if you could give us steps to replicate, we can take another look for you.
  • Thanks Adam. That wasn't the problem, as my script block is at the end of the template file. I did get things to work though, by just taking it all out and starting from scratch to insert the jQuery calls piece by piece. There must have been something wonky in my previous template that 0.7.2 was more tolerant of. I'll see if I can resolve this myself.
  • fc_adamfc_adam FoxyCart Team
    @Geoffrey,

    Ok - glad to hear you got things working. There may be an incompatability issue between the jQuery version of 0.7.2 and 1.1 - they made quite a few breaking changes between the versions used on those versions of FoxyCart.
Sign In or Register to comment.