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.

Help with footer script

oskayoskay Member
Hey there,
I'm trying to implement the "Remove days timeframe from USPS rates" sample code snippet, and I must be doing something wrong, because it isn't working. Hopefully, you can point me in the right direction. This is on a test store running 2.0.

The sample code is from here: https://wiki.foxycart.com/v/2.0/snippets/remove_usps_day_timeframe_label

The instructions there say:
Paste the following code in the “footer” option of the “inject custom code” template configuration option in your store's administration, or alternatively paste at the very end of the cart include template (not the cart or checkout templates):
There is no longer anything called "inject custom code" (at least, that I can see), but it appears that the new "custom header and footer code" section
(Templates > Configuration > Cart > Add custom header and footer code to your templates > custom footer) is supposed to fill that role. I've pasted the code there.

( I have not tried this on the "cart include template" -- I have not written one, and the documentation suggests that using one is well above my js level.)

The instructions further say that:
Any JavaScript snippets or conversion scripts you need to add to the footer can be put here and will be inserted before the </body> tag.[...]
That does appear to be true in the cart-- the script appears down by the </body> tag, and the script does work in the sidecart.

However, the script does not appear to be working on my checkout page. The script appears in the page source not at the bottom with the </body> tag, but higher up, escaped as CDATA, and the custom code does not appear to be executing. Can you help me figure out what I'm doing wrong? Thanks!
Comments
  • fc_adamfc_adam FoxyCart Team
    @oskay,

    Happy to help. Could you whisper me your store domain please?
  • oskayoskay Member
    I found the issue, which is that I neglected to include the "Optional - Include Custom Code Placeholders." All my fault -- Docs are here, for anyone searching for this later:
    https://wiki.foxycart.com/v/2.0/templates/intermediate-automagicache

    A suggestion, though: Please consider adding a note on the individual snippet pages that they will only work if the Custom Code Placeholders are included in the template.
  • brettbrett FoxyCart Team
    Thanks @oskay. We'll take a look at adding a note like that!
Sign In or Register to comment.