[{"data":1,"prerenderedAt":4028},["ShallowReactive",2],{"header:help":3,"footer:default":67,"story:navigation\u002Fsearch:help":250,"story:help\u002Fcategories":288,"story:help\u002Fcategories\u002Fjavascript":314,"help:tree:3ec5e2da-c8cb-4271-ab65-8ee88cf158fb":340,"help:guides:3ec5e2da-c8cb-4271-ab65-8ee88cf158fb":341,"help:categories:3ec5e2da-c8cb-4271-ab65-8ee88cf158fb":342,"help:articles:3ec5e2da-c8cb-4271-ab65-8ee88cf158fb":343,"story:contact":3839,"_apollo:default":4027},{"name":4,"created_at":5,"published_at":6,"updated_at":7,"id":8,"uuid":9,"content":10,"slug":57,"full_slug":58,"sort_by_date":59,"position":60,"tag_list":61,"is_startpage":24,"parent_id":62,"meta_data":59,"group_id":63,"first_published_at":64,"release_id":59,"lang":65,"path":59,"alternates":66,"default_full_slug":59,"translated_slugs":59},"Help Center Header","2024-08-09T18:06:34.939Z","2024-10-21T21:58:39.217Z","2024-10-21T21:58:39.232Z",10082752,"3e9b88f7-c163-4657-a2f2-62532d600fad",{"_uid":11,"link":12,"badge":16,"items":17,"title":13,"buttons":50,"new_tab":24,"submenu":51,"alignment":13,"component":52,"badge_link":53,"top_menu_items":56},"e5645a1a-f991-40e8-8d67-e40ebc082b5a",{"id":13,"url":13,"linktype":14,"fieldtype":15,"cached_url":13},"","story","multilink","Help Center",[18,27,34,39,44],{"_uid":19,"link":20,"title":23,"new_tab":24,"submenu":25,"component":26},"5cbe2861-1f49-4166-97da-a4dddd8105e3",{"id":21,"url":13,"linktype":14,"fieldtype":15,"cached_url":22},"4c0a2d99-ec30-4579-8ef1-6bf5564d4839","help\u002Fcategories\u002F","Articles",false,[],"header___item",{"_uid":28,"link":29,"title":32,"new_tab":33,"component":26},"1c8edeb5-b9e9-4cb8-b1c6-c1f292f7d7cd",{"id":13,"url":30,"linktype":31,"fieldtype":15,"cached_url":30},"https:\u002F\u002Fwiki.foxycart.com\u002F","url","Documentation",true,{"_uid":35,"link":36,"title":38,"new_tab":33,"component":26},"8d7df70e-f087-4da0-b616-6f0e9a5af35c",{"id":13,"url":37,"linktype":31,"fieldtype":15,"cached_url":37},"https:\u002F\u002Fapi.foxycart.com\u002F","API Documentation",{"_uid":40,"link":41,"title":43,"new_tab":33,"component":26},"f76e7944-23d5-4652-87e4-cdae79272762",{"id":13,"url":42,"linktype":31,"fieldtype":15,"cached_url":42},"https:\u002F\u002Fstatus.foxy.io\u002F","System Status",{"_uid":45,"link":46,"title":49,"new_tab":24,"component":26},"0de16771-4c84-466c-a1da-d8568113c71f",{"id":47,"url":13,"linktype":14,"fieldtype":15,"cached_url":48},"01e4e370-f9b9-45af-8fa9-f15540699b0d","contact","Contact Us",[],[],"header",{"id":54,"url":13,"linktype":14,"fieldtype":15,"cached_url":55},"4a679eb7-662d-4ea4-a976-5a2acbf0b663","help\u002F",[],"help-header","navigation\u002Fhelp-header",null,20,[],10082747,"71b81c2e-5e09-48a1-a397-a3c72fcd344a","2022-09-21T14:50:25.655Z","default",[],{"name":68,"created_at":69,"published_at":70,"updated_at":71,"id":72,"uuid":73,"content":74,"slug":243,"full_slug":244,"sort_by_date":59,"position":245,"tag_list":246,"is_startpage":24,"parent_id":62,"meta_data":59,"group_id":247,"first_published_at":248,"release_id":59,"lang":65,"path":59,"alternates":249,"default_full_slug":59,"translated_slugs":59},"Default Footer","2024-08-09T18:06:59.024Z","2025-09-04T06:24:46.223Z","2025-09-04T06:24:46.241Z",10082753,"e59e67ac-248a-482f-84a1-53d4f318186a",{"_uid":75,"about":76,"logos":77,"socials":82,"sections":108,"component":225,"cta_title":226,"bottom_links":227,"cta_subtitle":241,"cta_button_link":242,"cta_button_text":183},"830983f5-c4c4-43c8-b150-86a5e3fa6dc8","Foxy’s hosted cart & payment page allow you to sell anything, using your existing website or platform.",[78],{"id":79,"alt":13,"name":13,"focus":13,"title":13,"filename":80,"copyright":13,"fieldtype":81},14760,"https:\u002F\u002Fa-us.storyblok.com\u002Ff\u002F1001040\u002Fx\u002F3b030847ec\u002Fb-corp.svg","asset",[83,90,96,102],{"_uid":84,"icon":85,"link":86,"name":88,"component":89},"faf0a618-ea94-42ea-9182-03be18c43216","fa-facebook",{"id":13,"url":87,"linktype":31,"fieldtype":15,"cached_url":87},"https:\u002F\u002Fwww.facebook.com\u002Ffoxycart","Facebook","footer___social",{"_uid":91,"icon":92,"link":93,"name":95,"component":89},"14309c18-7e79-423e-b375-34555bac0811","fa-instagram",{"id":13,"url":94,"linktype":31,"fieldtype":15,"cached_url":94},"https:\u002F\u002Fwww.instagram.com\u002Ffoxy_io","Instagram",{"_uid":97,"icon":98,"link":99,"name":101,"component":89},"8f7fe7cf-0dd3-4596-8334-226ea466716a","fa-linkedin",{"id":13,"url":100,"linktype":31,"fieldtype":15,"cached_url":100},"https:\u002F\u002Fwww.linkedin.com\u002Fcompany\u002Ffoxycart.com","LinkedIn",{"_uid":103,"icon":104,"link":105,"name":107,"component":89},"90a675b4-dd97-40b5-be09-00a87223d4c5","fa-youtube",{"id":13,"url":106,"linktype":31,"fieldtype":15,"cached_url":106},"https:\u002F\u002Fwww.youtube.com\u002Fuser\u002Ffoxycart","Youtube",[109,139,184,206],{"_uid":110,"name":111,"items":112,"component":138},"82849945-282f-488c-b18d-a8d2252f514a","Company",[113,120,126,132],{"_uid":114,"link":115,"title":118,"new_tab":24,"component":119},"1f699ab1-938b-4d9d-9825-aabcbe6f57fe",{"id":116,"url":13,"linktype":14,"fieldtype":15,"cached_url":117},"63634293-a749-4226-9439-9f38ee6dcda0","about-us","About Us","footer___menu_items",{"_uid":121,"link":122,"title":125,"new_tab":24,"component":119},"b26b00f1-a0e7-4be2-8ab3-428b8cc841f8",{"id":123,"url":13,"linktype":14,"fieldtype":15,"cached_url":124},"26cb7c55-faed-4a77-a291-1552d4111b3e","how-foxy-works","How Foxy Works",{"_uid":127,"link":128,"title":131,"new_tab":24,"component":119},"b40c68a0-1ceb-4226-9515-6176534f61fe",{"id":129,"url":13,"linktype":14,"fieldtype":15,"cached_url":130},"dc6657d7-7f4f-4c0d-b781-e971b038ee26","for-good","Foxy For Good",{"_uid":133,"link":134,"title":137,"new_tab":24,"component":119},"3ad0c134-bef9-4fff-b891-e09f16109036",{"id":135,"url":13,"linktype":14,"fieldtype":15,"cached_url":136},"23cae210-baf4-4588-9862-d09f4f52ccd2","brand-assets","Brand Assets","footer___section",{"_uid":140,"name":141,"items":142,"component":138},"a6805fa8-ac60-47f1-b8f0-f27aded0afbe","Product",[143,149,155,161,167,173,179],{"_uid":144,"link":145,"title":148,"new_tab":24,"component":119},"b39c8a4e-2383-486f-b76a-11fbb15d8134",{"id":146,"url":13,"linktype":14,"fieldtype":15,"cached_url":147},"bb04690f-fe98-4ce6-80be-05b950f2364f","features\u002F","Features",{"_uid":150,"link":151,"title":154,"new_tab":24,"component":119},"64f8a41f-c181-433d-bc0a-fc94e71ecbf6",{"id":152,"url":13,"linktype":14,"fieldtype":15,"cached_url":153},"c450c58d-761d-48c0-a9af-0b064611689b","pricing","Pricing",{"_uid":156,"link":157,"title":160,"new_tab":24,"component":119},"6e0b287f-fd8c-4146-9e0e-0ab0b5c9ce3c",{"id":158,"url":13,"linktype":14,"fieldtype":15,"cached_url":159},"fab20ad9-e76a-4947-b709-3a6fdfa88028","blog\u002Fcategories\u002Fproduct-updates","Product Updates",{"_uid":162,"link":163,"title":166,"new_tab":24,"component":119},"47e5a074-a6b5-4f1c-8c2f-89a2ae9f83eb",{"id":164,"url":13,"linktype":14,"fieldtype":15,"cached_url":165},"d2c83612-d611-47f3-a3b4-ca7fe08540b8","changelogs\u002F","Changelogs",{"_uid":168,"link":169,"title":172,"new_tab":24,"component":119},"b5c08774-542f-4ffd-b357-c94d674488b9",{"id":170,"url":13,"linktype":14,"fieldtype":15,"cached_url":171},"08876121-0df3-4ed9-aa11-902b3e41cd02","whats-next","What's Next",{"_uid":174,"link":175,"title":178,"new_tab":24,"component":119},"9c2704ed-6d9f-43e1-9e67-c8d91c083288",{"id":176,"url":13,"linktype":14,"fieldtype":15,"cached_url":177},"056a7857-b18f-4025-8f97-91a38fc19bc8","compare\u002F","Compare",{"_uid":180,"link":181,"title":183,"new_tab":24,"component":119},"5f2db35b-674b-406a-8fa7-d246633af9fe",{"id":13,"url":182,"linktype":31,"fieldtype":15,"cached_url":182},"https:\u002F\u002Fadmin.foxy.io\u002Fsign-up","Try Foxy Free",{"_uid":185,"name":186,"items":187,"component":138},"63fa1f29-4252-4640-9922-fe310e69e54a","Security",[188,194,200],{"_uid":189,"link":190,"title":193,"new_tab":24,"component":119},"1158ddb6-9eb0-466f-8eb6-7ca2ae66c8b8",{"id":191,"url":13,"linktype":14,"fieldtype":15,"cached_url":192},"1f58fb2c-8681-4742-b6e8-09999beae9f6","security-contact","Security Contact",{"_uid":195,"link":196,"title":199,"new_tab":24,"component":119},"9a79c54a-6022-4dfd-854b-766f5e4703ba",{"id":197,"url":13,"linktype":14,"fieldtype":15,"cached_url":198},"55cbfcc3-425a-4261-8037-54e919851d2d","pci","PCI Compliance",{"_uid":201,"link":202,"title":205,"new_tab":24,"component":119},"0b85f5b6-9534-4071-b323-b39d053dd4d7",{"id":203,"url":13,"linktype":14,"fieldtype":15,"cached_url":204},"c3ac0fe3-83e2-4879-afbd-d4c83e1590df","help\u002Farticles\u002Four-official-domains-public-code","Domains & Codebases",{"_uid":207,"name":208,"items":209,"component":138},"998ded67-d107-49f4-8154-ca6be51671ec","Support",[210,213,216,219,222],{"_uid":211,"link":212,"title":16,"new_tab":24,"component":119},"594ffd35-3049-4004-bb08-0db568ebd819",{"id":54,"url":13,"linktype":14,"fieldtype":15,"cached_url":55},{"_uid":214,"link":215,"title":32,"new_tab":33,"component":119},"0a1a55ab-a985-4f9d-8b42-26da714d0c1c",{"id":13,"url":30,"linktype":31,"fieldtype":15,"cached_url":30},{"_uid":217,"link":218,"title":38,"new_tab":33,"component":119},"61e0b7c8-aadf-419b-a339-b3ccabc65bf4",{"id":13,"url":37,"linktype":31,"fieldtype":15,"cached_url":37},{"_uid":220,"link":221,"title":43,"new_tab":33,"component":119},"fd67a89e-1c54-4d31-94b5-64be999062d6",{"id":13,"url":42,"linktype":31,"fieldtype":15,"cached_url":42},{"_uid":223,"link":224,"title":49,"new_tab":24,"component":119},"231a6f71-e996-4ad4-b033-d4d5542f34f0",{"id":47,"url":13,"linktype":14,"fieldtype":15,"cached_url":48},"footer","Get started with our *unlimited free trial*.",[228,235],{"_uid":229,"link":230,"text":233,"component":234},"f0b77210-2632-45a2-8436-e57cad84d01a",{"id":231,"url":13,"linktype":14,"fieldtype":15,"cached_url":232},"60ba16a2-c1f4-485f-b978-8d2eeeafbf5a","terms-of-service","Terms of Service","footer___bottom_links",{"_uid":236,"link":237,"text":240,"component":234},"4bd497b0-993f-4b4d-a5b7-8a49c7c8fec9",{"id":238,"url":13,"linktype":14,"fieldtype":15,"cached_url":239},"332302b9-1d18-4016-b9c8-9b33c72d782b","privacy-policy","Privacy Policy","No credit card required.",{"id":13,"url":182,"linktype":31,"fieldtype":15,"cached_url":182},"default-footer","navigation\u002Fdefault-footer",50,[],"11006268-07f9-41e9-96f3-c51fb723399d","2022-09-21T20:39:02.357Z",[],{"name":251,"created_at":252,"published_at":253,"updated_at":254,"id":255,"uuid":256,"content":257,"slug":279,"full_slug":282,"sort_by_date":59,"position":283,"tag_list":284,"is_startpage":24,"parent_id":62,"meta_data":59,"group_id":285,"first_published_at":286,"release_id":59,"lang":65,"path":59,"alternates":287,"default_full_slug":59,"translated_slugs":59},"Search","2024-10-21T22:08:54.973Z","2025-05-26T09:17:25.790Z","2025-05-26T09:17:25.804Z",13592003,"14cbc359-9ac1-4a7a-a8de-ad4ac8ef26d4",{"_uid":258,"name":251,"indices":259,"summary":13,"component":279,"primary_image":280},"5e4a56e8-76f1-4790-b3a7-70f1be97d042",[260,265,269,274],{"key":261,"_uid":262,"icon":13,"name":263,"component":264},"all","c12a3210-7323-4273-8217-5215e52efe84","All","index",{"key":266,"_uid":267,"icon":268,"name":23,"component":264},"help_center_article","5acff080-95e4-44d3-8dcf-1b19720af382","fa-file-alt",{"key":270,"_uid":271,"icon":272,"name":273,"component":264},"help_center_guide","b8fbc206-c083-471e-a1f0-0ebeb90a669d","fa-book","Guides",{"key":275,"_uid":276,"icon":277,"name":278,"component":264},"blog_post","23419e83-2e56-4c4c-8a05-9fd1b3c9a9bd","fa-file-image","Blog Posts","search",{"id":59,"alt":59,"name":13,"focus":59,"title":59,"source":59,"filename":13,"copyright":59,"fieldtype":81,"meta_data":281},{},"navigation\u002Fsearch",60,[],"11e1fd31-95cd-4fc9-b736-8b8910663e6c","2024-10-21T23:17:05.904Z",[],{"name":23,"created_at":289,"published_at":290,"updated_at":291,"id":292,"uuid":21,"content":293,"slug":307,"full_slug":22,"sort_by_date":59,"position":308,"tag_list":309,"is_startpage":33,"parent_id":310,"meta_data":59,"group_id":311,"first_published_at":312,"release_id":59,"lang":65,"path":59,"alternates":313,"default_full_slug":59,"translated_slugs":59},"2022-09-19T14:42:29.685Z","2024-07-30T18:17:22.506Z","2024-07-30T18:17:22.525Z",2660,{"_uid":294,"icon":13,"name":23,"guides":295,"pinned":24,"summary":296,"category":13,"component":297,"blog_posts":298,"content_hub":24,"icon_custom":299,"case_studies":300,"faq_sections":301,"help_articles":302,"featured_guides":303,"mailbox_category":13,"featured_articles":304,"featured_blog_posts":305,"featured_case_studies":306},"d6dae89a-907a-4bf7-82de-fe2ba875ee6e",[],"Get your questions answered with our browsable knowledge base.","help_center_category",[],{"id":59,"alt":59,"name":13,"focus":59,"title":59,"filename":13,"copyright":59,"fieldtype":81},[],[],[],[],[],[],[],"categories",530,[],2658,"19ebcdd2-027f-47f5-9a5b-a8992c959578","2022-09-19T16:24:39.219Z",[],{"name":315,"created_at":316,"published_at":317,"updated_at":318,"id":319,"uuid":320,"content":321,"slug":334,"full_slug":335,"sort_by_date":59,"position":336,"tag_list":337,"is_startpage":24,"parent_id":310,"meta_data":59,"group_id":338,"first_published_at":317,"release_id":59,"lang":65,"path":59,"alternates":339,"default_full_slug":59,"translated_slugs":59},"JavaScript","2026-07-20T21:14:05.160Z","2026-07-20T21:14:28.313Z","2026-07-20T21:14:28.324Z",200263455421156,"3ec5e2da-c8cb-4271-ab65-8ee88cf158fb",{"_uid":322,"icon":13,"name":315,"type":323,"pinned":24,"summary":324,"category":13,"component":297,"blog_posts":325,"icon_custom":326,"case_studies":328,"faq_sections":329,"featured_guides":330,"mailbox_category":13,"featured_articles":331,"featured_blog_posts":332,"featured_case_studies":333},"6ac2aa76-e023-4332-bc33-df367c493314","simple","How Foxy's JavaScript works, including events, configuration, sessions, and template rendering, for custom integrations beyond the default cart and checkout.",[],{"id":59,"alt":59,"name":13,"focus":59,"title":59,"source":59,"filename":13,"copyright":59,"fieldtype":81,"meta_data":327},{},[],[],[],[],[],[],"javascript","help\u002Fcategories\u002Fjavascript",-820,[],"37830f97-9285-4e32-8105-7b383c2b8ec9",[],[288],[],[],[344,508,829,2170,3443,3605],{"name":345,"created_at":346,"published_at":347,"updated_at":348,"id":349,"uuid":350,"content":351,"slug":501,"full_slug":502,"sort_by_date":59,"position":503,"tag_list":504,"is_startpage":24,"parent_id":505,"meta_data":59,"group_id":506,"first_published_at":347,"release_id":59,"lang":65,"path":59,"alternates":507,"default_full_slug":59,"translated_slugs":59},"Configure JavaScript loading options","2026-07-20T21:20:55.002Z","2026-07-20T21:42:38.453Z","2026-07-20T21:42:38.466Z",200265134150375,"4626d122-124c-4aa0-ad60-39da250a642a",{"_uid":352,"body":353,"name":345,"image":497,"pinned":24,"summary":499,"category":320,"component":266,"related_articles":500},"0e771a44-b9d1-4c3c-9562-c184e4fa20d5",{"type":354,"content":355},"doc",[356,363,370,375,381,399,404,463,468],{"type":357,"attrs":358,"content":359},"paragraph",{"textAlign":59},[360],{"text":361,"type":362},"Some of Foxy’s JavaScript defaults can be overridden with a small config object, for situations where a template config option in the admin isn’t available or doesn’t apply to your own site.","text",{"type":364,"attrs":365,"content":367},"heading",{"level":366,"textAlign":59},2,[368],{"text":369,"type":362},"How to set it up",{"type":357,"attrs":371,"content":372},{"textAlign":59},[373],{"text":374,"type":362},"Add this code before you include Foxy’s JavaScript:",{"type":376,"attrs":377,"content":378},"code_block",{"class":59},[379],{"text":380,"type":362},"var FC = FC || {};\nFC.override = FC.override || {};\nFC.override.PROPERTY = VALUE;\nFC.onLoad = function () {\n  \u002F\u002F Attach FC event handlers here, before FC is defined. Like this:\n  FC.client.on('ready.done', function () {\n    \u002F\u002F custom code goes here\n  });\n};\n",{"type":357,"attrs":382,"content":383},{"textAlign":59},[384,386,391,393,397],{"text":385,"type":362},"Replace ",{"text":387,"type":362,"marks":388},"PROPERTY",[389],{"type":390},"code",{"text":392,"type":362}," and ",{"text":394,"type":362,"marks":395},"VALUE",[396],{"type":390},{"text":398,"type":362}," with one of the available options below.",{"type":364,"attrs":400,"content":401},{"level":366,"textAlign":59},[402],{"text":403,"type":362},"Available properties",{"type":405,"content":406},"bullet_list",[407,437],{"type":408,"content":409},"list_item",[410],{"type":357,"attrs":411,"content":412},{"textAlign":59},[413,417,419,423,425,429,431,435],{"text":414,"type":362,"marks":415},"debug",[416],{"type":390},{"text":418,"type":362}," — if set to ",{"text":420,"type":362,"marks":421},"true",[422],{"type":390},{"text":424,"type":362},", enables Foxy’s ",{"text":426,"type":362,"marks":427},"FC.util.log()",[428],{"type":390},{"text":430,"type":362}," method so you can see what’s happening. This is also available as a template config value in the admin, but that value doesn’t take effect on pageload on your own site — it only works on the full-page cart, checkout, and receipt. Use ",{"text":432,"type":362,"marks":433},"FC.override.debug",[434],{"type":390},{"text":436,"type":362}," if you need logging on your own site.",{"type":408,"content":438},[439],{"type":357,"attrs":440,"content":441},{"textAlign":59},[442,446,448,452,454,461],{"text":443,"type":362,"marks":444},"onLoad",[445],{"type":390},{"text":447,"type":362}," — a function that runs once, right before ",{"text":449,"type":362,"marks":450},"FC.client.init()",[451],{"type":390},{"text":453,"type":362}," is called. See ",{"text":455,"type":362,"marks":456},"JavaScript Overview",[457],{"type":458,"attrs":459},"link",{"href":460,"uuid":59,"anchor":59,"target":59,"linktype":31},"https:\u002F\u002Ffoxy.io\u002Fhelp\u002Farticles\u002Fjavascript-overview",{"text":462,"type":362}," for how this is used to attach event handlers safely.",{"type":364,"attrs":464,"content":465},{"level":366,"textAlign":59},[466],{"text":467,"type":362},"Notes",{"type":405,"content":469},[470,477],{"type":408,"content":471},[472],{"type":357,"attrs":473,"content":474},{"textAlign":59},[475],{"text":476,"type":362},"This code must run before Foxy’s JavaScript is included, or the overrides won’t take effect.",{"type":408,"content":478},[479],{"type":357,"attrs":480,"content":481},{"textAlign":59},[482,484,487,489,495],{"text":483,"type":362},"For the full list of events you can attach inside ",{"text":443,"type":362,"marks":485},[486],{"type":390},{"text":488,"type":362},", see ",{"text":490,"type":362,"marks":491},"JavaScript events reference",[492],{"type":458,"attrs":493},{"href":494,"uuid":59,"anchor":59,"target":59,"linktype":31},"https:\u002F\u002Ffoxy.io\u002Fhelp\u002Farticles\u002Fjavascript-events-reference",{"text":496,"type":362},".",{"id":59,"alt":59,"name":13,"focus":59,"title":59,"source":59,"filename":13,"copyright":59,"fieldtype":81,"meta_data":498},{},"How to override Foxy's JavaScript defaults, like debug logging, using FC.override before Foxy's script loads.",[],"configure-javascript-loading-options","help\u002Farticles\u002Fconfigure-javascript-loading-options",-4020,[],2659,"790d9db8-968b-4179-befc-b608fda19435",[],{"name":509,"created_at":510,"published_at":511,"updated_at":512,"id":513,"uuid":514,"content":515,"slug":823,"full_slug":824,"sort_by_date":59,"position":825,"tag_list":826,"is_startpage":24,"parent_id":505,"meta_data":59,"group_id":827,"first_published_at":511,"release_id":59,"lang":65,"path":59,"alternates":828,"default_full_slug":59,"translated_slugs":59},"Configure the session domain and cookie path","2026-07-20T21:23:03.547Z","2026-07-20T21:42:38.169Z","2026-07-20T21:42:38.184Z",200265660670696,"ed628274-d7db-4380-a93e-efbe53eaf326",{"_uid":516,"body":517,"name":509,"image":819,"pinned":24,"summary":821,"category":320,"component":266,"related_articles":822},"162444ac-9f1f-4280-a08c-ab248a81b9d2",{"type":354,"content":518},[519,530,535,540,545,550,593,604,609,631,636,661,666,670],{"type":357,"attrs":520,"content":521},{"textAlign":59},[522,524,528],{"text":523,"type":362},"Foxy sets a session cookie (",{"text":525,"type":362,"marks":526},"fcsid",[527],{"type":390},{"text":529,"type":362},") to track each visitor’s cart across pages. Most stores never need to touch this, but if your site uses multiple subdomains or sections that each need their own isolated session, you can control where and how that cookie is set — or clear a session out entirely.",{"type":364,"attrs":531,"content":532},{"level":366,"textAlign":59},[533],{"text":534,"type":362},"Reset a session",{"type":357,"attrs":536,"content":537},{"textAlign":59},[538],{"text":539,"type":362},"To completely clear out a Foxy session:",{"type":376,"attrs":541,"content":542},{"class":59},[543],{"text":544,"type":362},"FC.session.reset();\n",{"type":364,"attrs":546,"content":547},{"level":366,"textAlign":59},[548],{"text":549,"type":362},"Set the session domain",{"type":357,"attrs":551,"content":552},{"textAlign":59},[553,557,559,562,564,568,570,574,576,580,582,586,588,592],{"text":554,"type":362,"marks":555},"sitedomain",[556],{"type":390},{"text":558,"type":362}," controls which domain the ",{"text":525,"type":362,"marks":560},[561],{"type":390},{"text":563,"type":362}," cookie is set on. By default, if your domain is passed in as ",{"text":565,"type":362,"marks":566},"example.com",[567],{"type":390},{"text":569,"type":362}," or ",{"text":571,"type":362,"marks":572},"www.example.com",[573],{"type":390},{"text":575,"type":362},", the cookie is set at the second-level domain — ",{"text":577,"type":362,"marks":578},".example.com",[579],{"type":390},{"text":581,"type":362},". For a third-level domain like ",{"text":583,"type":362,"marks":584},"subdomain.example.com",[585],{"type":390},{"text":587,"type":362},", the cookie is set at ",{"text":589,"type":362,"marks":590},".subdomain.example.com",[591],{"type":390},{"text":496,"type":362},{"type":357,"attrs":594,"content":595},{"textAlign":59},[596,598,602],{"text":597,"type":362},"Set it inside ",{"text":599,"type":362,"marks":600},"FC.onLoad",[601],{"type":390},{"text":603,"type":362},":",{"type":376,"attrs":605,"content":606},{"class":59},[607],{"text":608,"type":362},"var FC = {\n  onLoad: function () {\n    FC.settings.sitedomain = 'store1.example.com';\n  }\n}\n",{"type":357,"attrs":610,"content":611},{"textAlign":59},[612,614,618,619,623,625,629],{"text":613,"type":362},"This matters if your site isn’t at the second-level domain, or if you want to isolate sessions by subdomain — for example, if you run separate Foxy stores at ",{"text":615,"type":362,"marks":616},"donations.example.com",[617],{"type":390},{"text":392,"type":362},{"text":620,"type":362,"marks":621},"products.example.com",[622],{"type":390},{"text":624,"type":362}," and don’t want their sessions to overlap, or if your site is hosted at a third-party domain like ",{"text":626,"type":362,"marks":627},"example.squarespace.com",[628],{"type":390},{"text":630,"type":362}," and you don’t want your session shared across every site on that domain.",{"type":364,"attrs":632,"content":633},{"level":366,"textAlign":59},[634],{"text":635,"type":362},"Set the cookie path",{"type":357,"attrs":637,"content":638},{"textAlign":59},[639,643,645,648,650,654,656,660],{"text":640,"type":362,"marks":641},"cookiepath",[642],{"type":390},{"text":644,"type":362}," controls the path the ",{"text":525,"type":362,"marks":646},[647],{"type":390},{"text":649,"type":362}," cookie is set on. This is normally left empty, but you can use it to run multiple isolated Foxy sessions on the same domain — for example, splitting an English store at ",{"text":651,"type":362,"marks":652},"\u002Fen\u002F",[653],{"type":390},{"text":655,"type":362}," from a Spanish store at ",{"text":657,"type":362,"marks":658},"\u002Fes\u002F",[659],{"type":390},{"text":496,"type":362},{"type":376,"attrs":662,"content":663},{"class":59},[664],{"text":665,"type":362},"var FC = {\n  onLoad: function () {\n    FC.settings.cookiepath = '\u002Fdonations\u002F';\n  }\n}\n",{"type":364,"attrs":667,"content":668},{"level":366,"textAlign":59},[669],{"text":467,"type":362},{"type":405,"content":671},[672,706,736,752,781],{"type":408,"content":673},[674],{"type":357,"attrs":675,"content":676},{"textAlign":59},[677,679,683,685,688,690,693,695,699,701,704],{"text":678,"type":362},"The ",{"text":680,"type":362,"marks":681},"www",[682],{"type":390},{"text":684,"type":362}," subdomain is effectively ignored when counting domain levels. To lock sessions down to ",{"text":571,"type":362,"marks":686},[687],{"type":390},{"text":689,"type":362}," specifically, set ",{"text":554,"type":362,"marks":691},[692],{"type":390},{"text":694,"type":362}," to something like ",{"text":696,"type":362,"marks":697},"www1.example.com",[698],{"type":390},{"text":700,"type":362}," — the actual value doesn’t matter, only the number of dots after ",{"text":680,"type":362,"marks":702},[703],{"type":390},{"text":705,"type":362}," is stripped.",{"type":408,"content":707},[708],{"type":357,"attrs":709,"content":710},{"textAlign":59},[711,713,716,717,720,722,725,726,729,731,734],{"text":712,"type":362},"If you isolate sessions by subdomain, Foxy’s JavaScript can’t also be loaded at a parent domain. For example, with separate stores at ",{"text":620,"type":362,"marks":714},[715],{"type":390},{"text":392,"type":362},{"text":615,"type":362,"marks":718},[719],{"type":390},{"text":721,"type":362},", you can’t also load Foxy at ",{"text":571,"type":362,"marks":723},[724],{"type":390},{"text":569,"type":362},{"text":565,"type":362,"marks":727},[728],{"type":390},{"text":730,"type":362}," — that would set the session cookie at ",{"text":577,"type":362,"marks":732},[733],{"type":390},{"text":735,"type":362}," and override both subdomain sessions.",{"type":408,"content":737},[738],{"type":357,"attrs":739,"content":740},{"textAlign":59},[741,744,746,750],{"text":640,"type":362,"marks":742},[743],{"type":390},{"text":745,"type":362}," must start and end with a ",{"text":747,"type":362,"marks":748},"\u002F",[749],{"type":390},{"text":751,"type":362},", or you may run into issues (especially in older browsers).",{"type":408,"content":753},[754],{"type":357,"attrs":755,"content":756},{"textAlign":59},[757,759,763,764,768,770,774,775,779],{"text":758,"type":362},"If splitting sessions by path, the trailing slash is critical — ",{"text":760,"type":362,"marks":761},"example.com\u002Fbookstore\u002F",[762],{"type":390},{"text":392,"type":362},{"text":765,"type":362,"marks":766},"example.com\u002Fdonations\u002F",[767],{"type":390},{"text":769,"type":362}," work, but ",{"text":771,"type":362,"marks":772},"example.com\u002Fbookstore",[773],{"type":390},{"text":392,"type":362},{"text":776,"type":362,"marks":777},"example.com\u002Fdonations",[778],{"type":390},{"text":780,"type":362}," (without trailing slashes) will collide.",{"type":408,"content":782},[783],{"type":357,"attrs":784,"content":785},{"textAlign":59},[786,789,790,793,795,799,801,804,806,810,812,817],{"text":554,"type":362,"marks":787},[788],{"type":390},{"text":392,"type":362},{"text":640,"type":362,"marks":791},[792],{"type":390},{"text":794,"type":362}," are set on ",{"text":796,"type":362,"marks":797},"FC.settings",[798],{"type":390},{"text":800,"type":362}," inside ",{"text":599,"type":362,"marks":802},[803],{"type":390},{"text":805,"type":362},", not with ",{"text":807,"type":362,"marks":808},"FC.override",[809],{"type":390},{"text":811,"type":362}," — see ",{"text":345,"type":362,"marks":813},[814],{"type":458,"attrs":815},{"href":816,"uuid":59,"anchor":59,"target":59,"linktype":31},"https:\u002F\u002Ffoxy.io\u002Fhelp\u002Farticles\u002Fconfigure-javascript-loading-options",{"text":818,"type":362}," for the override pattern used elsewhere.",{"id":59,"alt":59,"name":13,"focus":59,"title":59,"source":59,"filename":13,"copyright":59,"fieldtype":81,"meta_data":820},{},"How to reset a Foxy session, and control which domain and path the session cookie is set on when isolating sessions by subdomain or section.",[],"configure-the-session-domain-and-cookie-path","help\u002Farticles\u002Fconfigure-the-session-domain-and-cookie-path",-4030,[],"f2367397-7294-4e6d-837f-1f8920625207",[],{"name":490,"created_at":830,"published_at":831,"updated_at":832,"id":833,"uuid":834,"content":835,"slug":2164,"full_slug":2165,"sort_by_date":59,"position":2166,"tag_list":2167,"is_startpage":24,"parent_id":505,"meta_data":59,"group_id":2168,"first_published_at":831,"release_id":59,"lang":65,"path":59,"alternates":2169,"default_full_slug":59,"translated_slugs":59},"2026-07-20T21:26:22.052Z","2026-07-20T21:42:37.922Z","2026-07-20T21:42:37.946Z",200266473730794,"8e974025-25f6-44e2-b9c4-aa91fa7b2924",{"_uid":836,"body":837,"name":490,"image":2160,"pinned":24,"summary":2162,"category":320,"component":266,"related_articles":2163},"e060c52c-0753-41c3-8846-899d2092f439",{"type":354,"content":838},[839,850,855,860,865,870,886,891,897,968,973,1096,1101,1413,1418,1706,1711,1716,1894,1899,1904,1979,1984,1989,2000,2005,2028,2033,2038,2043,2048,2053,2058,2063,2068,2085,2090,2095,2111,2116,2120],{"type":357,"attrs":840,"content":841},{"textAlign":59},[842,844,848],{"text":843,"type":362},"Foxy’s JavaScript fires events for nearly everything that happens on the cart, checkout, and receipt. Bind to any of these with ",{"text":845,"type":362,"marks":846},"FC.client.on()",[847],{"type":390},{"text":849,"type":362}," to hook in your own custom behavior.",{"type":364,"attrs":851,"content":852},{"level":366,"textAlign":59},[853],{"text":854,"type":362},"Binding to an event",{"type":376,"attrs":856,"content":857},{"class":59},[858],{"text":859,"type":362},"FC.client.on('cart-submit', function (params, next) {\n  \u002F\u002F your code here\n});\n",{"type":357,"attrs":861,"content":862},{"textAlign":59},[863],{"text":864,"type":362},"Bind and unbind calls can be chained:",{"type":376,"attrs":866,"content":867},{"class":59},[868],{"text":869,"type":362},"FC.client\n  .on('cart-item-remove', cartItemRemoveHandler)\n  .on('cart-item-remove.done', cartItemRemoveDoneHandler)\n  .on('cart-submit', cartSubmitHandler)\n  .on('cart-submit.done', cartSubmitDoneHandler);\n\nFC.client\n  .off('cart-item-remove', cartItemRemoveHandler)\n  .off('cart-submit', cartSubmitHandler);\n",{"type":357,"attrs":871,"content":872},{"textAlign":59},[873,875,879,881,885],{"text":874,"type":362},"Every event listed below also fires a corresponding ",{"text":876,"type":362,"marks":877},".done",[878],{"type":390},{"text":880,"type":362}," event once the action completes, for example ",{"text":882,"type":362,"marks":883},"cart-item-remove.done",[884],{"type":390},{"text":496,"type":362},{"type":364,"attrs":887,"content":888},{"level":366,"textAlign":59},[889],{"text":890,"type":362},"Available events",{"type":364,"attrs":892,"content":894},{"level":893,"textAlign":59},3,[895],{"text":896,"type":362},"Template events",{"type":898,"content":899},"table",[900,929],{"type":901,"content":902},"tableRow",[903,913,921],{"type":904,"attrs":905,"content":907},"tableHeader",{"colspan":906,"rowspan":906,"colwidth":59},1,[908],{"type":357,"attrs":909,"content":910},{"textAlign":59},[911],{"text":912,"type":362},"Event",{"type":904,"attrs":914,"content":915},{"colspan":906,"rowspan":906,"colwidth":59},[916],{"type":357,"attrs":917,"content":918},{"textAlign":59},[919],{"text":920,"type":362},"Description",{"type":904,"attrs":922,"content":923},{"colspan":906,"rowspan":906,"colwidth":59},[924],{"type":357,"attrs":925,"content":926},{"textAlign":59},[927],{"text":928,"type":362},"Params",{"type":901,"content":930},[931,942,950],{"type":932,"attrs":933,"content":934},"tableCell",{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[935],{"type":357,"attrs":936,"content":937},{"textAlign":59},[938],{"text":939,"type":362,"marks":940},"render.done",[941],{"type":390},{"type":932,"attrs":943,"content":944},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[945],{"type":357,"attrs":946,"content":947},{"textAlign":59},[948],{"text":949,"type":362},"Fires after a template block is updated.",{"type":932,"attrs":951,"content":952},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[953],{"type":357,"attrs":954,"content":955},{"textAlign":59},[956,960,962,966],{"text":957,"type":362,"marks":958},"selector",[959],{"type":390},{"text":961,"type":362}," — HTML selector for the block being rendered; ",{"text":963,"type":362,"marks":964},"block_id",[965],{"type":390},{"text":967,"type":362}," — name of the block being rendered",{"type":364,"attrs":969,"content":970},{"level":893,"textAlign":59},[971],{"text":972,"type":362},"Sidecart events",{"type":898,"content":974},[975,998,1041,1069],{"type":901,"content":976},[977,984,991],{"type":904,"attrs":978,"content":979},{"colspan":906,"rowspan":906,"colwidth":59},[980],{"type":357,"attrs":981,"content":982},{"textAlign":59},[983],{"text":912,"type":362},{"type":904,"attrs":985,"content":986},{"colspan":906,"rowspan":906,"colwidth":59},[987],{"type":357,"attrs":988,"content":989},{"textAlign":59},[990],{"text":920,"type":362},{"type":904,"attrs":992,"content":993},{"colspan":906,"rowspan":906,"colwidth":59},[994],{"type":357,"attrs":995,"content":996},{"textAlign":59},[997],{"text":928,"type":362},{"type":901,"content":999},[1000,1010,1018],{"type":932,"attrs":1001,"content":1002},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[1003],{"type":357,"attrs":1004,"content":1005},{"textAlign":59},[1006],{"text":1007,"type":362,"marks":1008},"sidecart-show",[1009],{"type":390},{"type":932,"attrs":1011,"content":1012},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[1013],{"type":357,"attrs":1014,"content":1015},{"textAlign":59},[1016],{"text":1017,"type":362},"When the sidecart is displayed.",{"type":932,"attrs":1019,"content":1020},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[1021],{"type":357,"attrs":1022,"content":1023},{"textAlign":59},[1024,1028,1030,1034,1036,1039],{"text":1025,"type":362,"marks":1026},"element",[1027],{"type":390},{"text":1029,"type":362}," — HTML element that triggered the add to cart; ",{"text":1031,"type":362,"marks":1032},"data",[1033],{"type":390},{"text":1035,"type":362}," — parameters in the add to cart; ",{"text":31,"type":362,"marks":1037},[1038],{"type":390},{"text":1040,"type":362}," — URL version of the add to cart",{"type":901,"content":1042},[1043,1053,1061],{"type":932,"attrs":1044,"content":1045},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[1046],{"type":357,"attrs":1047,"content":1048},{"textAlign":59},[1049],{"text":1050,"type":362,"marks":1051},"sidecart-hide",[1052],{"type":390},{"type":932,"attrs":1054,"content":1055},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[1056],{"type":357,"attrs":1057,"content":1058},{"textAlign":59},[1059],{"text":1060,"type":362},"When the sidecart is hidden.",{"type":932,"attrs":1062,"content":1063},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[1064],{"type":357,"attrs":1065,"content":1066},{"textAlign":59},[1067],{"text":1068,"type":362},"—",{"type":901,"content":1070},[1071,1081,1089],{"type":932,"attrs":1072,"content":1073},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[1074],{"type":357,"attrs":1075,"content":1076},{"textAlign":59},[1077],{"text":1078,"type":362,"marks":1079},"sidecart-detach",[1080],{"type":390},{"type":932,"attrs":1082,"content":1083},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[1084],{"type":357,"attrs":1085,"content":1086},{"textAlign":59},[1087],{"text":1088,"type":362},"After the sidecart is hidden and detached from the DOM.",{"type":932,"attrs":1090,"content":1091},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[1092],{"type":357,"attrs":1093,"content":1094},{"textAlign":59},[1095],{"text":1068,"type":362},{"type":364,"attrs":1097,"content":1098},{"level":893,"textAlign":59},[1099],{"text":1100,"type":362},"Cart events",{"type":898,"content":1102},[1103,1126,1167,1205,1236,1267,1299,1331,1363],{"type":901,"content":1104},[1105,1112,1119],{"type":904,"attrs":1106,"content":1107},{"colspan":906,"rowspan":906,"colwidth":59},[1108],{"type":357,"attrs":1109,"content":1110},{"textAlign":59},[1111],{"text":912,"type":362},{"type":904,"attrs":1113,"content":1114},{"colspan":906,"rowspan":906,"colwidth":59},[1115],{"type":357,"attrs":1116,"content":1117},{"textAlign":59},[1118],{"text":920,"type":362},{"type":904,"attrs":1120,"content":1121},{"colspan":906,"rowspan":906,"colwidth":59},[1122],{"type":357,"attrs":1123,"content":1124},{"textAlign":59},[1125],{"text":928,"type":362},{"type":901,"content":1127},[1128,1138,1146],{"type":932,"attrs":1129,"content":1130},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[1131],{"type":357,"attrs":1132,"content":1133},{"textAlign":59},[1134],{"text":1135,"type":362,"marks":1136},"cart-submit",[1137],{"type":390},{"type":932,"attrs":1139,"content":1140},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[1141],{"type":357,"attrs":1142,"content":1143},{"textAlign":59},[1144],{"text":1145,"type":362},"When the cart is loaded — as an add to cart, view cart, empty cart request, etc.",{"type":932,"attrs":1147,"content":1148},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[1149],{"type":357,"attrs":1150,"content":1151},{"textAlign":59},[1152,1155,1157,1160,1162,1165],{"text":1025,"type":362,"marks":1153},[1154],{"type":390},{"text":1156,"type":362}," — HTML element that triggered the request; ",{"text":1031,"type":362,"marks":1158},[1159],{"type":390},{"text":1161,"type":362}," — parameters in the cart request; ",{"text":31,"type":362,"marks":1163},[1164],{"type":390},{"text":1166,"type":362}," — URL version of the request",{"type":901,"content":1168},[1169,1179,1187],{"type":932,"attrs":1170,"content":1171},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[1172],{"type":357,"attrs":1173,"content":1174},{"textAlign":59},[1175],{"text":1176,"type":362,"marks":1177},"cart-item-quantity-update",[1178],{"type":390},{"type":932,"attrs":1180,"content":1181},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[1182],{"type":357,"attrs":1183,"content":1184},{"textAlign":59},[1185],{"text":1186,"type":362},"When a quantity is changed in the cart.",{"type":932,"attrs":1188,"content":1189},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[1190],{"type":357,"attrs":1191,"content":1192},{"textAlign":59},[1193,1197,1199,1203],{"text":1194,"type":362,"marks":1195},"id",[1196],{"type":390},{"text":1198,"type":362}," — product ID being adjusted; ",{"text":1200,"type":362,"marks":1201},"quantity",[1202],{"type":390},{"text":1204,"type":362}," — new quantity amount",{"type":901,"content":1206},[1207,1217,1225],{"type":932,"attrs":1208,"content":1209},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[1210],{"type":357,"attrs":1211,"content":1212},{"textAlign":59},[1213],{"text":1214,"type":362,"marks":1215},"cart-item-remove",[1216],{"type":390},{"type":932,"attrs":1218,"content":1219},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[1220],{"type":357,"attrs":1221,"content":1222},{"textAlign":59},[1223],{"text":1224,"type":362},"When a product is removed from the cart.",{"type":932,"attrs":1226,"content":1227},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[1228],{"type":357,"attrs":1229,"content":1230},{"textAlign":59},[1231,1234],{"text":1194,"type":362,"marks":1232},[1233],{"type":390},{"text":1235,"type":362}," — product ID being adjusted",{"type":901,"content":1237},[1238,1248,1256],{"type":932,"attrs":1239,"content":1240},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[1241],{"type":357,"attrs":1242,"content":1243},{"textAlign":59},[1244],{"text":1245,"type":362,"marks":1246},"cart-coupon-add",[1247],{"type":390},{"type":932,"attrs":1249,"content":1250},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[1251],{"type":357,"attrs":1252,"content":1253},{"textAlign":59},[1254],{"text":1255,"type":362},"When a coupon or gift card is added.",{"type":932,"attrs":1257,"content":1258},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[1259],{"type":357,"attrs":1260,"content":1261},{"textAlign":59},[1262,1265],{"text":390,"type":362,"marks":1263},[1264],{"type":390},{"text":1266,"type":362}," — coupon or gift card code being added",{"type":901,"content":1268},[1269,1279,1287],{"type":932,"attrs":1270,"content":1271},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[1272],{"type":357,"attrs":1273,"content":1274},{"textAlign":59},[1275],{"text":1276,"type":362,"marks":1277},"cart-coupon-remove",[1278],{"type":390},{"type":932,"attrs":1280,"content":1281},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[1282],{"type":357,"attrs":1283,"content":1284},{"textAlign":59},[1285],{"text":1286,"type":362},"When a coupon is removed.",{"type":932,"attrs":1288,"content":1289},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[1290],{"type":357,"attrs":1291,"content":1292},{"textAlign":59},[1293,1297],{"text":1294,"type":362,"marks":1295},"coupon_code_id",[1296],{"type":390},{"text":1298,"type":362}," — coupon code ID being removed",{"type":901,"content":1300},[1301,1311,1319],{"type":932,"attrs":1302,"content":1303},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[1304],{"type":357,"attrs":1305,"content":1306},{"textAlign":59},[1307],{"text":1308,"type":362,"marks":1309},"cart-gift-card-remove",[1310],{"type":390},{"type":932,"attrs":1312,"content":1313},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[1314],{"type":357,"attrs":1315,"content":1316},{"textAlign":59},[1317],{"text":1318,"type":362},"When a gift card is removed.",{"type":932,"attrs":1320,"content":1321},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[1322],{"type":357,"attrs":1323,"content":1324},{"textAlign":59},[1325,1329],{"text":1326,"type":362,"marks":1327},"gift_card_code_id",[1328],{"type":390},{"text":1330,"type":362}," — gift card code ID being removed",{"type":901,"content":1332},[1333,1343,1356],{"type":932,"attrs":1334,"content":1335},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[1336],{"type":357,"attrs":1337,"content":1338},{"textAlign":59},[1339],{"text":1340,"type":362,"marks":1341},"cart-update",[1342],{"type":390},{"type":932,"attrs":1344,"content":1345},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[1346],{"type":357,"attrs":1347,"content":1348},{"textAlign":59},[1349,1351,1355],{"text":1350,"type":362},"When the cart is updated, e.g. rendering Twig templates or setting ",{"text":1352,"type":362,"marks":1353},"FC.json",[1354],{"type":390},{"text":496,"type":362},{"type":932,"attrs":1357,"content":1358},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[1359],{"type":357,"attrs":1360,"content":1361},{"textAlign":59},[1362],{"text":1068,"type":362},{"type":901,"content":1364},[1365,1375,1383],{"type":932,"attrs":1366,"content":1367},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[1368],{"type":357,"attrs":1369,"content":1370},{"textAlign":59},[1371],{"text":1372,"type":362,"marks":1373},"cart-shipping-options-update",[1374],{"type":390},{"type":932,"attrs":1376,"content":1377},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[1378],{"type":357,"attrs":1379,"content":1380},{"textAlign":59},[1381],{"text":1382,"type":362},"When shipping options are updated.",{"type":932,"attrs":1384,"content":1385},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[1386],{"type":357,"attrs":1387,"content":1388},{"textAlign":59},[1389,1393,1395,1399,1401,1405,1407,1411],{"text":1390,"type":362,"marks":1391},"address",[1392],{"type":390},{"text":1394,"type":362}," — JSON object of the address in use (e.g. ",{"text":1396,"type":362,"marks":1397},"FC.json.shipping_address",[1398],{"type":390},{"text":1400,"type":362},"); ",{"text":1402,"type":362,"marks":1403},"fields",[1404],{"type":390},{"text":1406,"type":362}," — JSON object of changed fields (e.g. ",{"text":1408,"type":362,"marks":1409},"{\"shipping_city\": \"New York\"}",[1410],{"type":390},{"text":1412,"type":362},")",{"type":364,"attrs":1414,"content":1415},{"level":893,"textAlign":59},[1416],{"text":1417,"type":362},"Checkout events",{"type":898,"content":1419},[1420,1443,1470,1497,1524,1561,1599,1633,1666],{"type":901,"content":1421},[1422,1429,1436],{"type":904,"attrs":1423,"content":1424},{"colspan":906,"rowspan":906,"colwidth":59},[1425],{"type":357,"attrs":1426,"content":1427},{"textAlign":59},[1428],{"text":912,"type":362},{"type":904,"attrs":1430,"content":1431},{"colspan":906,"rowspan":906,"colwidth":59},[1432],{"type":357,"attrs":1433,"content":1434},{"textAlign":59},[1435],{"text":920,"type":362},{"type":904,"attrs":1437,"content":1438},{"colspan":906,"rowspan":906,"colwidth":59},[1439],{"type":357,"attrs":1440,"content":1441},{"textAlign":59},[1442],{"text":928,"type":362},{"type":901,"content":1444},[1445,1455,1463],{"type":932,"attrs":1446,"content":1447},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[1448],{"type":357,"attrs":1449,"content":1450},{"textAlign":59},[1451],{"text":1452,"type":362,"marks":1453},"checkout-submit",[1454],{"type":390},{"type":932,"attrs":1456,"content":1457},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[1458],{"type":357,"attrs":1459,"content":1460},{"textAlign":59},[1461],{"text":1462,"type":362},"When the checkout is submitted.",{"type":932,"attrs":1464,"content":1465},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[1466],{"type":357,"attrs":1467,"content":1468},{"textAlign":59},[1469],{"text":1068,"type":362},{"type":901,"content":1471},[1472,1482,1490],{"type":932,"attrs":1473,"content":1474},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[1475],{"type":357,"attrs":1476,"content":1477},{"textAlign":59},[1478],{"text":1479,"type":362,"marks":1480},"checkout-submit-enable",[1481],{"type":390},{"type":932,"attrs":1483,"content":1484},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[1485],{"type":357,"attrs":1486,"content":1487},{"textAlign":59},[1488],{"text":1489,"type":362},"When the checkout submit button is re-enabled after a stopped validation attempt.",{"type":932,"attrs":1491,"content":1492},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[1493],{"type":357,"attrs":1494,"content":1495},{"textAlign":59},[1496],{"text":1068,"type":362},{"type":901,"content":1498},[1499,1509,1517],{"type":932,"attrs":1500,"content":1501},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[1502],{"type":357,"attrs":1503,"content":1504},{"textAlign":59},[1505],{"text":1506,"type":362,"marks":1507},"checkout-submit-disable",[1508],{"type":390},{"type":932,"attrs":1510,"content":1511},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[1512],{"type":357,"attrs":1513,"content":1514},{"textAlign":59},[1515],{"text":1516,"type":362},"When the checkout submit button is clicked, disabling it and triggering validation.",{"type":932,"attrs":1518,"content":1519},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[1520],{"type":357,"attrs":1521,"content":1522},{"textAlign":59},[1523],{"text":1068,"type":362},{"type":901,"content":1525},[1526,1536,1544],{"type":932,"attrs":1527,"content":1528},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[1529],{"type":357,"attrs":1530,"content":1531},{"textAlign":59},[1532],{"text":1533,"type":362,"marks":1534},"checkout-shipping-options-update",[1535],{"type":390},{"type":932,"attrs":1537,"content":1538},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[1539],{"type":357,"attrs":1540,"content":1541},{"textAlign":59},[1542],{"text":1543,"type":362},"When shipping options are updated on the checkout.",{"type":932,"attrs":1545,"content":1546},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[1547],{"type":357,"attrs":1548,"content":1549},{"textAlign":59},[1550,1553,1555,1559],{"text":1390,"type":362,"marks":1551},[1552],{"type":390},{"text":1554,"type":362}," — JSON object of the address in use; ",{"text":1556,"type":362,"marks":1557},"custom_fields",[1558],{"type":390},{"text":1560,"type":362}," — JSON object of custom fields included with shipping rate calculations",{"type":901,"content":1562},[1563,1573,1581],{"type":932,"attrs":1564,"content":1565},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[1566],{"type":357,"attrs":1567,"content":1568},{"textAlign":59},[1569],{"text":1570,"type":362,"marks":1571},"express-checkout-select",[1572],{"type":390},{"type":932,"attrs":1574,"content":1575},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[1576],{"type":357,"attrs":1577,"content":1578},{"textAlign":59},[1579],{"text":1580,"type":362},"When a customer initiates an express checkout option.",{"type":932,"attrs":1582,"content":1583},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[1584],{"type":357,"attrs":1585,"content":1586},{"textAlign":59},[1587,1591,1593,1597],{"text":1588,"type":362,"marks":1589},"gateway",[1590],{"type":390},{"text":1592,"type":362}," — payment gateway code; ",{"text":1594,"type":362,"marks":1595},"payment_type",[1596],{"type":390},{"text":1598,"type":362}," — express payment type code selected",{"type":901,"content":1600},[1601,1611,1619],{"type":932,"attrs":1602,"content":1603},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[1604],{"type":357,"attrs":1605,"content":1606},{"textAlign":59},[1607],{"text":1608,"type":362,"marks":1609},"express-checkout-confirm",[1610],{"type":390},{"type":932,"attrs":1612,"content":1613},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[1614],{"type":357,"attrs":1615,"content":1616},{"textAlign":59},[1617],{"text":1618,"type":362},"When a customer completes express checkout authentication.",{"type":932,"attrs":1620,"content":1621},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[1622],{"type":357,"attrs":1623,"content":1624},{"textAlign":59},[1625,1628,1630],{"text":1588,"type":362,"marks":1626},[1627],{"type":390},{"text":1629,"type":362},"; ",{"text":1594,"type":362,"marks":1631},[1632],{"type":390},{"type":901,"content":1634},[1635,1645,1653],{"type":932,"attrs":1636,"content":1637},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[1638],{"type":357,"attrs":1639,"content":1640},{"textAlign":59},[1641],{"text":1642,"type":362,"marks":1643},"express-checkout-cancel",[1644],{"type":390},{"type":932,"attrs":1646,"content":1647},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[1648],{"type":357,"attrs":1649,"content":1650},{"textAlign":59},[1651],{"text":1652,"type":362},"When a customer cancels an express checkout option.",{"type":932,"attrs":1654,"content":1655},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[1656],{"type":357,"attrs":1657,"content":1658},{"textAlign":59},[1659,1662,1663],{"text":1588,"type":362,"marks":1660},[1661],{"type":390},{"text":1629,"type":362},{"text":1594,"type":362,"marks":1664},[1665],{"type":390},{"type":901,"content":1667},[1668,1678,1686],{"type":932,"attrs":1669,"content":1670},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[1671],{"type":357,"attrs":1672,"content":1673},{"textAlign":59},[1674],{"text":1675,"type":362,"marks":1676},"express-checkout-error",[1677],{"type":390},{"type":932,"attrs":1679,"content":1680},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[1681],{"type":357,"attrs":1682,"content":1683},{"textAlign":59},[1684],{"text":1685,"type":362},"When an express checkout option errors.",{"type":932,"attrs":1687,"content":1688},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[1689],{"type":357,"attrs":1690,"content":1691},{"textAlign":59},[1692,1695,1696,1699,1700,1704],{"text":1588,"type":362,"marks":1693},[1694],{"type":390},{"text":1629,"type":362},{"text":1594,"type":362,"marks":1697},[1698],{"type":390},{"text":1629,"type":362},{"text":1701,"type":362,"marks":1702},"reason",[1703],{"type":390},{"text":1705,"type":362}," — the failure reason, if available",{"type":364,"attrs":1707,"content":1708},{"level":893,"textAlign":59},[1709],{"text":1710,"type":362},"Customer events",{"type":357,"attrs":1712,"content":1713},{"textAlign":59},[1714],{"text":1715,"type":362},"Fired on both the cart and the checkout.",{"type":898,"content":1717},[1718,1741,1773,1800,1827,1862],{"type":901,"content":1719},[1720,1727,1734],{"type":904,"attrs":1721,"content":1722},{"colspan":906,"rowspan":906,"colwidth":59},[1723],{"type":357,"attrs":1724,"content":1725},{"textAlign":59},[1726],{"text":912,"type":362},{"type":904,"attrs":1728,"content":1729},{"colspan":906,"rowspan":906,"colwidth":59},[1730],{"type":357,"attrs":1731,"content":1732},{"textAlign":59},[1733],{"text":920,"type":362},{"type":904,"attrs":1735,"content":1736},{"colspan":906,"rowspan":906,"colwidth":59},[1737],{"type":357,"attrs":1738,"content":1739},{"textAlign":59},[1740],{"text":928,"type":362},{"type":901,"content":1742},[1743,1753,1761],{"type":932,"attrs":1744,"content":1745},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[1746],{"type":357,"attrs":1747,"content":1748},{"textAlign":59},[1749],{"text":1750,"type":362,"marks":1751},"customer-email-update",[1752],{"type":390},{"type":932,"attrs":1754,"content":1755},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[1756],{"type":357,"attrs":1757,"content":1758},{"textAlign":59},[1759],{"text":1760,"type":362},"When an entered email address is checked.",{"type":932,"attrs":1762,"content":1763},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[1764],{"type":357,"attrs":1765,"content":1766},{"textAlign":59},[1767,1771],{"text":1768,"type":362,"marks":1769},"customer_email",[1770],{"type":390},{"text":1772,"type":362}," — the email address entered",{"type":901,"content":1774},[1775,1785,1793],{"type":932,"attrs":1776,"content":1777},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[1778],{"type":357,"attrs":1779,"content":1780},{"textAlign":59},[1781],{"text":1782,"type":362,"marks":1783},"customer-login",[1784],{"type":390},{"type":932,"attrs":1786,"content":1787},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[1788],{"type":357,"attrs":1789,"content":1790},{"textAlign":59},[1791],{"text":1792,"type":362},"When a returning customer successfully logs in.",{"type":932,"attrs":1794,"content":1795},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[1796],{"type":357,"attrs":1797,"content":1798},{"textAlign":59},[1799],{"text":1068,"type":362},{"type":901,"content":1801},[1802,1812,1820],{"type":932,"attrs":1803,"content":1804},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[1805],{"type":357,"attrs":1806,"content":1807},{"textAlign":59},[1808],{"text":1809,"type":362,"marks":1810},"customer-address-update",[1811],{"type":390},{"type":932,"attrs":1813,"content":1814},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[1815],{"type":357,"attrs":1816,"content":1817},{"textAlign":59},[1818],{"text":1819,"type":362},"When a complete address is entered for an address type (e.g. billing\u002Fshipping).",{"type":932,"attrs":1821,"content":1822},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[1823],{"type":357,"attrs":1824,"content":1825},{"textAlign":59},[1826],{"text":1068,"type":362},{"type":901,"content":1828},[1829,1839,1847],{"type":932,"attrs":1830,"content":1831},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[1832],{"type":357,"attrs":1833,"content":1834},{"textAlign":59},[1835],{"text":1836,"type":362,"marks":1837},"customer-address-change",[1838],{"type":390},{"type":932,"attrs":1840,"content":1841},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[1842],{"type":357,"attrs":1843,"content":1844},{"textAlign":59},[1845],{"text":1846,"type":362},"When any customer address field is changed.",{"type":932,"attrs":1848,"content":1849},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[1850],{"type":357,"attrs":1851,"content":1852},{"textAlign":59},[1853,1856,1857,1860],{"text":1390,"type":362,"marks":1854},[1855],{"type":390},{"text":1554,"type":362},{"text":1402,"type":362,"marks":1858},[1859],{"type":390},{"text":1861,"type":362}," — JSON object of changed fields",{"type":901,"content":1863},[1864,1874,1882],{"type":932,"attrs":1865,"content":1866},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[1867],{"type":357,"attrs":1868,"content":1869},{"textAlign":59},[1870],{"text":1871,"type":362,"marks":1872},"customer-shipping-option-select",[1873],{"type":390},{"type":932,"attrs":1875,"content":1876},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[1877],{"type":357,"attrs":1878,"content":1879},{"textAlign":59},[1880],{"text":1881,"type":362},"When a customer selects a shipping rate.",{"type":932,"attrs":1883,"content":1884},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[1885],{"type":357,"attrs":1886,"content":1887},{"textAlign":59},[1888,1890,1893],{"text":1889,"type":362},"Parameters set to the contents of the address object (e.g. ",{"text":1396,"type":362,"marks":1891},[1892],{"type":390},{"text":1412,"type":362},{"type":364,"attrs":1895,"content":1896},{"level":893,"textAlign":59},[1897],{"text":1898,"type":362},"Analytics events",{"type":357,"attrs":1900,"content":1901},{"textAlign":59},[1902],{"text":1903,"type":362},"Fired on the cart, checkout, and receipt.",{"type":898,"content":1905},[1906,1929],{"type":901,"content":1907},[1908,1915,1922],{"type":904,"attrs":1909,"content":1910},{"colspan":906,"rowspan":906,"colwidth":59},[1911],{"type":357,"attrs":1912,"content":1913},{"textAlign":59},[1914],{"text":912,"type":362},{"type":904,"attrs":1916,"content":1917},{"colspan":906,"rowspan":906,"colwidth":59},[1918],{"type":357,"attrs":1919,"content":1920},{"textAlign":59},[1921],{"text":920,"type":362},{"type":904,"attrs":1923,"content":1924},{"colspan":906,"rowspan":906,"colwidth":59},[1925],{"type":357,"attrs":1926,"content":1927},{"textAlign":59},[1928],{"text":928,"type":362},{"type":901,"content":1930},[1931,1941,1949],{"type":932,"attrs":1932,"content":1933},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[1934],{"type":357,"attrs":1935,"content":1936},{"textAlign":59},[1937],{"text":1938,"type":362,"marks":1939},"analytics-gtm-datalayer",[1940],{"type":390},{"type":932,"attrs":1942,"content":1943},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[1944],{"type":357,"attrs":1945,"content":1946},{"textAlign":59},[1947],{"text":1948,"type":362},"Fires before adding an entry to the dataLayer for GTM integrations, allowing you to modify the data added for custom tracking.",{"type":932,"attrs":1950,"content":1951},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[1952],{"type":357,"attrs":1953,"content":1954},{"textAlign":59},[1955,1959,1961,1965,1967,1971,1973,1977],{"text":1956,"type":362,"marks":1957},"event_data",[1958],{"type":390},{"text":1960,"type":362}," — JSON object of the data being added, including ",{"text":1962,"type":362,"marks":1963},"event",[1964],{"type":390},{"text":1966,"type":362}," (the event being tracked), ",{"text":1968,"type":362,"marks":1969},"ecommerce",[1970],{"type":390},{"text":1972,"type":362}," (event data), and ",{"text":1974,"type":362,"marks":1975},"virtual_page_location",[1976],{"type":390},{"text":1978,"type":362}," (URL tracked as the virtual page location)",{"type":364,"attrs":1980,"content":1981},{"level":366,"textAlign":59},[1982],{"text":1983,"type":362},"Usage examples",{"type":364,"attrs":1985,"content":1986},{"level":893,"textAlign":59},[1987],{"text":1988,"type":362},"Pausing and canceling the event queue",{"type":357,"attrs":1990,"content":1991},{"textAlign":59},[1992,1994,1998],{"text":1993,"type":362},"Synchronous handlers can return ",{"text":1995,"type":362,"marks":1996},"false",[1997],{"type":390},{"text":1999,"type":362}," to stop processing:",{"type":376,"attrs":2001,"content":2002},{"class":59},[2003],{"text":2004,"type":362},"FC.client.on('cart-item-remove', function (params) {\n  if (params.itemPrice == 0) {\n    alert('You cannot remove free products from your cart');\n    return false;\n  }\n});\n",{"type":357,"attrs":2006,"content":2007},{"textAlign":59},[2008,2010,2014,2016,2020,2022,2026],{"text":2009,"type":362},"Declare a handler with a second parameter (conventionally ",{"text":2011,"type":362,"marks":2012},"next",[2013],{"type":390},{"text":2015,"type":362},") to make it asynchronous. The event queue pauses until ",{"text":2017,"type":362,"marks":2018},"next()",[2019],{"type":390},{"text":2021,"type":362}," is called to continue, or ",{"text":2023,"type":362,"marks":2024},"next(false)",[2025],{"type":390},{"text":2027,"type":362}," to stop it. A returned value from an asynchronous handler is ignored:",{"type":376,"attrs":2029,"content":2030},{"class":59},[2031],{"text":2032,"type":362},"FC.client.on('cart-coupon-add', function (params, next) {\n  $.ajax({\n    type: 'get',\n    url: 'http:\u002F\u002Fapi.example.com\u002Fcheck-coupon-availability',\n    dataType: 'jsonp',\n    data: { couponCode: params.couponCode }\n  }).done(function (data) {\n    if (data.ok) {\n      next();\n    } else {\n      alert('Sorry, your coupon is not available today.');\n      next(false);\n    }\n  });\n}).on('cart-coupon-add.done', function (params) {\n  alert('Coupon ' + params.couponCode + ' has been added');\n});\n",{"type":364,"attrs":2034,"content":2035},{"level":893,"textAlign":59},[2036],{"text":2037,"type":362},"Getting an event",{"type":376,"attrs":2039,"content":2040},{"class":59},[2041],{"text":2042,"type":362},"var event = FC.client.event('cart-item-remove');\n",{"type":364,"attrs":2044,"content":2045},{"level":893,"textAlign":59},[2046],{"text":2047,"type":362},"Overriding the default action",{"type":376,"attrs":2049,"content":2050},{"class":59},[2051],{"text":2052,"type":362},"FC.client.event('cart-item-remove').override(newDefaultHandler);\n",{"type":364,"attrs":2054,"content":2055},{"level":893,"textAlign":59},[2056],{"text":2057,"type":362},"Creating and triggering a custom event",{"type":376,"attrs":2059,"content":2060},{"class":59},[2061],{"text":2062,"type":362},"FC.client.wrap('your-own-event', function (params) {\n  \u002F\u002F body\n});\nFC.client.event('your-own-event').trigger(params);\n",{"type":364,"attrs":2064,"content":2065},{"level":893,"textAlign":59},[2066],{"text":2067,"type":362},"Validating a checkout field",{"type":357,"attrs":2069,"content":2070},{"textAlign":59},[2071,2073,2077,2079,2083],{"text":2072,"type":362},"This example requires a value on a ",{"text":2074,"type":362,"marks":2075},"date",[2076],{"type":390},{"text":2078,"type":362}," input inside a form with ",{"text":2080,"type":362,"marks":2081},"id=\"my-specific-form\"",[2082],{"type":390},{"text":2084,"type":362}," before allowing the checkout to submit:",{"type":376,"attrs":2086,"content":2087},{"class":59},[2088],{"text":2089,"type":362},"var FC = FC || {};\nFC.onLoad = function () {\n  FC.client.on('cart-submit', function (params, next) {\n    $element = $(params.element);\n    if (\n      $element.attr('id') == 'my-specific-form'\n      && $element.find('[name=\"date\"]').length > 0\n      && !$element.find('[name=\"date\"]').val()\n    ) {\n      alert('Date must be filled out');\n    } else {\n      next();\n    }\n  });\n};\n",{"type":364,"attrs":2091,"content":2092},{"level":893,"textAlign":59},[2093],{"text":2094,"type":362},"Preventing an add-to-cart with custom criteria",{"type":357,"attrs":2096,"content":2097},{"textAlign":59},[2098,2100,2104,2106,2110],{"text":2099,"type":362},"This example prevents adding a product from category ",{"text":2101,"type":362,"marks":2102},"Product2",[2103],{"type":390},{"text":2105,"type":362}," if the cart already contains a product from category ",{"text":2107,"type":362,"marks":2108},"Product1",[2109],{"type":390},{"text":603,"type":362},{"type":376,"attrs":2112,"content":2113},{"class":59},[2114],{"text":2115,"type":362},"FC.client.on('cart-submit', function (params, next) {\n  var product1_exists = false;\n  if (!jQuery.isEmptyObject(FC.json.items)) {\n    jQuery.each(FC.json.items, function (i, item) {\n      if (item.category == 'Product1') {\n        product1_exists = true;\n      }\n    });\n  }\n  if (params.data.category == 'Product2' && product1_exists) {\n    next(false);\n  } else {\n    next(true);\n  }\n});\n",{"type":364,"attrs":2117,"content":2118},{"level":366,"textAlign":59},[2119],{"text":467,"type":362},{"type":405,"content":2121},[2122,2146,2153],{"type":408,"content":2123},[2124],{"type":357,"attrs":2125,"content":2126},{"textAlign":59},[2127,2129,2133,2135,2139,2141,2144],{"text":2128,"type":362},"All events are accessed through ",{"text":2130,"type":362,"marks":2131},"FC.client",[2132],{"type":390},{"text":2134,"type":362},", which must be ready before binding — see ",{"text":455,"type":362,"marks":2136},[2137],{"type":458,"attrs":2138},{"href":460,"uuid":59,"anchor":59,"target":59,"linktype":31},{"text":2140,"type":362}," for using ",{"text":599,"type":362,"marks":2142},[2143],{"type":390},{"text":2145,"type":362}," to ensure this.",{"type":408,"content":2147},[2148],{"type":357,"attrs":2149,"content":2150},{"textAlign":59},[2151],{"text":2152,"type":362},"Not every event has parameters — where none are listed above, the handler receives no arguments.",{"type":408,"content":2154},[2155],{"type":357,"attrs":2156,"content":2157},{"textAlign":59},[2158],{"text":2159,"type":362},"If you find an event you need that isn’t listed here, contact Foxy support.",{"id":59,"alt":59,"name":13,"focus":59,"title":59,"source":59,"filename":13,"copyright":59,"fieldtype":81,"meta_data":2161},{},"The full list of Foxy JavaScript events available on the cart, checkout, and receipt, and how to bind, override, and trigger them.",[],"javascript-events-reference","help\u002Farticles\u002Fjavascript-events-reference",-4040,[],"a6682575-6a7f-48cf-8089-51f70b54e528",[],{"name":2171,"created_at":2172,"published_at":2173,"updated_at":2174,"id":2175,"uuid":2176,"content":2177,"slug":3437,"full_slug":3438,"sort_by_date":59,"position":3439,"tag_list":3440,"is_startpage":24,"parent_id":505,"meta_data":59,"group_id":3441,"first_published_at":2173,"release_id":59,"lang":65,"path":59,"alternates":3442,"default_full_slug":59,"translated_slugs":59},"JavaScript naming and file structure reference","2026-07-20T21:29:10.496Z","2026-07-20T21:42:37.675Z","2026-07-20T21:42:37.696Z",200267163689719,"7f2f44ba-f45c-4fd3-93e8-6c90bffdd952",{"_uid":2178,"body":2179,"name":2171,"image":3433,"pinned":24,"summary":3435,"category":320,"component":266,"related_articles":3436},"e1487b8f-c405-4b01-beba-c3cbeaae09ee",{"type":354,"content":2180},[2181,2186,2191,2441,2446,2583,2588,2652,2657,2662,2672,3194,3199,3278,3283,3291,3348,3377,3387,3407],{"type":364,"attrs":2182,"content":2183},{"level":366,"textAlign":59},[2184],{"text":2185,"type":362},"JavaScript naming conventions",{"type":357,"attrs":2187,"content":2188},{"textAlign":59},[2189],{"text":2190,"type":362},"Similar to Google’s conventions, but using snake_case instead of camelCase for variable names.",{"type":898,"content":2192},[2193,2219,2247,2275,2303,2330,2357,2385,2413],{"type":901,"content":2194},[2195,2203,2211],{"type":904,"attrs":2196,"content":2197},{"colspan":906,"rowspan":906,"colwidth":59},[2198],{"type":357,"attrs":2199,"content":2200},{"textAlign":59},[2201],{"text":2202,"type":362},"Type",{"type":904,"attrs":2204,"content":2205},{"colspan":906,"rowspan":906,"colwidth":59},[2206],{"type":357,"attrs":2207,"content":2208},{"textAlign":59},[2209],{"text":2210,"type":362},"Convention",{"type":904,"attrs":2212,"content":2213},{"colspan":906,"rowspan":906,"colwidth":59},[2214],{"type":357,"attrs":2215,"content":2216},{"textAlign":59},[2217],{"text":2218,"type":362},"Example",{"type":901,"content":2220},[2221,2229,2237],{"type":932,"attrs":2222,"content":2223},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[2224],{"type":357,"attrs":2225,"content":2226},{"textAlign":59},[2227],{"text":2228,"type":362},"Function names",{"type":932,"attrs":2230,"content":2231},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[2232],{"type":357,"attrs":2233,"content":2234},{"textAlign":59},[2235],{"text":2236,"type":362},"camelCase",{"type":932,"attrs":2238,"content":2239},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[2240],{"type":357,"attrs":2241,"content":2242},{"textAlign":59},[2243],{"text":2244,"type":362,"marks":2245},"functionNamesLikeThis",[2246],{"type":390},{"type":901,"content":2248},[2249,2257,2265],{"type":932,"attrs":2250,"content":2251},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[2252],{"type":357,"attrs":2253,"content":2254},{"textAlign":59},[2255],{"text":2256,"type":362},"Variable names",{"type":932,"attrs":2258,"content":2259},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[2260],{"type":357,"attrs":2261,"content":2262},{"textAlign":59},[2263],{"text":2264,"type":362},"snake_case",{"type":932,"attrs":2266,"content":2267},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[2268],{"type":357,"attrs":2269,"content":2270},{"textAlign":59},[2271],{"text":2272,"type":362,"marks":2273},"variable_names_like_this",[2274],{"type":390},{"type":901,"content":2276},[2277,2285,2293],{"type":932,"attrs":2278,"content":2279},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[2280],{"type":357,"attrs":2281,"content":2282},{"textAlign":59},[2283],{"text":2284,"type":362},"Class names",{"type":932,"attrs":2286,"content":2287},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[2288],{"type":357,"attrs":2289,"content":2290},{"textAlign":59},[2291],{"text":2292,"type":362},"PascalCase",{"type":932,"attrs":2294,"content":2295},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[2296],{"type":357,"attrs":2297,"content":2298},{"textAlign":59},[2299],{"text":2300,"type":362,"marks":2301},"ClassNamesLikeThis",[2302],{"type":390},{"type":901,"content":2304},[2305,2313,2320],{"type":932,"attrs":2306,"content":2307},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[2308],{"type":357,"attrs":2309,"content":2310},{"textAlign":59},[2311],{"text":2312,"type":362},"Enum names",{"type":932,"attrs":2314,"content":2315},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[2316],{"type":357,"attrs":2317,"content":2318},{"textAlign":59},[2319],{"text":2292,"type":362},{"type":932,"attrs":2321,"content":2322},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[2323],{"type":357,"attrs":2324,"content":2325},{"textAlign":59},[2326],{"text":2327,"type":362,"marks":2328},"EnumNamesLikeThis",[2329],{"type":390},{"type":901,"content":2331},[2332,2340,2347],{"type":932,"attrs":2333,"content":2334},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[2335],{"type":357,"attrs":2336,"content":2337},{"textAlign":59},[2338],{"text":2339,"type":362},"Method names",{"type":932,"attrs":2341,"content":2342},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[2343],{"type":357,"attrs":2344,"content":2345},{"textAlign":59},[2346],{"text":2236,"type":362},{"type":932,"attrs":2348,"content":2349},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[2350],{"type":357,"attrs":2351,"content":2352},{"textAlign":59},[2353],{"text":2354,"type":362,"marks":2355},"methodNamesLikeThis",[2356],{"type":390},{"type":901,"content":2358},[2359,2367,2375],{"type":932,"attrs":2360,"content":2361},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[2362],{"type":357,"attrs":2363,"content":2364},{"textAlign":59},[2365],{"text":2366,"type":362},"Constant values",{"type":932,"attrs":2368,"content":2369},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[2370],{"type":357,"attrs":2371,"content":2372},{"textAlign":59},[2373],{"text":2374,"type":362},"UPPER_SNAKE_CASE",{"type":932,"attrs":2376,"content":2377},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[2378],{"type":357,"attrs":2379,"content":2380},{"textAlign":59},[2381],{"text":2382,"type":362,"marks":2383},"CONSTANT_VALUES_LIKE_THIS",[2384],{"type":390},{"type":901,"content":2386},[2387,2395,2403],{"type":932,"attrs":2388,"content":2389},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[2390],{"type":357,"attrs":2391,"content":2392},{"textAlign":59},[2393],{"text":2394,"type":362},"Namespaced names",{"type":932,"attrs":2396,"content":2397},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[2398],{"type":357,"attrs":2399,"content":2400},{"textAlign":59},[2401],{"text":2402,"type":362},"dot notation, camelCase",{"type":932,"attrs":2404,"content":2405},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[2406],{"type":357,"attrs":2407,"content":2408},{"textAlign":59},[2409],{"text":2410,"type":362,"marks":2411},"foo.namespaceNamesLikeThis.bar",[2412],{"type":390},{"type":901,"content":2414},[2415,2423,2431],{"type":932,"attrs":2416,"content":2417},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[2418],{"type":357,"attrs":2419,"content":2420},{"textAlign":59},[2421],{"text":2422,"type":362},"File names",{"type":932,"attrs":2424,"content":2425},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[2426],{"type":357,"attrs":2427,"content":2428},{"textAlign":59},[2429],{"text":2430,"type":362},"lowercase, no separator",{"type":932,"attrs":2432,"content":2433},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[2434],{"type":357,"attrs":2435,"content":2436},{"textAlign":59},[2437],{"text":2438,"type":362,"marks":2439},"filenameslikethis.js",[2440],{"type":390},{"type":364,"attrs":2442,"content":2443},{"level":366,"textAlign":59},[2444],{"text":2445,"type":362},"Event naming conventions",{"type":405,"content":2447},[2448,2465,2472,2566],{"type":408,"content":2449},[2450],{"type":357,"attrs":2451,"content":2452},{"textAlign":59},[2453,2455,2458,2460,2464],{"text":2454,"type":362},"Present tense, like standard JavaScript events — ",{"text":1245,"type":362,"marks":2456},[2457],{"type":390},{"text":2459,"type":362},", not ",{"text":2461,"type":362,"marks":2462},"cart-coupon-added",[2463],{"type":390},{"text":496,"type":362},{"type":408,"content":2466},[2467],{"type":357,"attrs":2468,"content":2469},{"textAlign":59},[2470],{"text":2471,"type":362},"Hyphens separate the parts of the event name.",{"type":408,"content":2473},[2474],{"type":357,"attrs":2475,"content":2476},{"textAlign":59},[2477,2479,2484,2486,2490,2492,2496,2497,2501,2503,2507,2508,2512,2513,2517,2518,2521,2523,2527,2529,2533,2535,2538,2540,2544,2545,2549,2550,2554,2555,2559,2560,2564],{"text":2478,"type":362},"Names follow this order: ",{"text":2480,"type":362,"marks":2481},"section",[2482],{"type":2483},"bold",{"text":2485,"type":362}," (",{"text":2487,"type":362,"marks":2488},"cart",[2489],{"type":390},{"text":2491,"type":362},", ",{"text":2493,"type":362,"marks":2494},"checkout",[2495],{"type":390},{"text":2491,"type":362},{"text":2498,"type":362,"marks":2499},"receipt",[2500],{"type":390},{"text":2502,"type":362},"), ",{"text":2504,"type":362,"marks":2505},"noun",[2506],{"type":2483},{"text":2485,"type":362},{"text":2509,"type":362,"marks":2510},"coupon",[2511],{"type":390},{"text":2491,"type":362},{"text":2514,"type":362,"marks":2515},"email",[2516],{"type":390},{"text":2491,"type":362},{"text":1390,"type":362,"marks":2519},[2520],{"type":390},{"text":2522,"type":362},", etc.), ",{"text":2524,"type":362,"marks":2525},"modifier\u002Fattribute",[2526],{"type":2483},{"text":2528,"type":362}," if applicable (e.g. ",{"text":2530,"type":362,"marks":2531},"cart-item-quantity",[2532],{"type":390},{"text":2534,"type":362},", where ",{"text":1200,"type":362,"marks":2536},[2537],{"type":390},{"text":2539,"type":362}," is the attribute of the item), then ",{"text":2541,"type":362,"marks":2542},"verb",[2543],{"type":2483},{"text":2485,"type":362},{"text":2546,"type":362,"marks":2547},"add",[2548],{"type":390},{"text":2491,"type":362},{"text":2551,"type":362,"marks":2552},"remove",[2553],{"type":390},{"text":2491,"type":362},{"text":2556,"type":362,"marks":2557},"update",[2558],{"type":390},{"text":2491,"type":362},{"text":2561,"type":362,"marks":2562},"change",[2563],{"type":390},{"text":2565,"type":362},", etc.).",{"type":408,"content":2567},[2568],{"type":357,"attrs":2569,"content":2570},{"textAlign":59},[2571,2573,2576,2578,2582],{"text":2572,"type":362},"The “after” event gets the ",{"text":876,"type":362,"marks":2574},[2575],{"type":390},{"text":2577,"type":362}," suffix: ",{"text":2579,"type":362,"marks":2580},"client.on(\"cart-item-remove.done\", handler)",[2581],{"type":390},{"text":496,"type":362},{"type":364,"attrs":2584,"content":2585},{"level":366,"textAlign":59},[2586],{"text":2587,"type":362},"What counts as an event",{"type":405,"content":2589},[2590,2597,2638,2645],{"type":408,"content":2591},[2592],{"type":357,"attrs":2593,"content":2594},{"textAlign":59},[2595],{"text":2596,"type":362},"Anything in an init method.",{"type":408,"content":2598},[2599],{"type":357,"attrs":2600,"content":2601},{"textAlign":59},[2602,2604,2607,2608,2612,2613,2617,2618,2622,2623,2627,2628,2632,2633,2637],{"text":2603,"type":362},"Anything on ",{"text":2561,"type":362,"marks":2605},[2606],{"type":390},{"text":2491,"type":362},{"text":2609,"type":362,"marks":2610},"click",[2611],{"type":390},{"text":2491,"type":362},{"text":2614,"type":362,"marks":2615},"keyup",[2616],{"type":390},{"text":747,"type":362},{"text":2619,"type":362,"marks":2620},"keydown",[2621],{"type":390},{"text":2491,"type":362},{"text":2624,"type":362,"marks":2625},"blur",[2626],{"type":390},{"text":2491,"type":362},{"text":2629,"type":362,"marks":2630},"focusin",[2631],{"type":390},{"text":747,"type":362},{"text":2634,"type":362,"marks":2635},"focusout",[2636],{"type":390},{"text":496,"type":362},{"type":408,"content":2639},[2640],{"type":357,"attrs":2641,"content":2642},{"textAlign":59},[2643],{"text":2644,"type":362},"Rendering.",{"type":408,"content":2646},[2647],{"type":357,"attrs":2648,"content":2649},{"textAlign":59},[2650],{"text":2651,"type":362},"Interactions with API JSON.",{"type":357,"attrs":2653,"content":2654},{"textAlign":59},[2655],{"text":2656,"type":362},"Selectors are not events — they return a string, not a triggerable action.",{"type":364,"attrs":2658,"content":2659},{"level":366,"textAlign":59},[2660],{"text":2661,"type":362},"File structure",{"type":357,"attrs":2663,"content":2664},{"textAlign":59},[2665,2667,2671],{"text":2666,"type":362},"Internal source files used to compile Foxy’s external JavaScript. Source files are available at ",{"text":2668,"type":362,"marks":2669},"admin.foxycart.com\u002Fstatic\u002Fv\u002F2.0.0\u002Fjs\u002Fsrc\u002F",[2670],{"type":390},{"text":496,"type":362},{"type":898,"content":2673},[2674,2708,2767,2829,2864,2905,2939,2973,3006,3040,3079,3113,3147],{"type":901,"content":2675},[2676,2684,2692,2700],{"type":904,"attrs":2677,"content":2678},{"colspan":906,"rowspan":906,"colwidth":59},[2679],{"type":357,"attrs":2680,"content":2681},{"textAlign":59},[2682],{"text":2683,"type":362},"File",{"type":904,"attrs":2685,"content":2686},{"colspan":906,"rowspan":906,"colwidth":59},[2687],{"type":357,"attrs":2688,"content":2689},{"textAlign":59},[2690],{"text":2691,"type":362},"Purpose",{"type":904,"attrs":2693,"content":2694},{"colspan":906,"rowspan":906,"colwidth":59},[2695],{"type":357,"attrs":2696,"content":2697},{"textAlign":59},[2698],{"text":2699,"type":362},"Internal methods",{"type":904,"attrs":2701,"content":2702},{"colspan":906,"rowspan":906,"colwidth":59},[2703],{"type":357,"attrs":2704,"content":2705},{"textAlign":59},[2706],{"text":2707,"type":362},"Events",{"type":901,"content":2709},[2710,2720,2734,2759],{"type":932,"attrs":2711,"content":2712},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[2713],{"type":357,"attrs":2714,"content":2715},{"textAlign":59},[2716],{"text":2717,"type":362,"marks":2718},"fc.api.js",[2719],{"type":390},{"type":932,"attrs":2721,"content":2722},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[2723],{"type":357,"attrs":2724,"content":2725},{"textAlign":59},[2726,2728,2732],{"text":2727,"type":362},"Methods that make requests to the ",{"text":2729,"type":362,"marks":2730},"api_json.php",[2731],{"type":390},{"text":2733,"type":362}," endpoint.",{"type":932,"attrs":2735,"content":2736},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[2737],{"type":357,"attrs":2738,"content":2739},{"textAlign":59},[2740,2744,2745,2749,2750,2754,2755],{"text":2741,"type":362,"marks":2742},"saveContactInfo",[2743],{"type":390},{"text":2491,"type":362},{"text":2746,"type":362,"marks":2747},"saveShippingServiceInfo",[2748],{"type":390},{"text":2491,"type":362},{"text":2751,"type":362,"marks":2752},"getShippingOptions",[2753],{"type":390},{"text":2491,"type":362},{"text":2756,"type":362,"marks":2757},"getTaxes",[2758],{"type":390},{"type":932,"attrs":2760,"content":2761},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[2762],{"type":357,"attrs":2763,"content":2764},{"textAlign":59},[2765],{"text":2766,"type":362},"none",{"type":901,"content":2768},[2769,2779,2792,2799],{"type":932,"attrs":2770,"content":2771},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[2772],{"type":357,"attrs":2773,"content":2774},{"textAlign":59},[2775],{"text":2776,"type":362,"marks":2777},"fc.cart.js",[2778],{"type":390},{"type":932,"attrs":2780,"content":2781},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[2782],{"type":357,"attrs":2783,"content":2784},{"textAlign":59},[2785,2786,2790],{"text":2727,"type":362},{"text":2787,"type":362,"marks":2788},"\u002Fcart",[2789],{"type":390},{"text":2791,"type":362}," endpoint and update the cart template via Twig.js; cart DOM initialization.",{"type":932,"attrs":2793,"content":2794},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[2795],{"type":357,"attrs":2796,"content":2797},{"textAlign":59},[2798],{"text":1068,"type":362},{"type":932,"attrs":2800,"content":2801},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[2802],{"type":357,"attrs":2803,"content":2804},{"textAlign":59},[2805,2808,2809,2812,2813,2816,2817,2820,2821,2825,2826],{"text":1176,"type":362,"marks":2806},[2807],{"type":390},{"text":2491,"type":362},{"text":1214,"type":362,"marks":2810},[2811],{"type":390},{"text":2491,"type":362},{"text":1245,"type":362,"marks":2814},[2815],{"type":390},{"text":2491,"type":362},{"text":1276,"type":362,"marks":2818},[2819],{"type":390},{"text":2491,"type":362},{"text":2822,"type":362,"marks":2823},"customer-shipping-options-update",[2824],{"type":390},{"text":2491,"type":362},{"text":1809,"type":362,"marks":2827},[2828],{"type":390},{"type":901,"content":2830},[2831,2841,2849,2856],{"type":932,"attrs":2832,"content":2833},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[2834],{"type":357,"attrs":2835,"content":2836},{"textAlign":59},[2837],{"text":2838,"type":362,"marks":2839},"fc.checkout.js",[2840],{"type":390},{"type":932,"attrs":2842,"content":2843},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[2844],{"type":357,"attrs":2845,"content":2846},{"textAlign":59},[2847],{"text":2848,"type":362},"Checkout page initialization and methods.",{"type":932,"attrs":2850,"content":2851},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[2852],{"type":357,"attrs":2853,"content":2854},{"textAlign":59},[2855],{"text":1068,"type":362},{"type":932,"attrs":2857,"content":2858},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[2859],{"type":357,"attrs":2860,"content":2861},{"textAlign":59},[2862],{"text":2863,"type":362},"not yet documented",{"type":901,"content":2865},[2866,2876,2889,2896],{"type":932,"attrs":2867,"content":2868},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[2869],{"type":357,"attrs":2870,"content":2871},{"textAlign":59},[2872],{"text":2873,"type":362,"marks":2874},"fc.client.js",[2875],{"type":390},{"type":932,"attrs":2877,"content":2878},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[2879],{"type":357,"attrs":2880,"content":2881},{"textAlign":59},[2882,2884,2887],{"text":2883,"type":362},"Maintains and handles the ",{"text":525,"type":362,"marks":2885},[2886],{"type":390},{"text":2888,"type":362}," session value; prepares links and forms to submit to the cart.",{"type":932,"attrs":2890,"content":2891},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[2892],{"type":357,"attrs":2893,"content":2894},{"textAlign":59},[2895],{"text":1068,"type":362},{"type":932,"attrs":2897,"content":2898},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[2899],{"type":357,"attrs":2900,"content":2901},{"textAlign":59},[2902],{"text":1135,"type":362,"marks":2903},[2904],{"type":390},{"type":901,"content":2906},[2907,2917,2925,2932],{"type":932,"attrs":2908,"content":2909},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[2910],{"type":357,"attrs":2911,"content":2912},{"textAlign":59},[2913],{"text":2914,"type":362,"marks":2915},"fc.event.js",[2916],{"type":390},{"type":932,"attrs":2918,"content":2919},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[2920],{"type":357,"attrs":2921,"content":2922},{"textAlign":59},[2923],{"text":2924,"type":362},"Defines the event model.",{"type":932,"attrs":2926,"content":2927},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[2928],{"type":357,"attrs":2929,"content":2930},{"textAlign":59},[2931],{"text":1068,"type":362},{"type":932,"attrs":2933,"content":2934},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[2935],{"type":357,"attrs":2936,"content":2937},{"textAlign":59},[2938],{"text":1068,"type":362},{"type":901,"content":2940},[2941,2951,2959,2966],{"type":932,"attrs":2942,"content":2943},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[2944],{"type":357,"attrs":2945,"content":2946},{"textAlign":59},[2947],{"text":2948,"type":362,"marks":2949},"fc.locations.js",[2950],{"type":390},{"type":932,"attrs":2952,"content":2953},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[2954],{"type":357,"attrs":2955,"content":2956},{"textAlign":59},[2957],{"text":2958,"type":362},"Shipping and billing country\u002Fstate\u002Fprovince\u002Fregion functionality.",{"type":932,"attrs":2960,"content":2961},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[2962],{"type":357,"attrs":2963,"content":2964},{"textAlign":59},[2965],{"text":1068,"type":362},{"type":932,"attrs":2967,"content":2968},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[2969],{"type":357,"attrs":2970,"content":2971},{"textAlign":59},[2972],{"text":2766,"type":362},{"type":901,"content":2974},[2975,2985,2993,2998],{"type":932,"attrs":2976,"content":2977},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[2978],{"type":357,"attrs":2979,"content":2980},{"textAlign":59},[2981],{"text":2982,"type":362,"marks":2983},"fc.namespace.js",[2984],{"type":390},{"type":932,"attrs":2986,"content":2987},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[2988],{"type":357,"attrs":2989,"content":2990},{"textAlign":59},[2991],{"text":2992,"type":362},"Declares `var FC = FC",{"type":932,"attrs":2994,"content":2995},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[2996],{"type":357,"attrs":2997},{"textAlign":59},{"type":932,"attrs":2999,"content":3000},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[3001],{"type":357,"attrs":3002,"content":3003},{"textAlign":59},[3004],{"text":3005,"type":362},"{};`",{"type":901,"content":3007},[3008,3018,3026,3033],{"type":932,"attrs":3009,"content":3010},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[3011],{"type":357,"attrs":3012,"content":3013},{"textAlign":59},[3014],{"text":3015,"type":362,"marks":3016},"fc.postal-code.js",[3017],{"type":390},{"type":932,"attrs":3019,"content":3020},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[3021],{"type":357,"attrs":3022,"content":3023},{"textAlign":59},[3024],{"text":3025,"type":362},"Postal code → city + state\u002Fregion lookup.",{"type":932,"attrs":3027,"content":3028},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[3029],{"type":357,"attrs":3030,"content":3031},{"textAlign":59},[3032],{"text":1068,"type":362},{"type":932,"attrs":3034,"content":3035},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[3036],{"type":357,"attrs":3037,"content":3038},{"textAlign":59},[3039],{"text":1068,"type":362},{"type":901,"content":3041},[3042,3052,3065,3072],{"type":932,"attrs":3043,"content":3044},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[3045],{"type":357,"attrs":3046,"content":3047},{"textAlign":59},[3048],{"text":3049,"type":362,"marks":3050},"fc.session.js",[3051],{"type":390},{"type":932,"attrs":3053,"content":3054},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[3055],{"type":357,"attrs":3056,"content":3057},{"textAlign":59},[3058,3060,3063],{"text":3059,"type":362},"Sets the ",{"text":525,"type":362,"marks":3061},[3062],{"type":390},{"text":3064,"type":362}," cookie.",{"type":932,"attrs":3066,"content":3067},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[3068],{"type":357,"attrs":3069,"content":3070},{"textAlign":59},[3071],{"text":1068,"type":362},{"type":932,"attrs":3073,"content":3074},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[3075],{"type":357,"attrs":3076,"content":3077},{"textAlign":59},[3078],{"text":1068,"type":362},{"type":901,"content":3080},[3081,3091,3099,3106],{"type":932,"attrs":3082,"content":3083},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[3084],{"type":357,"attrs":3085,"content":3086},{"textAlign":59},[3087],{"text":3088,"type":362,"marks":3089},"fc.sidecart.js",[3090],{"type":390},{"type":932,"attrs":3092,"content":3093},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[3094],{"type":357,"attrs":3095,"content":3096},{"textAlign":59},[3097],{"text":3098,"type":362},"Everything related to the Sidecart approach.",{"type":932,"attrs":3100,"content":3101},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[3102],{"type":357,"attrs":3103,"content":3104},{"textAlign":59},[3105],{"text":1068,"type":362},{"type":932,"attrs":3107,"content":3108},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[3109],{"type":357,"attrs":3110,"content":3111},{"textAlign":59},[3112],{"text":1068,"type":362},{"type":901,"content":3114},[3115,3125,3133,3140],{"type":932,"attrs":3116,"content":3117},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[3118],{"type":357,"attrs":3119,"content":3120},{"textAlign":59},[3121],{"text":3122,"type":362,"marks":3123},"fc.template.js",[3124],{"type":390},{"type":932,"attrs":3126,"content":3127},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[3128],{"type":357,"attrs":3129,"content":3130},{"textAlign":59},[3131],{"text":3132,"type":362},"Twig.js-related methods, including custom Twig.js methods that mirror custom server-side methods.",{"type":932,"attrs":3134,"content":3135},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[3136],{"type":357,"attrs":3137,"content":3138},{"textAlign":59},[3139],{"text":1068,"type":362},{"type":932,"attrs":3141,"content":3142},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[3143],{"type":357,"attrs":3144,"content":3145},{"textAlign":59},[3146],{"text":1068,"type":362},{"type":901,"content":3148},[3149,3159,3167,3187],{"type":932,"attrs":3150,"content":3151},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[3152],{"type":357,"attrs":3153,"content":3154},{"textAlign":59},[3155],{"text":3156,"type":362,"marks":3157},"fc.util.js",[3158],{"type":390},{"type":932,"attrs":3160,"content":3161},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[3162],{"type":357,"attrs":3163,"content":3164},{"textAlign":59},[3165],{"text":3166,"type":362},"Helper functions.",{"type":932,"attrs":3168,"content":3169},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[3170],{"type":357,"attrs":3171,"content":3172},{"textAlign":59},[3173,3177,3178,3182,3183],{"text":3174,"type":362,"marks":3175},"money_format",[3176],{"type":390},{"text":2491,"type":362},{"text":3179,"type":362,"marks":3180},"str_pad",[3181],{"type":390},{"text":2491,"type":362},{"text":3184,"type":362,"marks":3185},"unserialize",[3186],{"type":390},{"type":932,"attrs":3188,"content":3189},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[3190],{"type":357,"attrs":3191,"content":3192},{"textAlign":59},[3193],{"text":1068,"type":362},{"type":364,"attrs":3195,"content":3196},{"level":893,"textAlign":59},[3197],{"text":3198,"type":362},"External scripts",{"type":898,"content":3200},[3201,3218,3238,3258],{"type":901,"content":3202},[3203,3211],{"type":904,"attrs":3204,"content":3205},{"colspan":906,"rowspan":906,"colwidth":59},[3206],{"type":357,"attrs":3207,"content":3208},{"textAlign":59},[3209],{"text":3210,"type":362},"Script",{"type":904,"attrs":3212,"content":3213},{"colspan":906,"rowspan":906,"colwidth":59},[3214],{"type":357,"attrs":3215,"content":3216},{"textAlign":59},[3217],{"text":2691,"type":362},{"type":901,"content":3219},[3220,3230],{"type":932,"attrs":3221,"content":3222},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[3223],{"type":357,"attrs":3224,"content":3225},{"textAlign":59},[3226],{"text":3227,"type":362,"marks":3228},"foxycart.js",[3229],{"type":390},{"type":932,"attrs":3231,"content":3232},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[3233],{"type":357,"attrs":3234,"content":3235},{"textAlign":59},[3236],{"text":3237,"type":362},"Namespace, session management, events, and utilities.",{"type":901,"content":3239},[3240,3250],{"type":932,"attrs":3241,"content":3242},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[3243],{"type":357,"attrs":3244,"content":3245},{"textAlign":59},[3246],{"text":3247,"type":362,"marks":3248},"foxycart.jsonp.js",[3249],{"type":390},{"type":932,"attrs":3251,"content":3252},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[3253],{"type":357,"attrs":3254,"content":3255},{"textAlign":59},[3256],{"text":3257,"type":362},"Base for custom integrations and the default Sidecart approach.",{"type":901,"content":3259},[3260,3270],{"type":932,"attrs":3261,"content":3262},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[3263],{"type":357,"attrs":3264,"content":3265},{"textAlign":59},[3266],{"text":3267,"type":362,"marks":3268},"foxycart.jsonp.sidecart.js",[3269],{"type":390},{"type":932,"attrs":3271,"content":3272},{"colspan":906,"rowspan":906,"colwidth":59,"backgroundColor":59},[3273],{"type":357,"attrs":3274,"content":3275},{"textAlign":59},[3276],{"text":3277,"type":362},"The cart in a Sidecart approach.",{"type":364,"attrs":3279,"content":3280},{"level":366,"textAlign":59},[3281],{"text":3282,"type":362},"Pageload events and order of execution",{"type":357,"attrs":3284,"content":3285},{"textAlign":59},[3286,3289],{"text":449,"type":362,"marks":3287},[3288],{"type":390},{"text":3290,"type":362}," is called on pageload for any CDN-loaded, store-specific JavaScript, triggering the following sequence:",{"type":3292,"attrs":3293,"content":3294},"ordered_list",{"order":906},[3295,3304,3313,3330,3339],{"type":408,"content":3296},[3297],{"type":357,"attrs":3298,"content":3299},{"textAlign":59},[3300],{"text":3301,"type":362,"marks":3302},"FC.client.applySession()",[3303],{"type":390},{"type":408,"content":3305},[3306],{"type":357,"attrs":3307,"content":3308},{"textAlign":59},[3309],{"text":3310,"type":362,"marks":3311},"FC.client.preventDefaultActions()",[3312],{"type":390},{"type":408,"content":3314},[3315],{"type":357,"attrs":3316,"content":3317},{"textAlign":59},[3318,3320,3324,3326],{"text":3319,"type":362},"If ",{"text":3321,"type":362,"marks":3322},"context == cart",[3323],{"type":390},{"text":3325,"type":362},", then ",{"text":3327,"type":362,"marks":3328},"FC.client.updateCart()",[3329],{"type":390},{"type":408,"content":3331},[3332],{"type":357,"attrs":3333,"content":3334},{"textAlign":59},[3335],{"text":3336,"type":362,"marks":3337},"FC.client.event('ready').trigger()",[3338],{"type":390},{"type":408,"content":3340},[3341],{"type":357,"attrs":3342,"content":3343},{"textAlign":59},[3344],{"text":3345,"type":362,"marks":3346},"FC.client.updateMiniCart()",[3347],{"type":390},{"type":357,"attrs":3349,"content":3350},{"textAlign":59},[3351,3354,3356,3360,3362,3365,3367,3371,3373,3376],{"text":3327,"type":362,"marks":3352},[3353],{"type":390},{"text":3355,"type":362}," makes an ",{"text":3357,"type":362,"marks":3358},"FC.client.request",[3359],{"type":390},{"text":3361,"type":362}," to get the cart JSON. On completion, ",{"text":3357,"type":362,"marks":3363},[3364],{"type":390},{"text":3366,"type":362}," triggers ",{"text":3368,"type":362,"marks":3369},"FC.client.updateJSON()",[3370],{"type":390},{"text":3372,"type":362},", which in turn calls ",{"text":3345,"type":362,"marks":3374},[3375],{"type":390},{"text":496,"type":362},{"type":357,"attrs":3378,"content":3379},{"textAlign":59},[3380,3381,3385],{"text":678,"type":362},{"text":3382,"type":362,"marks":3383},"ready",[3384],{"type":390},{"text":3386,"type":362}," event then triggers:",{"type":405,"content":3388},[3389,3398],{"type":408,"content":3390},[3391],{"type":357,"attrs":3392,"content":3393},{"textAlign":59},[3394],{"text":3395,"type":362,"marks":3396},"FC.cart.updateConfig()",[3397],{"type":390},{"type":408,"content":3399},[3400],{"type":357,"attrs":3401,"content":3402},{"textAlign":59},[3403],{"text":3404,"type":362,"marks":3405},"FC.cart.updatePaymentInfoRequired()",[3406],{"type":390},{"type":357,"attrs":3408,"content":3409},{"textAlign":59},[3410,3413,3415,3419,3421,3425,3427,3431],{"text":3395,"type":362,"marks":3411},[3412],{"type":390},{"text":3414,"type":362}," checks and sets ",{"text":3416,"type":362,"marks":3417},"localStorage",[3418],{"type":390},{"text":3420,"type":362},", which triggers ",{"text":3422,"type":362,"marks":3423},"FC.client.requestConfig()",[3424],{"type":390},{"text":3426,"type":362}," — a call to ",{"text":3428,"type":362,"marks":3429},"FC.client._request",[3430],{"type":390},{"text":3432,"type":362}," that sets the config JSON with the updated data.",{"id":59,"alt":59,"name":13,"focus":59,"title":59,"source":59,"filename":13,"copyright":59,"fieldtype":81,"meta_data":3434},{},"Naming conventions for Foxy JavaScript variables and events, the internal file structure, and the pageload order of execution.",[],"javascript-naming-and-file-structure-reference","help\u002Farticles\u002Fjavascript-naming-and-file-structure-reference",-4050,[],"3b15bdbd-8d74-49dc-8695-aca00c3af00f",[],{"name":455,"created_at":3444,"published_at":3445,"updated_at":3446,"id":3447,"uuid":3448,"content":3449,"slug":3599,"full_slug":3600,"sort_by_date":59,"position":3601,"tag_list":3602,"is_startpage":24,"parent_id":505,"meta_data":59,"group_id":3603,"first_published_at":3445,"release_id":59,"lang":65,"path":59,"alternates":3604,"default_full_slug":59,"translated_slugs":59},"2026-07-20T21:18:43.964Z","2026-07-20T21:42:38.686Z","2026-07-20T21:42:38.705Z",200264597426917,"34e009b3-4db8-4b29-b1cf-fe950f672a2a",{"_uid":3450,"body":3451,"name":455,"image":3595,"pinned":24,"summary":3597,"category":320,"component":266,"related_articles":3598},"f7138a73-6164-42bd-a9a9-7e3e40e19336",{"type":354,"content":3452},[3453,3458,3463,3468,3484,3494,3499,3509,3520,3525],{"type":357,"attrs":3454,"content":3455},{"textAlign":59},[3456],{"text":3457,"type":362},"Foxy’s JavaScript powers the cart, checkout, and receipt — the same code runs whether it’s loaded on Foxy’s hosted pages or embedded on your own site. It’s modular and built around a unified event system, so you can hook into almost anything Foxy does without needing to modify Foxy’s own code.",{"type":357,"attrs":3459,"content":3460},{"textAlign":59},[3461],{"text":3462,"type":362},"Most stores never need to touch this directly — the default behavior covers the vast majority of use cases. This section is for custom integrations: reacting to cart or checkout activity, overriding default configuration, or rendering cart and checkout templates from your own code.",{"type":364,"attrs":3464,"content":3465},{"level":366,"textAlign":59},[3466],{"text":3467,"type":362},"The FC object",{"type":357,"attrs":3469,"content":3470},{"textAlign":59},[3471,3473,3477,3479,3482],{"text":3472,"type":362},"All of Foxy’s JavaScript functionality is exposed through a global ",{"text":3474,"type":362,"marks":3475},"FC",[3476],{"type":390},{"text":3478,"type":362}," object. Because Foxy’s JavaScript loads asynchronously, ",{"text":3474,"type":362,"marks":3480},[3481],{"type":390},{"text":3483,"type":362}," isn’t guaranteed to exist yet when your page first loads — so code that depends on it needs to wait until it’s ready.",{"type":357,"attrs":3485,"content":3486},{"textAlign":59},[3487,3489,3492],{"text":3488,"type":362},"The standard way to do this is with ",{"text":599,"type":362,"marks":3490},[3491],{"type":390},{"text":3493,"type":362},", a function you define that Foxy calls once, right before its own initialization runs:",{"type":376,"attrs":3495,"content":3496},{"class":59},[3497],{"text":3498,"type":362},"var FC = FC || {};\nFC.onLoad = function () {\n  FC.client.on('ready.done', function () {\n    \u002F\u002F Your custom code goes here.\n  });\n};\n",{"type":357,"attrs":3500,"content":3501},{"textAlign":59},[3502,3504,3507],{"text":3503,"type":362},"Defining ",{"text":599,"type":362,"marks":3505},[3506],{"type":390},{"text":3508,"type":362}," before Foxy’s JavaScript is included ensures your code runs at the right time, regardless of load order. This pattern is used throughout Foxy’s JavaScript functionality, so it’s worth understanding before working with events, configuration, or template rendering.",{"type":357,"attrs":3510,"content":3511},{"textAlign":59},[3512,3514,3518],{"text":3513,"type":362},"Note that this won’t execute properly if it’s placed inside a jQuery ",{"text":3515,"type":362,"marks":3516},"$(document).ready()",[3517],{"type":390},{"text":3519,"type":362}," call.",{"type":364,"attrs":3521,"content":3522},{"level":366,"textAlign":59},[3523],{"text":3524,"type":362},"What’s in this section",{"type":405,"content":3526},[3527,3543,3556,3568,3581],{"type":408,"content":3528},[3529],{"type":357,"attrs":3530,"content":3531},{"textAlign":59},[3532,3537,3539,3542],{"text":345,"type":362,"marks":3533},[3534,3536],{"type":458,"attrs":3535},{"href":816,"uuid":59,"anchor":59,"target":59,"linktype":31},{"type":2483},{"text":3538,"type":362}," — override default behavior like debug logging using ",{"text":807,"type":362,"marks":3540},[3541],{"type":390},{"text":496,"type":362},{"type":408,"content":3544},[3545],{"type":357,"attrs":3546,"content":3547},{"textAlign":59},[3548,3554],{"text":509,"type":362,"marks":3549},[3550,3553],{"type":458,"attrs":3551},{"href":3552,"uuid":59,"anchor":59,"target":59,"linktype":31},"https:\u002F\u002Ffoxy.io\u002Fhelp\u002Farticles\u002Fconfigure-the-session-domain-and-cookie-path",{"type":2483},{"text":3555,"type":362}," — control where and how Foxy’s session cookie is set, and reset a session entirely.",{"type":408,"content":3557},[3558],{"type":357,"attrs":3559,"content":3560},{"textAlign":59},[3561,3566],{"text":490,"type":362,"marks":3562},[3563,3565],{"type":458,"attrs":3564},{"href":494,"uuid":59,"anchor":59,"target":59,"linktype":31},{"type":2483},{"text":3567,"type":362}," — the full list of events available on the cart, checkout, and receipt, and how to bind to them.",{"type":408,"content":3569},[3570],{"type":357,"attrs":3571,"content":3572},{"textAlign":59},[3573,3579],{"text":2171,"type":362,"marks":3574},[3575,3578],{"type":458,"attrs":3576},{"href":3577,"uuid":59,"anchor":59,"target":59,"linktype":31},"https:\u002F\u002Ffoxy.io\u002Fhelp\u002Farticles\u002Fjavascript-naming-and-file-structure-reference",{"type":2483},{"text":3580,"type":362}," — naming conventions, internal file structure, and the order JavaScript executes on page load.",{"type":408,"content":3582},[3583],{"type":357,"attrs":3584,"content":3585},{"textAlign":59},[3586,3593],{"text":3587,"type":362,"marks":3588},"Render cart and checkout templates with Twig.js",[3589,3592],{"type":458,"attrs":3590},{"href":3591,"uuid":59,"anchor":59,"target":59,"linktype":31},"https:\u002F\u002Ffoxy.io\u002Fhelp\u002Farticles\u002Frender-cart-and-checkout-templates-with-twig-js",{"type":2483},{"text":3594,"type":362}," — how Foxy renders cart and checkout templates client-side, and how sequential render calls are handled.",{"id":59,"alt":59,"name":13,"focus":59,"title":59,"source":59,"filename":13,"copyright":59,"fieldtype":81,"meta_data":3596},{},"An introduction to Foxy's JavaScript — the FC object, how to hook into it safely, and what's covered in this section.",[],"javascript-overview","help\u002Farticles\u002Fjavascript-overview",-4010,[],"a2d18885-2658-429d-b703-07214c7f7399",[],{"name":3587,"created_at":3606,"published_at":3607,"updated_at":3608,"id":3609,"uuid":3610,"content":3611,"slug":3833,"full_slug":3834,"sort_by_date":59,"position":3835,"tag_list":3836,"is_startpage":24,"parent_id":505,"meta_data":59,"group_id":3837,"first_published_at":3607,"release_id":59,"lang":65,"path":59,"alternates":3838,"default_full_slug":59,"translated_slugs":59},"2026-07-20T21:31:19.204Z","2026-07-20T21:42:37.484Z","2026-07-20T21:42:37.501Z",200267690869497,"7a0c215e-1574-40f0-abae-442bb4d7b3e4",{"_uid":3612,"body":3613,"name":3587,"image":3829,"pinned":24,"summary":3831,"category":320,"component":266,"related_articles":3832},"9b21257d-c492-48f0-99c4-21091202e0e1",{"type":354,"content":3614},[3615,3620,3625,3699,3704,3769,3774,3779,3784,3789,3793],{"type":357,"attrs":3616,"content":3617},{"textAlign":59},[3618],{"text":3619,"type":362},"Foxy uses Twig as its template language, and Twig.js to render those same templates client-side. This is what lets the cart and checkout update in place — swapping in new shipping rates, taxes, or totals — without a full page reload.",{"type":364,"attrs":3621,"content":3622},{"level":366,"textAlign":59},[3623],{"text":3624,"type":362},"Checkout render methods",{"type":405,"content":3626},[3627,3636,3645,3654,3663,3672,3681,3690],{"type":408,"content":3628},[3629],{"type":357,"attrs":3630,"content":3631},{"textAlign":59},[3632],{"text":3633,"type":362,"marks":3634},"FC.checkout.render()",[3635],{"type":390},{"type":408,"content":3637},[3638],{"type":357,"attrs":3639,"content":3640},{"textAlign":59},[3641],{"text":3642,"type":362,"marks":3643},"FC.checkout.renderLoginRegister()",[3644],{"type":390},{"type":408,"content":3646},[3647],{"type":357,"attrs":3648,"content":3649},{"textAlign":59},[3650],{"text":3651,"type":362,"marks":3652},"FC.checkout.renderCustomerShipping()",[3653],{"type":390},{"type":408,"content":3655},[3656],{"type":357,"attrs":3657,"content":3658},{"textAlign":59},[3659],{"text":3660,"type":362,"marks":3661},"FC.checkout.renderCustomerBilling()",[3662],{"type":390},{"type":408,"content":3664},[3665],{"type":357,"attrs":3666,"content":3667},{"textAlign":59},[3668],{"text":3669,"type":362,"marks":3670},"FC.checkout.renderShippingRates()",[3671],{"type":390},{"type":408,"content":3673},[3674],{"type":357,"attrs":3675,"content":3676},{"textAlign":59},[3677],{"text":3678,"type":362,"marks":3679},"FC.checkout.renderPaymentMethod()",[3680],{"type":390},{"type":408,"content":3682},[3683],{"type":357,"attrs":3684,"content":3685},{"textAlign":59},[3686],{"text":3687,"type":362,"marks":3688},"FC.checkout.renderAdditionalFields()",[3689],{"type":390},{"type":408,"content":3691},[3692],{"type":357,"attrs":3693,"content":3694},{"textAlign":59},[3695],{"text":3696,"type":362,"marks":3697},"FC.checkout.renderRequiredHiddenFields()",[3698],{"type":390},{"type":364,"attrs":3700,"content":3701},{"level":366,"textAlign":59},[3702],{"text":3703,"type":362},"Cart render methods",{"type":405,"content":3705},[3706,3715,3724,3733,3742,3751,3760],{"type":408,"content":3707},[3708],{"type":357,"attrs":3709,"content":3710},{"textAlign":59},[3711],{"text":3712,"type":362,"marks":3713},"FC.cart.render()",[3714],{"type":390},{"type":408,"content":3716},[3717],{"type":357,"attrs":3718,"content":3719},{"textAlign":59},[3720],{"text":3721,"type":362,"marks":3722},"FC.cart.renderShippingRates()",[3723],{"type":390},{"type":408,"content":3725},[3726],{"type":357,"attrs":3727,"content":3728},{"textAlign":59},[3729],{"text":3730,"type":362,"marks":3731},"FC.cart.renderTaxes()",[3732],{"type":390},{"type":408,"content":3734},[3735],{"type":357,"attrs":3736,"content":3737},{"textAlign":59},[3738],{"text":3739,"type":362,"marks":3740},"FC.cart.renderOrderTotals()",[3741],{"type":390},{"type":408,"content":3743},[3744],{"type":357,"attrs":3745,"content":3746},{"textAlign":59},[3747],{"text":3748,"type":362,"marks":3749},"FC.cart.renderCouponEntry()",[3750],{"type":390},{"type":408,"content":3752},[3753],{"type":357,"attrs":3754,"content":3755},{"textAlign":59},[3756],{"text":3757,"type":362,"marks":3758},"FC.cart.renderAddressEntry()",[3759],{"type":390},{"type":408,"content":3761},[3762],{"type":357,"attrs":3763,"content":3764},{"textAlign":59},[3765],{"text":3766,"type":362,"marks":3767},"FC.cart.renderCartItemsDivs()",[3768],{"type":390},{"type":364,"attrs":3770,"content":3771},{"level":366,"textAlign":59},[3772],{"text":3773,"type":362},"Sequential rendering",{"type":357,"attrs":3775,"content":3776},{"textAlign":59},[3777],{"text":3778,"type":362},"You can call as many render methods in sequence as you need — the actual Twig rendering only runs once, and the affected blocks are updated together. For example:",{"type":376,"attrs":3780,"content":3781},{"class":59},[3782],{"text":3783,"type":362},"FC.cart.renderShippingRates();\nFC.cart.renderTaxes();\nFC.cart.renderOrderTotals();\n",{"type":357,"attrs":3785,"content":3786},{"textAlign":59},[3787],{"text":3788,"type":362},"This calls the Twig renderer a single time, then replaces the blocks needed for shipping rates, taxes, and order totals in one pass — rather than re-rendering three times.",{"type":364,"attrs":3790,"content":3791},{"level":366,"textAlign":59},[3792],{"text":467,"type":362},{"type":405,"content":3794},[3795,3822],{"type":408,"content":3796},[3797],{"type":357,"attrs":3798,"content":3799},{"textAlign":59},[3800,3802,3805,3807,3811,3813,3816,3817,3820],{"text":3801,"type":362},"Each render call triggers a ",{"text":939,"type":362,"marks":3803},[3804],{"type":390},{"text":3806,"type":362}," event once the block finishes updating — see ",{"text":490,"type":362,"marks":3808},[3809],{"type":458,"attrs":3810},{"href":494,"uuid":59,"anchor":59,"target":59,"linktype":31},{"text":3812,"type":362}," for the ",{"text":957,"type":362,"marks":3814},[3815],{"type":390},{"text":392,"type":362},{"text":963,"type":362,"marks":3818},[3819],{"type":390},{"text":3821,"type":362}," parameters it provides.",{"type":408,"content":3823},[3824],{"type":357,"attrs":3825,"content":3826},{"textAlign":59},[3827],{"text":3828,"type":362},"This article covers the JavaScript methods used to trigger re-rendering. It doesn’t cover Twig template syntax itself or customizing template markup.",{"id":59,"alt":59,"name":13,"focus":59,"title":59,"source":59,"filename":13,"copyright":59,"fieldtype":81,"meta_data":3830},{},"The JavaScript methods used to re-render cart and checkout templates client-side with Twig.js, and how sequential render calls are batched.",[],"render-cart-and-checkout-templates-with-twig-js","help\u002Farticles\u002Frender-cart-and-checkout-templates-with-twig-js",-4060,[],"7c979eb5-7d1d-491e-b04d-8f5fee364905",[],{"name":3840,"created_at":3841,"published_at":3842,"updated_at":3843,"id":3844,"uuid":47,"content":3845,"slug":48,"full_slug":48,"sort_by_date":59,"position":4022,"tag_list":4023,"is_startpage":24,"parent_id":59,"meta_data":59,"group_id":4024,"first_published_at":4025,"release_id":59,"lang":65,"path":59,"alternates":4026,"default_full_slug":59,"translated_slugs":59},"Contact","2022-09-23T19:56:58.957Z","2025-05-08T18:24:40.382Z","2025-05-08T18:24:40.392Z",3138,{"seo":3846,"_uid":3849,"title":3850,"action":3851,"fields":3852,"method":3998,"columns":3999,"subtitle":4013,"component":48,"button_text":4019,"submit_title":4020,"submit_subtitle":4021},{"_uid":3847,"title":3840,"plugin":3848,"description":13},"24ff7574-3bcc-48d2-85b5-e529dfea1cc4","meta-fields","8f54f1da-9d8f-49b2-89e7-840e886491cb","We're here to help.","https:\u002F\u002Fusebasin.com\u002Ff\u002F029f48d65402",[3853,3858,3861,3969,3972,3977,3992],{"_uid":3854,"name":3855,"type":362,"label":3856,"options":13,"required":33,"component":3857,"placeholder":13},"9a70b226-2036-4f90-a052-b3efa61c5896","name","Name","form___field",{"_uid":3859,"name":2514,"type":2514,"label":3860,"options":13,"required":33,"component":3857,"placeholder":13},"86ba35be-ff43-4a28-8633-14052a8f6622","Email Address",{"_uid":3862,"name":3863,"type":3864,"label":3865,"options":3866,"required":33,"component":3857,"conditions":3867,"placeholder":13},"3f827475-492c-4f97-aa1e-2386ac263b6c","topic","select","Topic","Presales, Support, Billing, Partnerships, Order Enquiry, Other",[3868,3923,3933,3940,3948,3956,3962],{"_uid":3869,"equals":3870,"fields":3871,"component":3922},"e21d97dd-e68e-4fa6-ba97-bc40f3041dde","Order Enquiry",[3872],{"_uid":3873,"body":3874,"type":3920,"title":13,"component":3921},"b64992bc-6d53-48b8-b7a0-d81e5a062e50",{"type":354,"content":3875},[3876],{"type":357,"content":3877},[3878,3880,3887,3889,3891,3892,3896,3898,3903,3911,3913,3918],{"text":3879,"type":362},"We are ",{"text":3881,"type":362,"marks":3882},"Foxy.io",[3883],{"type":458,"attrs":3884},{"href":3885,"uuid":59,"anchor":59,"custom":3886,"target":59,"linktype":31},"http:\u002F\u002FFoxy.io",{},{"text":3888,"type":362},", an ecommerce platform powering ecommerce for other merchants. We do not sell products, and are unable to assist with questions about order statuses or refunds for any merchants using our platform. Please contact the merchant you ordered from for assistance. If you’d like to report a store using Foxy for fraudulent practices, please select ‘other’ in the subject.",{"type":3890},"hard_break",{"type":3890},{"text":3893,"type":362,"marks":3894},"NOTE:",[3895],{"type":2483},{"text":3897,"type":362}," We are ",{"text":3899,"type":362,"marks":3900},"not ",[3901],{"type":3902},"italic",{"text":3904,"type":362,"marks":3905},"Foxy.in",[3906,3910],{"type":458,"attrs":3907},{"href":3908,"uuid":59,"anchor":59,"custom":3909,"target":59,"linktype":31},"http:\u002F\u002FFoxy.in",{},{"type":3902},{"text":3912,"type":362},". We are not in any way affiliated with ",{"text":3904,"type":362,"marks":3914},[3915],{"type":458,"attrs":3916},{"href":3908,"uuid":59,"anchor":59,"custom":3917,"target":59,"linktype":31},{},{"text":3919,"type":362},", and cannot help in any way with your order from that website.","danger","global___alert","form___condition",{"_uid":3924,"equals":3925,"fields":3926,"component":3922},"8765c3e1-25cf-44aa-b8ea-fc6094acf9c3","Presales",[3927],{"_uid":3928,"name":3929,"type":3930,"label":13,"options":13,"required":24,"component":3857,"conditions":3931,"placeholder":13,"default_value":3932},"cf464f8e-d643-4f6e-af29-d3abffaf7380","department_email_address","hidden",[],"hello@foxy.io",{"_uid":3934,"equals":208,"fields":3935,"component":3922},"4007b6d8-77e5-421d-bd1e-6f336dd853fb",[3936],{"_uid":3937,"name":3929,"type":3930,"label":13,"options":13,"required":24,"component":3857,"conditions":3938,"placeholder":13,"default_value":3939},"7b4c6aa5-a68c-45e0-9ce1-0a36af10c0c2",[],"help@foxy.io",{"_uid":3941,"equals":3942,"fields":3943,"component":3922},"1dbb8f11-613d-43cd-9e09-1b94f6e19219","Billing",[3944],{"_uid":3945,"name":3929,"type":3930,"label":13,"options":13,"required":24,"component":3857,"conditions":3946,"placeholder":13,"default_value":3947},"a0ac0d1b-bc4f-4a6c-a682-581d450b0b73",[],"help+billing@foxy.io",{"_uid":3949,"equals":3950,"fields":3951,"component":3922},"a0a53a50-7172-4a29-ba58-181e38874e12","Partnerships",[3952],{"_uid":3953,"name":3929,"type":3930,"label":13,"options":13,"required":24,"component":3857,"conditions":3954,"placeholder":13,"default_value":3955},"7aa011d9-f374-4aed-b5a5-929b54aaf152",[],"partners@foxy.io",{"_uid":3957,"equals":3870,"fields":3958,"component":3922},"a4cd431f-25d5-41c7-bfdc-02c908c8fb47",[3959],{"_uid":3960,"name":3929,"type":3930,"label":13,"options":13,"required":24,"component":3857,"conditions":3961,"placeholder":13,"default_value":3932},"f5d52168-d6ae-451b-94ee-2ced1cbd28ad",[],{"_uid":3963,"equals":3964,"fields":3965,"component":3922},"25aba1ed-eb41-4bbc-aa89-f7a7167ea86e","Other",[3966],{"_uid":3967,"name":3929,"type":3930,"label":13,"options":13,"required":24,"component":3857,"conditions":3968,"placeholder":13,"default_value":3932},"f40dfaef-c203-4b71-bf4e-e1b43cef192b",[],{"_uid":3970,"component":3971},"e9c53a05-f40a-4510-aaf8-bc072a235a0c","form___subject",{"_uid":3973,"name":3974,"type":3975,"label":3976,"options":13,"required":33,"component":3857,"placeholder":13},"a4c4d385-fff4-4978-99fb-b68cfea623d6","message","textarea","Message",{"_uid":3978,"name":3979,"type":3864,"label":3980,"options":3981,"required":33,"component":3857,"conditions":3982,"placeholder":13},"8a3c9f85-f438-427d-9c7a-d7b295a14b5b","existing_user","Are you an existing user?","No, Yes",[3983],{"_uid":3984,"equals":3985,"fields":3986,"component":3922},"115933d6-262a-4b59-8fa8-579c5ad73de1","Yes",[3987],{"_uid":3988,"name":3989,"type":362,"label":3990,"options":13,"required":33,"component":3857,"conditions":3991,"placeholder":13},"44b6ff23-98f0-4e95-b7f5-c23e06415c2d","subdomain","Store Subdomain",[],{"_uid":3993,"name":3994,"type":3864,"label":3995,"options":3996,"required":33,"component":3857,"conditions":3997,"placeholder":13},"922a5cef-3af2-4113-8855-36c7910e3ee3","user_type","What type of user are you?","Developer, Designer, Merchant",[],"POST",[4000],{"_uid":4001,"text":4002,"title":4011,"component":4012},"7323b90d-a93a-4bf1-baa9-20d0b7ead61b",{"type":354,"content":4003},[4004],{"type":357,"content":4005},[4006,4008,4009],{"text":4007,"type":362},"855.369.9227",{"type":3890},{"text":4010,"type":362},"9:30am-6pm Central M-F","Pre-sales, Sales, & Partnerships","contact___footer_column",{"type":354,"content":4014},[4015],{"type":357,"content":4016},[4017],{"text":4018,"type":362},"Get in touch to get help from our friendly support team.","Submit","Success!","Your email has been received. We'll get back to you as soon as we can, but it might take a business day. If you don't hear back from us in a timely manner, please check your spam folder to ensure our reply didn't go there.",-80,[],"2fd9fb7d-a48a-4184-acfd-30022d8d6f08","2022-09-23T20:10:45.360Z",[],{},1784651823114]