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.

receipt revisit

I'd like to conditionally hide portions of my receipt template if there is no receipt ID, such as in the case of a browser refresh on a receipt page.

is there a parameter passed to the template that would allow me to do this? I dont mind showing my customers the receipt expired message, but I think showing the rest of the receipt template with empty/missing stuff looks ugly and I'd like to just hide it when this happens.

alternatively a javascript option where I could set the display to none would work too, just let me know if that would be possible if the template param isn't an option

  • fc_adamfc_adam FoxyCart Team

    Good question. You could add some custom styles to your receipt to customise it as needed, you'd obviously want to it conditionally in just those cases. If you set the following within the footer textarea of the custom code configuration option - that should only execute in those instances:
    {% if context == "receipt" and transaction_id == 0 %}
    <style type="text/css">

    {% endif %}
    That needs to be in the footer as we don't support executing Twig in the header textarea currently. If you'd prefer to keep your styles in the head - you could do that, and add a class to the body using javascript in the footer within that conditional, which your CSS can then use to be limited.
Sign In or Register to comment.