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.

Console Errors in Checkout Cached Template

ahsodesignsahsodesigns Member
in Help edited November 2014
Hey Foxes,

We're troubleshooting some errors we're getting in the checkout cache w/ dave ( sparkweb, foxyshop, awesome ).
We've cleaned up most of them, but a few persist, Unexpected Identifier, Unexpected token ILLEGAL,
This is our first site on the new 2.0!
Here's the domain : swampsdiesel
here's the template page we're cacheing :
sample product :
let us know what we need to do,
thanks again!
  • fc_adamfc_adam FoxyCart Team

    Taking a quick look at your template, it looks like the javascript template rendering has a couple pieces of information that include quotations that aren't being escaped properly. We'll look into that and get back to you as soon as we can.

    One thing I just noticed looking into this I'll quickly mention - you have a jQuery include on your checkout template which you don't need to be there. We automatically include jQuery for you on the FoxyCart templates - so you'll want to remove the javascript link element that links to "jquery-latest.min.js?ver=4.0"
  • awesome! thanks, we've got that extra jquery outta there.
  • Hey, just checking back in after the weekend.
    any luck ?
    no worries.
  • fc_adamfc_adam FoxyCart Team

    We have a fix for this that I believe was pushed live today. Could you try recaching your template and see if you still get the warnings please?
  • great! the js console errors are gone, however we're getting a new one :
    "Uncaught TwigException: Unable to find closing bracket '{% endraw %}' opened near template position 1648 "
    I can verify the {% endraw %} tag has been included in our template here :
    Let us know what we need to do to fix.
  • fc_adamfc_adam FoxyCart Team

    Could you clarify how you're getting that error to trigger? I just tested out your template and didn't see that error trigger at all.
  • Ah, i should have specified,
    I can verify the tag has been added properly to the template on our end.
    but when we cache it and visit the checkout on
    we get the Uncaught TwigException error.
  • fc_adamfc_adam FoxyCart Team

    Ah yes, I see it now - thanks for clarifying. We'll take a look and see what's up there.
  • Hey, how goes it ?
    Just checking back in after the weekend, any updates ?
  • fc_adamfc_adam FoxyCart Team

    We have it ticketed on our side and have been looking into it - but no resolution just yet. We'll update this thread when we do. Thanks for checking in!
  • fc_adamfc_adam FoxyCart Team

    Sorry for the delay in responding. We rolled out some fixes earlier but I forgot to follow up with you. Testing your checkout, I see the raw tags are still present, but the error is no longer presenting after our fixes were added. Could you confirm that you're no longer receiving them as well please?
  • We are good to go on our end. no errors, thanks again!
  • I am running into this issue currently myself. I cannot seem to pass simple HTML in a hidden <textarea> for rendering as HTML in the email receipt. This technique works in v1.1 and lower, so I suspect the Twig / Twig.js is at play here.

    My approach was to wrap the contents in {% raw %}:
    <textarea name="HTML" style="display:none">
    {% raw %}<b>I am bold, in your email</b>{% endraw %}
    The Checkout template caches fine, but renders with the following error in the console:

    Uncaught TwigException: Unable to find closing bracket '{% endraw %}' opened near template position

    Any thoughts on how to resolve?
  • fc_adamfc_adam FoxyCart Team

    Just to make sure we understand - could you clarify why you're passing HTML via a text area on the checkout to the receipt?
  • pixelchutespixelchutes Member
    edited January 2015

    I was able to resolve this issue (no {% raw %} required) by changing to the following in the receipt twig: {{ custom_field.value | raw }}
Sign In or Register to comment.