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.

Hiding custom coupon script on checkout cancel/balance due pages?

MindSculptMindSculpt Member
in Bugs & Feature Requests edited February 2012
I'm currently using the custom coupon code here in my checkout template:

I've noticed however that the coupon field of course will be added to all checkout pages, and it shouldn't really appear on a cancellation page or a balance due page. Is there something I can check for in the DOM that's specifically related to those two checkout page instance types? Something like a 'if cancel order class is found, hide the coupon' type condition. Thoughts?
  • sparkwebsparkweb Member, Integration Developer, FoxyShop, Order Desk
    I'd look in the page source for those pages for the fc.checkout.config (I think this is what it's called) string. This is the JSON which you can check against and it has all the trx information including which "product" is being checked out with.
  • @sparkweb I'm not using any JSON in my implementation, do you have an example of what that check might look like?
  • sparkwebsparkweb Member, Integration Developer, FoxyShop, Order Desk
    Look at the compiled source of a checkout page and you'll see that there is JSON on that page. That's how the FoxyCart javascript manages the page. You can tap into that JSON very easily as well.
  • fc_adamfc_adam FoxyCart Team

    For a bit of information on the JSON object, take a look at, and as sparkweb said, you can review it on the compiled checkout page source - you'd be looking for 'fc_json' to see it in the source. To check what the checkout is currently doing, you'd want to check the fc_json["messages"] part, probably particularly fc_json["messages"]["warnings"].
Sign In or Register to comment.