Foxy Forum Status

We're no longer responding to questions via our forum, but we will keep it up for historical reasons. If you can't find the answer you're looking for, please visit our knowledge base or contact us. If there's enough interest in the future, we may bring the forum back.

main cart not updating in safari

maxmax Member
in Help edited January 2013

im building a store with a persistant mini cart. items are silently added to the cart and the mini-cart value is updated.
the main cart lives on its own page in an iframe.

however sometimes (in safari and mobile safari only) the main cart does not update. the min-cart acknowledges the items, but the main cart says its empty.

the one thing that seems to fix this,
1. i have 3 items in the mini-cart, but the main cart says empty
2. browsing directly to the cart page at that page says the cart is empty
3. go back to my site, and now the mini-cart is also empty.
4. then things seem to work

screenshot of items in mini cart but not main cart:

any thoughts?

thank you,

  • fc_adamfc_adam FoxyCart Team
    @max - could you upload your site online somewhere? Without actually being able to see the code it's hard to tell you what might be going on.
  • fc_adamfc_adam FoxyCart Team
    edited January 2013
    @max {in response to whisper}

    Try changing this line in your main.js file:
    jQuery.getJSON(href + '&output=json&callback=?', function(data){

    To this:
    jQuery.getJSON(href + fcc.session_get() + '&output=json&callback=?', function(data){

    And see if that fixes it.
  • maxmax Member

    thanks, but that did not fix it.
    the only thing that seems to fix it (temporarily) is to go to then go back to my store.
  • fc_adamfc_adam FoxyCart Team

    I'm unable to replicate what you're seeing at all in Safari on Windows, but I am seeing it on my iPhone. I think what's happening is that you're loading the cart in the iFrame, but you're running into a cookie/session issue where the iFrame isn't picking up the session from your site - so it's loading a blank cart. What you'll need to do is make sure that your cart iFrame source is set to include the fcsid session in it's URL.

    Essentially you would achieve it similar to how you did above - append "fcc.session_get()" onto the cart URL. That way the cart will be loaded with your current session.
  • maxmax Member
    thanks @fc_adam

    can you give me any more advice on how to append "fcc.session_get()" to the url.
    im assuming you mean i should append it to the url on the iframe (not the main windows url).
    right now the iframe is hardcoded in the page which is served via php. the iframe looks like this:
    <iframe class="cart" src=""; onLoad=";" frameborder="0"></iframe>

    it also seems odd that it is only happening some of the time in safari and mobile safari?

  • fc_adamfc_adam FoxyCart Team
    edited January 2013

    It will probably come down to how the individual browser is handling third-party cookies.

    For your iFrame - you could actually set it's src variable to blank in your PHP and then set the src in your javascript.

    So wherever your javascript dictates to load in the cart page, after it's loaded in, set the iFrame like this:
    jQuery("iframe.cart").attr("src", "https://"; + storedomain + "/cart?" + fcc.session_get());
  • thanks a lot @fc_adam

    that seems to have fixed it!

    with one edit, the forum seems to have put in an extra semicolon afters the "https://"; the the javascript!
    i tried to post the updated code here, but the semicolon is getting added in.. strange
  • fc_adamfc_adam FoxyCart Team

    Yeah that semicolon thing is from the forums - it's trying to be smart about URLS's but it gets in the way a little when it comes to code blocks.
Sign In or Register to comment.