Double IFRAME

bistrostudiosbistrostudios Member
in Bugs & Feature Requests edited October 2010
Hi guys,

Using 070 - and I just implemented colorbox as well. Issue is:
Add a product to cart
Close cart
Add same product to cart
Renders two iframes - so now cart has scroll bar and you can actually see two carts.

All other links to the cart are working fine - one iframe only.

Anyone seen this?

Thanks, Thanks,
eric
Comments
  • lukeluke FoxyCart Team
    edited October 2010
    Part of the problem might be that you're including jQuery here:
    <script language="javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>;
    
    But that's also already included here:
    <script src="http://cdn.foxycart.com/secure.trespropaganda.com/foxycart.complete.js"; type="text/javascript" charset="utf-8">
    
    If you move the foxycart.complete.js file up above your other jquery plugins and remove that extra include of jQuery, does that help? [Edited by Brett]

    When I first read the title of this post I was like... "Wait... What? FoxyCart has double rainbows?"
  • brettbrett FoxyCart Team
    Eric, I think @fc_adam has this figured out. The issue is that when you're dynamically modifying the href's on your add-to-cart links you're stripping the fcsid on there, and the new foxycart.js (as of 0.7.0) attempts to automatically handle dynamically generated links and forms. It works really well when the link or form is actually _new_, but in your case it's not new but _modified_, and in that modification you're losing the fcsid. So onclick the foxycart.js _thinks_ that it's a new link, and fires off the Colorbox call.

    Since it's not actually a new element though, it fires twice. Once because it's _not_ a new element, and once because it thinks it is (based on the absence of an fcsid).

    @fc_adam will give a bit more info if you need help, but that's the cause (we're pretty sure, at least). Make sense?
  • HA! Double rainbow... it's starting to look like a triple !?

    Thanks so much guys - I will look at the dynamic editing of the URL - keep that fcsid in there.

    I'll let you know how it goes..
  • That fixed it!

    Many thanks!

    eric
  • brettbrett FoxyCart Team
    Double rainbow... "WHAT DOES IT MEAN?!?!"
    That was my favorite line.
  • I am having this same issue. Is the solution to add a fcsid field to the template? Rather than have it generate dynamically? I am not sure what bistrostudios did to fix the issue.
  • designcoup - yes, attaching the correct fcsid did the trick... check out this link to read more about getting the session: (depending on your version)

    http://wiki.foxycart.com/v/0.7.1/advanced/json#important_notes_for_json_p_implementations

    also beware that i recently got the double iframe when i accidentally included the Foxy script twice.
  • designcoupdesigncoup Member
    edited December 2011
    Thanks bistro for the info, but now I am more confused than ever. Am I supposed to add the javascript on that page to my single-product template? I don't understand what it means to "dynamically modify the href". Isn't all of that handled when the function "foxyshop_start_form()" is called? Thanks for your help.

    Also, I don't see where the foxy_script is called.
  • Okay, so it seems that the issue is actually caused by conflicting references to jQuery in my header from various plugins. When I disable them, it works fine. Now I just have to figure out how to run these plugins without them calling jQuery individually.
  • sparkwebsparkweb Member, Integration Developer, FoxyShop, Order Desk
    Hi @designcoup. WordPress plugins are supposed to use the WordPress method for calling scripts (enqueuing) so that you don't run into this problem, but some plugins are a little sloppy and don't do it this way. FoxyShop definitely does it the right way, but what you can do is either 1) disable the jQuery that FoxyShop is enqueuing on the settings page or 2) find the plugin that is doing the rogue jquery include and manually disable it in the plugin's source. That gets a little messy, though. If you want to whisper me your url I can take a quick look at the source and might be able to get an idea which plugin might be throwing the extra jQuery ref in there.
  • Thanks spark. After much trial and error, I have succeeded in pinpointing the conflicts. It turns out that the jQuery Colorbox plugin was the offender. I will just find another solution for that plugin. I often use Colorbox on static sites that I have worked on, so it seemed like the obvious choice for this WP site, but it's more important that I get FoxyCart working as it should. Thanks all for your input.

    George.
  • sparkwebsparkweb Member, Integration Developer, FoxyShop, Order Desk
    PrettyPhoto is a good alternative and what FoxyShop uses for the popups on the image pages. I think there's even a WP plugin for it.

    Also, if you really want to hack jQuery Colorbox to work, I know that the colorbox in 0.7.2 has been isolated so it's easier to control without affecting all the colorboxes on the site.
  • I have decided to go with the ShadowBox plugin for my other needs. It appears to be even more flexible than the ColorBox plugin and it's working nicely with everyone else. Thanks again for your help. Hopefully this exchange will help future readers :)
Sign In or Register to comment.