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.

The most basic feature not working! Help!

dasharddashard Member
in Help edited November 2012
OK. I successfully created a FC cart/checkout a few years back and have been through these paces, so I expected only a "get-up-to-speed" ramp in doing it again.

But I can't get this working! I have a site that only wants to process donations, and I have thus set the form to include the hidden field of :
<input type="hidden" name="cart" value="checkout">

So on "Submit" the contents should go directly to the checkout.

The page does go directly to checkout, but "Your shopping cart is empty."

I need to get this up and running ASAP (of course!) and I need to add one more feature that I cannot seem to find in the docs:

I want only one donation per visit (to avoid confusion; to avoid someone accidentally submitting 2 donations and then having to return one, etc.). So I want to be able to reset the (invisible) cart anytime anyone submits a *new* donation. Click "Submit >> Empty Cart >> Add new donation info. This keeps the workflow clean for not requiring a cart and going directly to checkout.

Can this be done and can anyone point me in the right direction as to why my form is not passing along the data? Or why Checkout is not receiving it?

Thanks in advance!

URL in question:
Will whisper the store domain…
  • sparkwebsparkweb Member, Integration Developer, FoxyShop, Order Desk
    edited November 2012
    @dashard, I think the reason that you are having a problem here is that your radio buttons are the same name as your custom-price field and it's overwriting the values. I would rename those radio buttons to be x:price-selection. Then use jQuery to target
    $("input[name=x:price-selection]").click(function() {
    if ($(this).val() == "other") $("#input_donation_amt").val("");

    This will use the price field as the ONLY one. You might also want a little bit of submit logic that won't let them check out if the price field is empty.

    Try adding this to your form:
    <input type="hidden" name="empty" value="true">

    And it will empty the cart before adding the product and checking out.

    EDIT: That code I wrote has not been tested so I may have made some silly error.
  • lukeluke FoxyCart Team
    @dashard, please let us know if you need further assistance.

    Thanks @sparkweb!
  • Wow. Duh.

    Fixed the glitches in @sparkweb 's code and, yes, this works. One item named 'price' and values being passed to it. Hopefully client will not object to that, as there's a visual element to updating the input, but it works.

    Nicely done, and thank you thank you thank you @sparkweb for the very fast reply, which had the added bonus of being correct!

    Now to styling the checkout.

    Hey, by the way, I am seeing a floated div issue going on with the checkout page where the contents of the cart/checkout extend past the bottom of the white box. Any fix for that, since that code is all generated automagically?
  • sparkwebsparkweb Member, Integration Developer, FoxyShop, Order Desk
    I expect it's just a CSS issue that you can adjust while editing your template. You might try setting a clearing div at the bottom or putting clear: both on the parent container.

    Also, in FF I noticed that I can't get access to the Custom Price Field. I think it's because it's in a label. Every time I click in the focus jumps out.

    To fix the viewing thing, you could just hide the price donation field until the "Other" is selected.
  • fc_adamfc_adam FoxyCart Team
    If you're wanting to hide the price input unless 'other' is selected, we have a little snippet that should get you started on that:
  • If anyone is out there, having a seriously difficult time styling the checkout. Seems to be all sorts of height issues and I can't pin down what the issue is. (And it worked so well in the screencast! ;-)

    If you take a look at this link you will see that the heights of the various 'container' elements are all crammed. Other than assigning heights to each (and that doesn't even seem to work at points) I'm out of ideas.

    Seen this before? At first I thought it might be a container width issue, as my site is 1160px wide. So I shrunk it to the recommended 760px width and expected everything to fall into place, but, of course, no luck.

    If you've got a minute I'd appreciate any input. Supposed to be live by morning and I'm up all night. ;-)
  • fc_adamfc_adam FoxyCart Team

    Actually that looks all good on my screen on Chrome. Nothing is breaking out of boxes or anything, and everything is nicely spaced.
  • Why thanks! (I fixed it… it's been a VERY long night!)
  • fc_adamfc_adam FoxyCart Team

    You've done a great job, your checkout template looks really nice.
  • OK -- one more question. In my customer "Thank You" email, first line reads:

    "Thank you for your donation of ^^subtotal^^ to Pull 4 Parkinson’s Foundation, Inc."

    The subtotal var is not rendering. Any ideas? I thought perhaps because we're still testing the gateway and not actually processing, but that doesn't make sense since everything else renders properly.

    Also wondering if it's because there's no shipping/tax that the subtotal is moot, but it should still render, no?

    (I keep using the word render. I could say resolve, show up, appear… you know… render!)
  • fc_adamfc_adam FoxyCart Team

    If you take a look at our wiki, that placeholder isn't actually available on the email template. As you're on 1.0 though, you can utilise Twig templating.

    Just switch ^^subtotal^^ to {{ cart_sub_total }} and you should be good to go!
Sign In or Register to comment.