The Foxy forums are on the move!

We're in the process of moving our forums over to a new system, and so these forums are now read-only.
If you have a question about your store in the meantime, please don't hesitate to reach out to us via email.

Making empty mini-cart stay on screen instead of disappearing when empty?

Under version 0.7.2 the mini-cart displayed stayed on the screen on which the code was found even when their were no items on the cart. Under 2.0 the mini-cart disappears entirely from the page.

I would like to keep the cart on the screen even when empty.

Is there a way to do this under 2.0?

I've whispered some examples of the way it was under 0.7.2 and how it is now.

Carlos

Comments
  • fc_jedfc_jed FoxyCart Team
    @carlos123

    Removing style="display: none;" in <div data-fc-id="minicart" style="display: none;"> should do the trick.
  • Thanks Jed but...well...I did a search for the code you mentioned in both the cart and cart include templates and didn't find it. Where exactly is that code?

    Carlos
  • fc_jedfc_jed FoxyCart Team
    @carlos123

    That code can be located where your minicart is implemented. I found it while browsing through the code in your website.
  • fc_adamfc_adam FoxyCart Team
    @carlos123,

    Sorry for the confusion here - to get the cart to always display, don't include the data-fc-id="minicart" on the parent element. The inclusion of that is what triggers the javascript to hide that block if the quantity is equal to 0. That is where the display none is coming from.
  • Thanks for the input Adam. My confusion had to do with not seeing the display: none in the code of the page anywhere so I still have no clue as to where or how Jed was seeing something in the code that I could not find for the life of me. But be that as it may...I will remove the data-fc-id="minicart" from the code. That's what I was after. A nice easy way to allow the mini-cart to always be visible even when there was no qty yet being ordered.

    Thanks.

    Carlos
  • fc_adamfc_adam FoxyCart Team
    @carlos123,

    The display none was being added by the FoxyCart javascript to the element with data-fc-id="minicart" on it if the quantity was 0. That's what Jed was seeing.
  • I kinda figured that but wasn't entirely sure. Maiy I ask how Jed (and Jed if you are reading this I'd like to ask you directly) saw that?

    One of the problems I have had in debugging Javascript is never being able to see the modified DOM easily and/or reliably. I am curious as to how Jed saw the modified DOM such that he saw the Javascript addition of the display: none to the dIv ID?

    Again...just curious - no need for feedback on this if you don't want to give any on this Javascript related question.

    Carlos

  • fc_adamfc_adam FoxyCart Team
    @carlos123,

    I could see it as well. Viewing source doesn't show you the altered DOM due to javascript. You need to use a browsers inspection tools to inspect the page and view it that way. That will show what the DOM looks like live.
Sign In or Register to comment.