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.

How to change json scripts when upgrading

kanjigirlkanjigirl Member
in Help edited April 2011

I'm upgrading FoxyCart for a client - first from 0.6 to 0.7, then I'll deal with 0.7.1. We have two sections of custom code using json that FoxyCart support has helped us with over the last year - I don't what if anything I need to do to modify them for 0.7. Can you help? I'm not a programmer so I don't follow what's shown in the JS upgrade info page very well.

These snippets are both in checkout.html.

This was added to the head section to keep the shipping country restriction we needed from failing and has worked fine:
<script type="text/javascript" charset="utf-8">
// Ensure the GA info is in the URL //
if ( == -1 && typeof(fc_json.custom_fields['ga']) != "undefined") {
if (fc_json.custom_fields['ga'].length > 0) {
window.location.hash = fc_json.custom_fields['ga'];

This was added because we were having problems with Google Analytics integration:
<script type="text/javascript">
// Ensure the GA info is in the URL //
if ( == -1 && fc_json.custom_fields['ga'].length > 0) {
	window.location.hash = fc_json.custom_fields['ga'];
try {
var pageTracker = _gat._getTracker("UA-8921152-1");
} catch(err) {}

Can you tell me what I need to do to these to get them ready for 0.7/0.7.1?
  • lancelance Member, Community Support Member
    @kanjigirl -

    From what I can see here, the existing jQuery should work for you. The only place this touches the JSON object is where you are calling fc_json.custom_fields and that is still a valid call in 0.7.0.

  • Thank you. I did the upgrade and most things seem to be working - I submitted two tickets for the items that aren't, but they don't seem to be related to the JSON code at all.
Sign In or Register to comment.