[{"data":1,"prerenderedAt":1380},["ShallowReactive",2],{"header:help":3,"footer:default":67,"story:navigation\u002Fsearch:help":250,"story:help\u002Fcategories":288,"story:help\u002Farticles\u002Fdynamically-restrict-the-countries-and-states-available-at-checkout":314,"no-guide:dynamically-restrict-the-countries-and-states-available-at-checkout":59,"article:\u002Fhelp\u002Farticles\u002Fdynamically-restrict-the-countries-and-states-available-at-checkout":1115,"story:contact":1136,"help:tree:86c040d2-207c-4a5d-852e-2008a6e5b949":1325,"_apollo:default":1379},{"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":1108,"full_slug":1109,"sort_by_date":59,"position":1110,"tag_list":1111,"is_startpage":24,"parent_id":1112,"meta_data":59,"group_id":1113,"first_published_at":317,"release_id":59,"lang":65,"path":59,"alternates":1114,"default_full_slug":59,"translated_slugs":59},"Dynamically restrict the countries and states available at checkout","2026-07-21T15:30:33.682Z","2026-07-22T17:45:02.077Z","2026-07-22T17:45:02.098Z",200532925224416,"86c040d2-207c-4a5d-852e-2008a6e5b949",{"_uid":322,"body":323,"name":1102,"image":1103,"pinned":24,"summary":1105,"category":1106,"component":266,"related_articles":1107},"2707a2a9-18ad-4503-994a-260d2b70295d",{"type":324,"content":325},"doc",[326,333,346,351,358,363,368,373,378,384,389,407,413,418,425,497,504,528,530,535,540,546,598,604,628,629,634,639,645,715,721,745,746,751,756,762,827,833,857,858,863,868,874,913,919,943,949,954,963,968,973,978,987,991,996,1001,1010,1014,1019,1024,1033,1037,1042,1047,1063,1068],{"type":327,"attrs":328,"content":329},"paragraph",{"textAlign":59},[330],{"text":331,"type":332},"The following functionality adds some helper functions to your templates to allow you to dynamically restrict the countries and states that can be used by your customers to check out.","text",{"type":334,"content":335},"blockquote",[336],{"type":327,"attrs":337,"content":338},{"textAlign":59},[339,344],{"text":340,"type":332,"marks":341},"Important:",[342],{"type":343},"bold",{"text":345,"type":332}," The functionality described on this page require advanced javascript knowledge, and are not officially supported. They are included in our official wiki because certain shipping methods and functionality are not natively supported, and though we are working on radically improving our shipping functionality, in the meantime these methods may be great workarounds.",{"type":327,"attrs":347,"content":348},{"textAlign":59},[349],{"text":350,"type":332},"See the changelog for details on updates to this script.",{"type":352,"attrs":353,"content":355},"heading",{"level":354,"textAlign":59},2,[356],{"text":357,"type":332},"Important note",{"type":327,"attrs":359,"content":360},{"textAlign":59},[361],{"text":362,"type":332},"Starting in 2.0, there is now a template configuration option to limit countries and states from right within your store's Foxy administration. This new option allows you to alter what locations are available for both the billing and shipping (either matching or independent of each other), without the need for the following snippet. You can access this feature from the \"configuration\" section under \"templates\", look for \"Customize allowlist\u002Fblocklist filtering of countries and regions\".",{"type":327,"attrs":364,"content":365},{"textAlign":59},[366],{"text":367,"type":332},"If you need to dynamically restrict the locations - for example, prevent orders from outside your country if perishable products are purchased, you can utilise the following script to do that. Otherwise, if your restrictions are static and don't depend on certain conditions being met, use the option in your store's admin.",{"type":352,"attrs":369,"content":370},{"level":354,"textAlign":59},[371],{"text":372,"type":332},"Step 1: Add Javascript",{"type":327,"attrs":374,"content":375},{"textAlign":59},[376],{"text":377,"type":332},"Add the following in the \"footer\" section of the \"Add custom header and footer code to your templates\" option, found on the \"configuration\" page of your store's Foxy administration.",{"type":379,"attrs":380,"content":381},"code_block",{"class":59},[382],{"text":383,"type":332},"{% if context == 'cart' or context == 'checkout' %}\n\u003Cscript type=\"text\u002Fjavascript\" charset=\"utf-8\">\n(function($, FC) {\n    FC.locations.logic = function() {\n    \u002F* BEGIN CUSTOM LOCATION LOGIC *\u002F\n\n    \u002F* END CUSTOM LOCATION LOGIC *\u002F\n    };\n\n    \u002F* Country\u002FState Helper Functions v2.2 *\u002F\n    FC.locations.removeCountries=function(a,b){if(\"undefined\"==typeof a)return!1;\"string\"==typeof a&&(a=[a]);b=FC.locations.validateLocationArrayNames(b);for(l in b){0===FC.json.config[\"locations_\"+b[l]].length&&(FC.json.config[\"locations_\"+b[l]]={});for(var c in a)FC.json.config[\"locations_\"+b[l]][a[c]]=\"*\"}return!0};\n    FC.locations.limitCountriesTo=function(a,b){if(\"undefined\"==typeof a)return!1;\"string\"==typeof a&&(a=[a]);b=FC.locations.validateLocationArrayNames(b);for(l in b){var c=FC.json.config.locations;FC.json.config[\"locations_\"+b[l]]={};for(var d in c)-1==a.indexOf(d)&&(FC.json.config[\"locations_\"+b[l]][d]=\"*\")}return!0};\n    FC.locations.removeStates=function(a,b,c){if(\"undefined\"==typeof a||\"undefined\"==typeof b)return!1;\"string\"==typeof b&&(b=[b]);c=FC.locations.validateLocationArrayNames(c);for(l in c){if(\"undefined\"==typeof FC.json.config.locations[a])return!1;FC.json.config[\"locations_\"+c[l]].hasOwnProperty(a)||(FC.json.config[\"locations_\"+c[l]][a]=[]);for(var d in b)FC.json.config[\"locations_\"+c[l]][a].push(b[d])}return!0};\n    FC.locations.limitStatesTo=function(a,b,c){if(\"undefined\"==typeof a||\"undefined\"==typeof b)return!1;\"string\"==typeof b&&(b=[b]);c=FC.locations.validateLocationArrayNames(c);for(l in c){var d=FC.json.config.locations;if(\"undefined\"==typeof d[a])return!1;FC.json.config[\"locations_\"+c[l]][a]=[];for(var e in d[a].r.options)-1==jQuery.inArray(e,b)&&FC.json.config[\"locations_\"+c[l]][a].push(e)}return!0};\n    FC.locations.validateLocationArrayNames=function(a){if(\"undefined\"==typeof a||\"\"==a||\"both\"==a)a=[\"billing\",\"shipping\"];\"string\"==typeof a&&(a=[a]);for(var b=0;b\u003Ca.length;b++)\"customer\"==a[b]&&(a[b]=\"billing\");return a};FC.locations.reset=function(a){a=FC.locations.validateLocationArrayNames(a);for(l in a)FC.json.config[\"locations_\"+a[l]]=FC.locations.hasOwnProperty(\"locations_\"+a[l]+\"_default\")?FC.locations[\"locations_\"+a[l]+\"_default\"]:{};customLocationsExecute()};\n    function customLocationsHandler(){FC.locations.hasOwnProperty(\"locations_billing_default\")?FC.locations.reset():(FC.locations.locations_billing_default=FC.json.config.locations_billing,FC.locations.locations_shipping_default=FC.json.config.locations_shipping,customLocationsExecute())}\n    function customLocationsExecute(){FC.locations.logic();FC.Template(FC.json.context).clearOutput();\"cart\"==FC.json.context?FC.cart.renderAddressEntry():(FC.checkout.renderCustomerBilling(),FC.checkout.renderCustomerShipping())};\n    {% if cart_is_fullpage or context == 'checkout' %}FC.client.on('ready', customLocationsHandler);{% else %}customLocationsHandler();{% endif %}\n})(jQuery, FC);\n\u003C\u002Fscript>\n{% endif %}",{"type":352,"attrs":385,"content":386},{"level":354,"textAlign":59},[387],{"text":388,"type":332},"Step 2: Add Custom Location Rules",{"type":327,"attrs":390,"content":391},{"textAlign":59},[392,394,399,401,405],{"text":393,"type":332},"Now the fun part, based on whatever criteria you want, add in the different country\u002Fstate restrictions you require for your checkout. Add your custom code between the ",{"text":395,"type":332,"marks":396},"\u002F* BEGIN CUSTOM LOCATION LOGIC *\u002F",[397],{"type":398},"code",{"text":400,"type":332}," and ",{"text":402,"type":332,"marks":403},"\u002F* END CUSTOM LOCATION LOGIC *\u002F",[404],{"type":398},{"text":406,"type":332}," lines at the top of the script block. There are five functions available to you.",{"type":352,"attrs":408,"content":410},{"level":409,"textAlign":59},4,[411],{"text":412,"type":332},"FC.locations.removeCountries()",{"type":327,"attrs":414,"content":415},{"textAlign":59},[416],{"text":417,"type":332},"Removes the specified countries from the specified locations arrays",{"type":327,"attrs":419,"content":420},{"textAlign":59},[421],{"text":422,"type":332,"marks":423},"Parameters:",[424],{"type":343},{"type":426,"content":427},"bullet_list",[428,447],{"type":429,"content":430},"list_item",[431],{"type":327,"attrs":432,"content":433},{"textAlign":59},[434,438,440,445],{"text":435,"type":332,"marks":436},"countries",[437],{"type":398},{"text":439,"type":332}," ",{"text":441,"type":332,"marks":442},"\u003Cwrap lo>(String or Array)\u003C\u002Fwrap>",[443],{"type":444},"italic",{"text":446,"type":332}," - Either a string or an array of strings of the 2 character ISO country codes",{"type":429,"content":448},[449],{"type":327,"attrs":450,"content":451},{"textAlign":59},[452,456,457,460,462,466,468,472,474,478,480,484,486,490,492,495],{"text":453,"type":332,"marks":454},"locationArrayNames",[455],{"type":398},{"text":439,"type":332},{"text":441,"type":332,"marks":458},[459],{"type":444},{"text":461,"type":332}," - ",{"text":463,"type":332,"marks":464},"Optional",[465],{"type":444},{"text":467,"type":332}," - Either a string of either ",{"text":469,"type":332,"marks":470},"'billing'",[471],{"type":398},{"text":473,"type":332},", ",{"text":475,"type":332,"marks":476},"'shipping'",[477],{"type":398},{"text":479,"type":332}," or ",{"text":481,"type":332,"marks":482},"'both'",[483],{"type":398},{"text":485,"type":332},", or an array of both like ",{"text":487,"type":332,"marks":488},"['billing', 'shipping']",[489],{"type":398},{"text":491,"type":332},". If not specified, ",{"text":481,"type":332,"marks":493},[494],{"type":398},{"text":496,"type":332}," is the automatic default.",{"type":327,"attrs":498,"content":499},{"textAlign":59},[500],{"text":501,"type":332,"marks":502},"Example:",[503],{"type":343},{"type":426,"content":505},[506,517],{"type":429,"content":507},[508],{"type":327,"attrs":509,"content":510},{"textAlign":59},[511,515],{"text":512,"type":332,"marks":513},"FC.locations.removeCountries('US');",[514],{"type":398},{"text":516,"type":332}," - Removes the United States from both the billing and the shipping country location fields",{"type":429,"content":518},[519],{"type":327,"attrs":520,"content":521},{"textAlign":59},[522,526],{"text":523,"type":332,"marks":524},"FC.locations.removeCountries(['CA', 'GB'], 'shipping');",[525],{"type":398},{"text":527,"type":332}," - Removes Canada and the United Kingdom from the shipping location fields",{"type":529},"horizontal_rule",{"type":352,"attrs":531,"content":532},{"level":409,"textAlign":59},[533],{"text":534,"type":332},"FC.locations.limitCountriesTo()",{"type":327,"attrs":536,"content":537},{"textAlign":59},[538],{"text":539,"type":332},"Restricts the specified locations arrays to just the countries specified",{"type":327,"attrs":541,"content":542},{"textAlign":59},[543],{"text":422,"type":332,"marks":544},[545],{"type":343},{"type":426,"content":547},[548,561],{"type":429,"content":549},[550],{"type":327,"attrs":551,"content":552},{"textAlign":59},[553,556,557,560],{"text":435,"type":332,"marks":554},[555],{"type":398},{"text":439,"type":332},{"text":441,"type":332,"marks":558},[559],{"type":444},{"text":446,"type":332},{"type":429,"content":562},[563],{"type":327,"attrs":564,"content":565},{"textAlign":59},[566,569,570,573,574,577,578,581,582,585,586,589,590,593,594,597],{"text":453,"type":332,"marks":567},[568],{"type":398},{"text":439,"type":332},{"text":441,"type":332,"marks":571},[572],{"type":444},{"text":461,"type":332},{"text":463,"type":332,"marks":575},[576],{"type":444},{"text":467,"type":332},{"text":469,"type":332,"marks":579},[580],{"type":398},{"text":473,"type":332},{"text":475,"type":332,"marks":583},[584],{"type":398},{"text":479,"type":332},{"text":481,"type":332,"marks":587},[588],{"type":398},{"text":485,"type":332},{"text":487,"type":332,"marks":591},[592],{"type":398},{"text":491,"type":332},{"text":481,"type":332,"marks":595},[596],{"type":398},{"text":496,"type":332},{"type":327,"attrs":599,"content":600},{"textAlign":59},[601],{"text":501,"type":332,"marks":602},[603],{"type":343},{"type":426,"content":605},[606,617],{"type":429,"content":607},[608],{"type":327,"attrs":609,"content":610},{"textAlign":59},[611,615],{"text":612,"type":332,"marks":613},"FC.locations.limitCountriesTo('AU');",[614],{"type":398},{"text":616,"type":332}," - Allows only Australia to be selected in the billing and shipping country location fields",{"type":429,"content":618},[619],{"type":327,"attrs":620,"content":621},{"textAlign":59},[622,626],{"text":623,"type":332,"marks":624},"FC.locations.limitCountriesTo(['US', 'CA'], 'shipping');",[625],{"type":398},{"text":627,"type":332}," - Allows only the United States and Canada to be selected for the shipping country",{"type":529},{"type":352,"attrs":630,"content":631},{"level":409,"textAlign":59},[632],{"text":633,"type":332},"FC.locations.removeStates()",{"type":327,"attrs":635,"content":636},{"textAlign":59},[637],{"text":638,"type":332},"Removes the specified states from the specified locations arrays for the specified country",{"type":327,"attrs":640,"content":641},{"textAlign":59},[642],{"text":422,"type":332,"marks":643},[644],{"type":343},{"type":426,"content":646},[647,663,678],{"type":429,"content":648},[649],{"type":327,"attrs":650,"content":651},{"textAlign":59},[652,656,657,661],{"text":653,"type":332,"marks":654},"country",[655],{"type":398},{"text":439,"type":332},{"text":658,"type":332,"marks":659},"\u003Cwrap lo>(String)\u003C\u002Fwrap>",[660],{"type":444},{"text":662,"type":332}," - A string of the 2 character ISO country codes",{"type":429,"content":664},[665],{"type":327,"attrs":666,"content":667},{"textAlign":59},[668,672,673,676],{"text":669,"type":332,"marks":670},"states",[671],{"type":398},{"text":439,"type":332},{"text":441,"type":332,"marks":674},[675],{"type":444},{"text":677,"type":332}," - Either a string or an array of strings of the ISO state codes",{"type":429,"content":679},[680],{"type":327,"attrs":681,"content":682},{"textAlign":59},[683,686,687,690,691,694,695,698,699,702,703,706,707,710,711,714],{"text":453,"type":332,"marks":684},[685],{"type":398},{"text":439,"type":332},{"text":441,"type":332,"marks":688},[689],{"type":444},{"text":461,"type":332},{"text":463,"type":332,"marks":692},[693],{"type":444},{"text":467,"type":332},{"text":469,"type":332,"marks":696},[697],{"type":398},{"text":473,"type":332},{"text":475,"type":332,"marks":700},[701],{"type":398},{"text":479,"type":332},{"text":481,"type":332,"marks":704},[705],{"type":398},{"text":485,"type":332},{"text":487,"type":332,"marks":708},[709],{"type":398},{"text":491,"type":332},{"text":481,"type":332,"marks":712},[713],{"type":398},{"text":496,"type":332},{"type":327,"attrs":716,"content":717},{"textAlign":59},[718],{"text":501,"type":332,"marks":719},[720],{"type":343},{"type":426,"content":722},[723,734],{"type":429,"content":724},[725],{"type":327,"attrs":726,"content":727},{"textAlign":59},[728,732],{"text":729,"type":332,"marks":730},"FC.locations.removeStates('US', 'AK');",[731],{"type":398},{"text":733,"type":332}," - Prevents Alaska from being selected as a state when the United States is selected",{"type":429,"content":735},[736],{"type":327,"attrs":737,"content":738},{"textAlign":59},[739,743],{"text":740,"type":332,"marks":741},"FC.locations.removeStates('US', ['AK', 'HI'], 'shipping');",[742],{"type":398},{"text":744,"type":332}," - Prevents Alaska and Hawaii from being selected as a state for shipping when the United States is selected as the shipping country",{"type":529},{"type":352,"attrs":747,"content":748},{"level":409,"textAlign":59},[749],{"text":750,"type":332},"FC.locations.limitStatesTo()",{"type":327,"attrs":752,"content":753},{"textAlign":59},[754],{"text":755,"type":332},"Restricts the states for the specified country to only those specified",{"type":327,"attrs":757,"content":758},{"textAlign":59},[759],{"text":422,"type":332,"marks":760},[761],{"type":343},{"type":426,"content":763},[764,777,790],{"type":429,"content":765},[766],{"type":327,"attrs":767,"content":768},{"textAlign":59},[769,772,773,776],{"text":653,"type":332,"marks":770},[771],{"type":398},{"text":439,"type":332},{"text":658,"type":332,"marks":774},[775],{"type":444},{"text":662,"type":332},{"type":429,"content":778},[779],{"type":327,"attrs":780,"content":781},{"textAlign":59},[782,785,786,789],{"text":669,"type":332,"marks":783},[784],{"type":398},{"text":439,"type":332},{"text":441,"type":332,"marks":787},[788],{"type":444},{"text":677,"type":332},{"type":429,"content":791},[792],{"type":327,"attrs":793,"content":794},{"textAlign":59},[795,798,799,802,803,806,807,810,811,814,815,818,819,822,823,826],{"text":453,"type":332,"marks":796},[797],{"type":398},{"text":439,"type":332},{"text":441,"type":332,"marks":800},[801],{"type":444},{"text":461,"type":332},{"text":463,"type":332,"marks":804},[805],{"type":444},{"text":467,"type":332},{"text":469,"type":332,"marks":808},[809],{"type":398},{"text":473,"type":332},{"text":475,"type":332,"marks":812},[813],{"type":398},{"text":479,"type":332},{"text":481,"type":332,"marks":816},[817],{"type":398},{"text":485,"type":332},{"text":487,"type":332,"marks":820},[821],{"type":398},{"text":491,"type":332},{"text":481,"type":332,"marks":824},[825],{"type":398},{"text":496,"type":332},{"type":327,"attrs":828,"content":829},{"textAlign":59},[830],{"text":501,"type":332,"marks":831},[832],{"type":343},{"type":426,"content":834},[835,846],{"type":429,"content":836},[837],{"type":327,"attrs":838,"content":839},{"textAlign":59},[840,844],{"text":841,"type":332,"marks":842},"FC.locations.limitStatesTo('US', 'CA');",[843],{"type":398},{"text":845,"type":332}," - Allows only California to be selected as a state when the United States is selected",{"type":429,"content":847},[848],{"type":327,"attrs":849,"content":850},{"textAlign":59},[851,855],{"text":852,"type":332,"marks":853},"FC.locations.limitStatesTo('AU', ['SA', 'VIC', 'QLD'], 'shipping');",[854],{"type":398},{"text":856,"type":332}," - Allows only South Australia, Victoria and Queensland from being selected for shipping when Australia is selected as the shipping country.",{"type":529},{"type":352,"attrs":859,"content":860},{"level":409,"textAlign":59},[861],{"text":862,"type":332},"FC.locations.reset()",{"type":327,"attrs":864,"content":865},{"textAlign":59},[866],{"text":867,"type":332},"Resets the location restrictions back to the store default, as set in the \"configuration\" in the Foxy administration. Best used through the javascript events on the cart\u002Fcheckout to trigger the reset based on events, such as removing an item from the cart.",{"type":327,"attrs":869,"content":870},{"textAlign":59},[871],{"text":422,"type":332,"marks":872},[873],{"type":343},{"type":426,"content":875},[876],{"type":429,"content":877},[878],{"type":327,"attrs":879,"content":880},{"textAlign":59},[881,884,885,888,889,892,893,896,897,900,901,904,905,908,909,912],{"text":453,"type":332,"marks":882},[883],{"type":398},{"text":439,"type":332},{"text":441,"type":332,"marks":886},[887],{"type":444},{"text":461,"type":332},{"text":463,"type":332,"marks":890},[891],{"type":444},{"text":467,"type":332},{"text":469,"type":332,"marks":894},[895],{"type":398},{"text":473,"type":332},{"text":475,"type":332,"marks":898},[899],{"type":398},{"text":479,"type":332},{"text":481,"type":332,"marks":902},[903],{"type":398},{"text":485,"type":332},{"text":487,"type":332,"marks":906},[907],{"type":398},{"text":491,"type":332},{"text":481,"type":332,"marks":910},[911],{"type":398},{"text":496,"type":332},{"type":327,"attrs":914,"content":915},{"textAlign":59},[916],{"text":501,"type":332,"marks":917},[918],{"type":343},{"type":426,"content":920},[921,932],{"type":429,"content":922},[923],{"type":327,"attrs":924,"content":925},{"textAlign":59},[926,930],{"text":927,"type":332,"marks":928},"FC.locations.reset;",[929],{"type":398},{"text":931,"type":332}," - Reset the location restrictions back to default",{"type":429,"content":933},[934],{"type":327,"attrs":935,"content":936},{"textAlign":59},[937,941],{"text":938,"type":332,"marks":939},"FC.client.on('cart-item-remove.done', function() { FC.locations.reset(); });",[940],{"type":398},{"text":942,"type":332}," - Reset location restrictions whenever an item is removed from the cart",{"type":352,"attrs":944,"content":946},{"level":945,"textAlign":59},3,[947],{"text":948,"type":332},"Examples",{"type":352,"attrs":950,"content":951},{"level":409,"textAlign":59},[952],{"text":953,"type":332},"Example 1",{"type":426,"content":955},[956],{"type":429,"content":957},[958],{"type":327,"attrs":959,"content":960},{"textAlign":59},[961],{"text":962,"type":332},"Restricting the checkout to only allow shipping to the United States, but allow billing to be from any country",{"type":327,"attrs":964,"content":965},{"textAlign":59},[966],{"text":967,"type":332},"javascript",{"type":379,"attrs":969,"content":970},{"class":59},[971],{"text":972,"type":332},"FC.locations.limitCountriesTo('US', 'shipping');",{"type":352,"attrs":974,"content":975},{"level":409,"textAlign":59},[976],{"text":977,"type":332},"Example 2",{"type":426,"content":979},[980],{"type":429,"content":981},[982],{"type":327,"attrs":983,"content":984},{"textAlign":59},[985],{"text":986,"type":332},"Only allow customers from the US and Canada, and not from Alaska or Hawaii.",{"type":327,"attrs":988,"content":989},{"textAlign":59},[990],{"text":967,"type":332},{"type":379,"attrs":992,"content":993},{"class":59},[994],{"text":995,"type":332},"FC.locations.limitCountriesTo(['US', 'CA']);\nFC.locations.removeStates('US', ['AK', 'HI']);",{"type":352,"attrs":997,"content":998},{"level":409,"textAlign":59},[999],{"text":1000,"type":332},"Example 3",{"type":426,"content":1002},[1003],{"type":429,"content":1004},[1005],{"type":327,"attrs":1006,"content":1007},{"textAlign":59},[1008],{"text":1009,"type":332},"Remove all non-standard US States",{"type":327,"attrs":1011,"content":1012},{"textAlign":59},[1013],{"text":967,"type":332},{"type":379,"attrs":1015,"content":1016},{"class":59},[1017],{"text":1018,"type":332},"FC.locations.removeStates('US', ['AF','AA','AC','AE','AM','AP','AS','PR','VI','GU','FM','MH','MP'], 'both');",{"type":352,"attrs":1020,"content":1021},{"level":409,"textAlign":59},[1022],{"text":1023,"type":332},"Example 4",{"type":426,"content":1025},[1026],{"type":429,"content":1027},[1028],{"type":327,"attrs":1029,"content":1030},{"textAlign":59},[1031],{"text":1032,"type":332},"Remove countries that are currently under sanction restrictions from the US Office of Foreign Assets Control (Note that this list may not be up to date)",{"type":327,"attrs":1034,"content":1035},{"textAlign":59},[1036],{"text":967,"type":332},{"type":379,"attrs":1038,"content":1039},{"class":59},[1040],{"text":1041,"type":332},"FC.locations.removeCountries(['CU','IR','SD','KP']);",{"type":352,"attrs":1043,"content":1044},{"level":354,"textAlign":59},[1045],{"text":1046,"type":332},"What about making it read-only?",{"type":327,"attrs":1048,"content":1049},{"textAlign":59},[1050,1052,1056,1057,1061],{"text":1051,"type":332},"As part of the new autocomplete functionality from version 1.0, any location object that only has one option will automatically become read-only with that location selected by default. If you want to set a field read only, utilise the ",{"text":1053,"type":332,"marks":1054},"limitCountriesTo()",[1055],{"type":398},{"text":479,"type":332},{"text":1058,"type":332,"marks":1059},"limitStatesTo()",[1060],{"type":398},{"text":1062,"type":332}," functions with only a single location specified.",{"type":352,"attrs":1064,"content":1065},{"level":354,"textAlign":59},[1066],{"text":1067,"type":332},"Changelog",{"type":426,"content":1069},[1070,1077,1090],{"type":429,"content":1071},[1072],{"type":327,"attrs":1073,"content":1074},{"textAlign":59},[1075],{"text":1076,"type":332},"2014\u002F08\u002F21 - v2.0 - Initial version",{"type":429,"content":1078},[1079],{"type":327,"attrs":1080,"content":1081},{"textAlign":59},[1082,1084,1088],{"text":1083,"type":332},"2019\u002F11\u002F09 - v2.1 - Adding ",{"text":1085,"type":332,"marks":1086},"reset()",[1087],{"type":398},{"text":1089,"type":332}," function",{"type":429,"content":1091},[1092],{"type":327,"attrs":1093,"content":1094},{"textAlign":59},[1095,1097,1100],{"text":1096,"type":332},"2020\u002F02\u002F20 - v2.2 - Triggering ",{"text":1085,"type":332,"marks":1098},[1099],{"type":398},{"text":1101,"type":332}," before the custom logic is run subsequent times on the same page","Restrict the countries and states available at checkout",{"id":59,"alt":59,"name":13,"focus":59,"title":59,"source":59,"filename":13,"copyright":59,"fieldtype":81,"meta_data":1104},{},"How to dynamically restrict which countries and states customers can select at checkout.","2d85c136-b77a-4329-afb5-66ad5765a06c",[],"dynamically-restrict-the-countries-and-states-available-at-checkout","help\u002Farticles\u002Fdynamically-restrict-the-countries-and-states-available-at-checkout",-4120,[],2659,"8dd6d3c5-fe95-44d9-a931-529b6523021f",[],{"html":1116,"sections":1117,"segments":1132},"\u003Cp>The following functionality adds some helper functions to your templates to allow you to dynamically restrict the countries and states that can be used by your customers to check out.\u003C\u002Fp>\u003Cblockquote>\u003Cp>\u003Cstrong>Important:\u003C\u002Fstrong> The functionality described on this page require advanced javascript knowledge, and are not officially supported. They are included in our official wiki because certain shipping methods and functionality are not natively supported, and though we are working on radically improving our shipping functionality, in the meantime these methods may be great workarounds.\u003C\u002Fp>\u003C\u002Fblockquote>\u003Cp>See the changelog for details on updates to this script.\u003C\u002Fp>\u003Csection id=\"important-note\" data-title=\"Important note\" data-title-node=\"H2\">\u003Chr class=\"my-8\" style=\"margin-left: -48px; margin-right: -40vw\">\u003Ch2 data-anchor-id=\"important-note\">Important note\u003C\u002Fh2>\u003Cp>Starting in 2.0, there is now a template configuration option to limit countries and states from right within your store&#039;s Foxy administration. This new option allows you to alter what locations are available for both the billing and shipping (either matching or independent of each other), without the need for the following snippet. You can access this feature from the &quot;configuration&quot; section under &quot;templates&quot;, look for &quot;Customize allowlist\u002Fblocklist filtering of countries and regions&quot;.\u003C\u002Fp>\u003Cp>If you need to dynamically restrict the locations - for example, prevent orders from outside your country if perishable products are purchased, you can utilise the following script to do that. Otherwise, if your restrictions are static and don&#039;t depend on certain conditions being met, use the option in your store&#039;s admin.\u003C\u002Fp>\u003C\u002Fsection>\u003Csection id=\"step-1-add-javascript\" data-title=\"Step 1: Add Javascript\" data-title-node=\"H2\">\u003Chr class=\"my-8\" style=\"margin-left: -48px; margin-right: -40vw\">\u003Ch2 data-anchor-id=\"step-1-add-javascript\">Step 1: Add Javascript\u003C\u002Fh2>\u003Cp>Add the following in the &quot;footer&quot; section of the &quot;Add custom header and footer code to your templates&quot; option, found on the &quot;configuration&quot; page of your store&#039;s Foxy administration.\u003C\u002Fp>\u003Cdiv class=\"position-relative w-100 overflow-hidden rounded-2\" data-code-block>\u003Cdiv class=\"d-flex justify-content-end border-bottom\" style=\"background:#2b2c3b;\">\u003Cbutton type=\"button\" class=\"btn btn-link btn-sm text-light\" title=\"Copy\" data-code-button>\u003Cspan data-code-default style=\"\">\u003Ci class=\"fal fa-copy me-2\">\u003C\u002Fi> Copy \u003C\u002Fspan>\u003Cspan class=\"text-success\" data-code-success style=\"display:none;\">\u003Ci class=\"fal fa-check ms-2\">\u003C\u002Fi> Copied \u003C\u002Fspan>\u003C\u002Fbutton>\u003C\u002Fdiv>\u003Cdiv class=\"small\">\u003Cpre class=\"hljs p-2\" data-code-content>{% if context == &#x27;cart&#x27; or context == &#x27;checkout&#x27; %}\n\u003Cspan class=\"hljs-tag\">&lt;\u003Cspan class=\"hljs-name\">script\u003C\u002Fspan> \u003Cspan class=\"hljs-attr\">type\u003C\u002Fspan>=\u003Cspan class=\"hljs-string\">&quot;text\u002Fjavascript&quot;\u003C\u002Fspan> \u003Cspan class=\"hljs-attr\">charset\u003C\u002Fspan>=\u003Cspan class=\"hljs-string\">&quot;utf-8&quot;\u003C\u002Fspan>&gt;\u003C\u002Fspan>\u003Cspan class=\"language-javascript\">\n(\u003Cspan class=\"hljs-keyword\">function\u003C\u002Fspan>(\u003Cspan class=\"hljs-params\">$, FC\u003C\u002Fspan>) {\n    \u003Cspan class=\"hljs-variable constant_\">FC\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">locations\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">logic\u003C\u002Fspan> = \u003Cspan class=\"hljs-keyword\">function\u003C\u002Fspan>(\u003Cspan class=\"hljs-params\">\u003C\u002Fspan>) {\n    \u003Cspan class=\"hljs-comment\">\u002F* BEGIN CUSTOM LOCATION LOGIC *\u002F\u003C\u002Fspan>\n\n    \u003Cspan class=\"hljs-comment\">\u002F* END CUSTOM LOCATION LOGIC *\u002F\u003C\u002Fspan>\n    };\n\n    \u003Cspan class=\"hljs-comment\">\u002F* Country\u002FState Helper Functions v2.2 *\u002F\u003C\u002Fspan>\n    \u003Cspan class=\"hljs-variable constant_\">FC\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">locations\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">removeCountries\u003C\u002Fspan>=\u003Cspan class=\"hljs-keyword\">function\u003C\u002Fspan>(\u003Cspan class=\"hljs-params\">a,b\u003C\u002Fspan>){\u003Cspan class=\"hljs-keyword\">if\u003C\u002Fspan>(\u003Cspan class=\"hljs-string\">&quot;undefined&quot;\u003C\u002Fspan>==\u003Cspan class=\"hljs-keyword\">typeof\u003C\u002Fspan> a)\u003Cspan class=\"hljs-keyword\">return\u003C\u002Fspan>!\u003Cspan class=\"hljs-number\">1\u003C\u002Fspan>;\u003Cspan class=\"hljs-string\">&quot;string&quot;\u003C\u002Fspan>==\u003Cspan class=\"hljs-keyword\">typeof\u003C\u002Fspan> a&amp;&amp;(a=[a]);b=\u003Cspan class=\"hljs-variable constant_\">FC\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">locations\u003C\u002Fspan>.\u003Cspan class=\"hljs-title function_\">validateLocationArrayNames\u003C\u002Fspan>(b);\u003Cspan class=\"hljs-keyword\">for\u003C\u002Fspan>(l \u003Cspan class=\"hljs-keyword\">in\u003C\u002Fspan> b){\u003Cspan class=\"hljs-number\">0\u003C\u002Fspan>===\u003Cspan class=\"hljs-variable constant_\">FC\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">json\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">config\u003C\u002Fspan>[\u003Cspan class=\"hljs-string\">&quot;locations_&quot;\u003C\u002Fspan>+b[l]].\u003Cspan class=\"hljs-property\">length\u003C\u002Fspan>&amp;&amp;(\u003Cspan class=\"hljs-variable constant_\">FC\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">json\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">config\u003C\u002Fspan>[\u003Cspan class=\"hljs-string\">&quot;locations_&quot;\u003C\u002Fspan>+b[l]]={});\u003Cspan class=\"hljs-keyword\">for\u003C\u002Fspan>(\u003Cspan class=\"hljs-keyword\">var\u003C\u002Fspan> c \u003Cspan class=\"hljs-keyword\">in\u003C\u002Fspan> a)\u003Cspan class=\"hljs-variable constant_\">FC\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">json\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">config\u003C\u002Fspan>[\u003Cspan class=\"hljs-string\">&quot;locations_&quot;\u003C\u002Fspan>+b[l]][a[c]]=\u003Cspan class=\"hljs-string\">&quot;*&quot;\u003C\u002Fspan>}\u003Cspan class=\"hljs-keyword\">return\u003C\u002Fspan>!\u003Cspan class=\"hljs-number\">0\u003C\u002Fspan>};\n    \u003Cspan class=\"hljs-variable constant_\">FC\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">locations\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">limitCountriesTo\u003C\u002Fspan>=\u003Cspan class=\"hljs-keyword\">function\u003C\u002Fspan>(\u003Cspan class=\"hljs-params\">a,b\u003C\u002Fspan>){\u003Cspan class=\"hljs-keyword\">if\u003C\u002Fspan>(\u003Cspan class=\"hljs-string\">&quot;undefined&quot;\u003C\u002Fspan>==\u003Cspan class=\"hljs-keyword\">typeof\u003C\u002Fspan> a)\u003Cspan class=\"hljs-keyword\">return\u003C\u002Fspan>!\u003Cspan class=\"hljs-number\">1\u003C\u002Fspan>;\u003Cspan class=\"hljs-string\">&quot;string&quot;\u003C\u002Fspan>==\u003Cspan class=\"hljs-keyword\">typeof\u003C\u002Fspan> a&amp;&amp;(a=[a]);b=\u003Cspan class=\"hljs-variable constant_\">FC\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">locations\u003C\u002Fspan>.\u003Cspan class=\"hljs-title function_\">validateLocationArrayNames\u003C\u002Fspan>(b);\u003Cspan class=\"hljs-keyword\">for\u003C\u002Fspan>(l \u003Cspan class=\"hljs-keyword\">in\u003C\u002Fspan> b){\u003Cspan class=\"hljs-keyword\">var\u003C\u002Fspan> c=\u003Cspan class=\"hljs-variable constant_\">FC\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">json\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">config\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">locations\u003C\u002Fspan>;\u003Cspan class=\"hljs-variable constant_\">FC\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">json\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">config\u003C\u002Fspan>[\u003Cspan class=\"hljs-string\">&quot;locations_&quot;\u003C\u002Fspan>+b[l]]={};\u003Cspan class=\"hljs-keyword\">for\u003C\u002Fspan>(\u003Cspan class=\"hljs-keyword\">var\u003C\u002Fspan> d \u003Cspan class=\"hljs-keyword\">in\u003C\u002Fspan> c)-\u003Cspan class=\"hljs-number\">1\u003C\u002Fspan>==a.\u003Cspan class=\"hljs-title function_\">indexOf\u003C\u002Fspan>(d)&amp;&amp;(\u003Cspan class=\"hljs-variable constant_\">FC\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">json\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">config\u003C\u002Fspan>[\u003Cspan class=\"hljs-string\">&quot;locations_&quot;\u003C\u002Fspan>+b[l]][d]=\u003Cspan class=\"hljs-string\">&quot;*&quot;\u003C\u002Fspan>)}\u003Cspan class=\"hljs-keyword\">return\u003C\u002Fspan>!\u003Cspan class=\"hljs-number\">0\u003C\u002Fspan>};\n    \u003Cspan class=\"hljs-variable constant_\">FC\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">locations\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">removeStates\u003C\u002Fspan>=\u003Cspan class=\"hljs-keyword\">function\u003C\u002Fspan>(\u003Cspan class=\"hljs-params\">a,b,c\u003C\u002Fspan>){\u003Cspan class=\"hljs-keyword\">if\u003C\u002Fspan>(\u003Cspan class=\"hljs-string\">&quot;undefined&quot;\u003C\u002Fspan>==\u003Cspan class=\"hljs-keyword\">typeof\u003C\u002Fspan> a||\u003Cspan class=\"hljs-string\">&quot;undefined&quot;\u003C\u002Fspan>==\u003Cspan class=\"hljs-keyword\">typeof\u003C\u002Fspan> b)\u003Cspan class=\"hljs-keyword\">return\u003C\u002Fspan>!\u003Cspan class=\"hljs-number\">1\u003C\u002Fspan>;\u003Cspan class=\"hljs-string\">&quot;string&quot;\u003C\u002Fspan>==\u003Cspan class=\"hljs-keyword\">typeof\u003C\u002Fspan> b&amp;&amp;(b=[b]);c=\u003Cspan class=\"hljs-variable constant_\">FC\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">locations\u003C\u002Fspan>.\u003Cspan class=\"hljs-title function_\">validateLocationArrayNames\u003C\u002Fspan>(c);\u003Cspan class=\"hljs-keyword\">for\u003C\u002Fspan>(l \u003Cspan class=\"hljs-keyword\">in\u003C\u002Fspan> c){\u003Cspan class=\"hljs-keyword\">if\u003C\u002Fspan>(\u003Cspan class=\"hljs-string\">&quot;undefined&quot;\u003C\u002Fspan>==\u003Cspan class=\"hljs-keyword\">typeof\u003C\u002Fspan> \u003Cspan class=\"hljs-variable constant_\">FC\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">json\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">config\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">locations\u003C\u002Fspan>[a])\u003Cspan class=\"hljs-keyword\">return\u003C\u002Fspan>!\u003Cspan class=\"hljs-number\">1\u003C\u002Fspan>;\u003Cspan class=\"hljs-variable constant_\">FC\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">json\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">config\u003C\u002Fspan>[\u003Cspan class=\"hljs-string\">&quot;locations_&quot;\u003C\u002Fspan>+c[l]].\u003Cspan class=\"hljs-title function_\">hasOwnProperty\u003C\u002Fspan>(a)||(\u003Cspan class=\"hljs-variable constant_\">FC\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">json\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">config\u003C\u002Fspan>[\u003Cspan class=\"hljs-string\">&quot;locations_&quot;\u003C\u002Fspan>+c[l]][a]=[]);\u003Cspan class=\"hljs-keyword\">for\u003C\u002Fspan>(\u003Cspan class=\"hljs-keyword\">var\u003C\u002Fspan> d \u003Cspan class=\"hljs-keyword\">in\u003C\u002Fspan> b)\u003Cspan class=\"hljs-variable constant_\">FC\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">json\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">config\u003C\u002Fspan>[\u003Cspan class=\"hljs-string\">&quot;locations_&quot;\u003C\u002Fspan>+c[l]][a].\u003Cspan class=\"hljs-title function_\">push\u003C\u002Fspan>(b[d])}\u003Cspan class=\"hljs-keyword\">return\u003C\u002Fspan>!\u003Cspan class=\"hljs-number\">0\u003C\u002Fspan>};\n    \u003Cspan class=\"hljs-variable constant_\">FC\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">locations\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">limitStatesTo\u003C\u002Fspan>=\u003Cspan class=\"hljs-keyword\">function\u003C\u002Fspan>(\u003Cspan class=\"hljs-params\">a,b,c\u003C\u002Fspan>){\u003Cspan class=\"hljs-keyword\">if\u003C\u002Fspan>(\u003Cspan class=\"hljs-string\">&quot;undefined&quot;\u003C\u002Fspan>==\u003Cspan class=\"hljs-keyword\">typeof\u003C\u002Fspan> a||\u003Cspan class=\"hljs-string\">&quot;undefined&quot;\u003C\u002Fspan>==\u003Cspan class=\"hljs-keyword\">typeof\u003C\u002Fspan> b)\u003Cspan class=\"hljs-keyword\">return\u003C\u002Fspan>!\u003Cspan class=\"hljs-number\">1\u003C\u002Fspan>;\u003Cspan class=\"hljs-string\">&quot;string&quot;\u003C\u002Fspan>==\u003Cspan class=\"hljs-keyword\">typeof\u003C\u002Fspan> b&amp;&amp;(b=[b]);c=\u003Cspan class=\"hljs-variable constant_\">FC\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">locations\u003C\u002Fspan>.\u003Cspan class=\"hljs-title function_\">validateLocationArrayNames\u003C\u002Fspan>(c);\u003Cspan class=\"hljs-keyword\">for\u003C\u002Fspan>(l \u003Cspan class=\"hljs-keyword\">in\u003C\u002Fspan> c){\u003Cspan class=\"hljs-keyword\">var\u003C\u002Fspan> d=\u003Cspan class=\"hljs-variable constant_\">FC\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">json\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">config\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">locations\u003C\u002Fspan>;\u003Cspan class=\"hljs-keyword\">if\u003C\u002Fspan>(\u003Cspan class=\"hljs-string\">&quot;undefined&quot;\u003C\u002Fspan>==\u003Cspan class=\"hljs-keyword\">typeof\u003C\u002Fspan> d[a])\u003Cspan class=\"hljs-keyword\">return\u003C\u002Fspan>!\u003Cspan class=\"hljs-number\">1\u003C\u002Fspan>;\u003Cspan class=\"hljs-variable constant_\">FC\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">json\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">config\u003C\u002Fspan>[\u003Cspan class=\"hljs-string\">&quot;locations_&quot;\u003C\u002Fspan>+c[l]][a]=[];\u003Cspan class=\"hljs-keyword\">for\u003C\u002Fspan>(\u003Cspan class=\"hljs-keyword\">var\u003C\u002Fspan> e \u003Cspan class=\"hljs-keyword\">in\u003C\u002Fspan> d[a].\u003Cspan class=\"hljs-property\">r\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">options\u003C\u002Fspan>)-\u003Cspan class=\"hljs-number\">1\u003C\u002Fspan>==jQuery.\u003Cspan class=\"hljs-title function_\">inArray\u003C\u002Fspan>(e,b)&amp;&amp;\u003Cspan class=\"hljs-variable constant_\">FC\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">json\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">config\u003C\u002Fspan>[\u003Cspan class=\"hljs-string\">&quot;locations_&quot;\u003C\u002Fspan>+c[l]][a].\u003Cspan class=\"hljs-title function_\">push\u003C\u002Fspan>(e)}\u003Cspan class=\"hljs-keyword\">return\u003C\u002Fspan>!\u003Cspan class=\"hljs-number\">0\u003C\u002Fspan>};\n    \u003Cspan class=\"hljs-variable constant_\">FC\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">locations\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">validateLocationArrayNames\u003C\u002Fspan>=\u003Cspan class=\"hljs-keyword\">function\u003C\u002Fspan>(\u003Cspan class=\"hljs-params\">a\u003C\u002Fspan>){\u003Cspan class=\"hljs-keyword\">if\u003C\u002Fspan>(\u003Cspan class=\"hljs-string\">&quot;undefined&quot;\u003C\u002Fspan>==\u003Cspan class=\"hljs-keyword\">typeof\u003C\u002Fspan> a||\u003Cspan class=\"hljs-string\">&quot;&quot;\u003C\u002Fspan>==a||\u003Cspan class=\"hljs-string\">&quot;both&quot;\u003C\u002Fspan>==a)a=[\u003Cspan class=\"hljs-string\">&quot;billing&quot;\u003C\u002Fspan>,\u003Cspan class=\"hljs-string\">&quot;shipping&quot;\u003C\u002Fspan>];\u003Cspan class=\"hljs-string\">&quot;string&quot;\u003C\u002Fspan>==\u003Cspan class=\"hljs-keyword\">typeof\u003C\u002Fspan> a&amp;&amp;(a=[a]);\u003Cspan class=\"hljs-keyword\">for\u003C\u002Fspan>(\u003Cspan class=\"hljs-keyword\">var\u003C\u002Fspan> b=\u003Cspan class=\"hljs-number\">0\u003C\u002Fspan>;b&lt;a.\u003Cspan class=\"hljs-property\">length\u003C\u002Fspan>;b++)\u003Cspan class=\"hljs-string\">&quot;customer&quot;\u003C\u002Fspan>==a[b]&amp;&amp;(a[b]=\u003Cspan class=\"hljs-string\">&quot;billing&quot;\u003C\u002Fspan>);\u003Cspan class=\"hljs-keyword\">return\u003C\u002Fspan> a};\u003Cspan class=\"hljs-variable constant_\">FC\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">locations\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">reset\u003C\u002Fspan>=\u003Cspan class=\"hljs-keyword\">function\u003C\u002Fspan>(\u003Cspan class=\"hljs-params\">a\u003C\u002Fspan>){a=\u003Cspan class=\"hljs-variable constant_\">FC\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">locations\u003C\u002Fspan>.\u003Cspan class=\"hljs-title function_\">validateLocationArrayNames\u003C\u002Fspan>(a);\u003Cspan class=\"hljs-keyword\">for\u003C\u002Fspan>(l \u003Cspan class=\"hljs-keyword\">in\u003C\u002Fspan> a)\u003Cspan class=\"hljs-variable constant_\">FC\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">json\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">config\u003C\u002Fspan>[\u003Cspan class=\"hljs-string\">&quot;locations_&quot;\u003C\u002Fspan>+a[l]]=\u003Cspan class=\"hljs-variable constant_\">FC\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">locations\u003C\u002Fspan>.\u003Cspan class=\"hljs-title function_\">hasOwnProperty\u003C\u002Fspan>(\u003Cspan class=\"hljs-string\">&quot;locations_&quot;\u003C\u002Fspan>+a[l]+\u003Cspan class=\"hljs-string\">&quot;_default&quot;\u003C\u002Fspan>)?\u003Cspan class=\"hljs-variable constant_\">FC\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">locations\u003C\u002Fspan>[\u003Cspan class=\"hljs-string\">&quot;locations_&quot;\u003C\u002Fspan>+a[l]+\u003Cspan class=\"hljs-string\">&quot;_default&quot;\u003C\u002Fspan>]:{};\u003Cspan class=\"hljs-title function_\">customLocationsExecute\u003C\u002Fspan>()};\n    \u003Cspan class=\"hljs-keyword\">function\u003C\u002Fspan> \u003Cspan class=\"hljs-title function_\">customLocationsHandler\u003C\u002Fspan>(\u003Cspan class=\"hljs-params\">\u003C\u002Fspan>){\u003Cspan class=\"hljs-variable constant_\">FC\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">locations\u003C\u002Fspan>.\u003Cspan class=\"hljs-title function_\">hasOwnProperty\u003C\u002Fspan>(\u003Cspan class=\"hljs-string\">&quot;locations_billing_default&quot;\u003C\u002Fspan>)?\u003Cspan class=\"hljs-variable constant_\">FC\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">locations\u003C\u002Fspan>.\u003Cspan class=\"hljs-title function_\">reset\u003C\u002Fspan>():(\u003Cspan class=\"hljs-variable constant_\">FC\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">locations\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">locations_billing_default\u003C\u002Fspan>=\u003Cspan class=\"hljs-variable constant_\">FC\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">json\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">config\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">locations_billing\u003C\u002Fspan>,\u003Cspan class=\"hljs-variable constant_\">FC\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">locations\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">locations_shipping_default\u003C\u002Fspan>=\u003Cspan class=\"hljs-variable constant_\">FC\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">json\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">config\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">locations_shipping\u003C\u002Fspan>,\u003Cspan class=\"hljs-title function_\">customLocationsExecute\u003C\u002Fspan>())}\n    \u003Cspan class=\"hljs-keyword\">function\u003C\u002Fspan> \u003Cspan class=\"hljs-title function_\">customLocationsExecute\u003C\u002Fspan>(\u003Cspan class=\"hljs-params\">\u003C\u002Fspan>){\u003Cspan class=\"hljs-variable constant_\">FC\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">locations\u003C\u002Fspan>.\u003Cspan class=\"hljs-title function_\">logic\u003C\u002Fspan>();\u003Cspan class=\"hljs-variable constant_\">FC\u003C\u002Fspan>.\u003Cspan class=\"hljs-title class_\">Template\u003C\u002Fspan>(\u003Cspan class=\"hljs-variable constant_\">FC\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">json\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">context\u003C\u002Fspan>).\u003Cspan class=\"hljs-title function_\">clearOutput\u003C\u002Fspan>();\u003Cspan class=\"hljs-string\">&quot;cart&quot;\u003C\u002Fspan>==\u003Cspan class=\"hljs-variable constant_\">FC\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">json\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">context\u003C\u002Fspan>?\u003Cspan class=\"hljs-variable constant_\">FC\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">cart\u003C\u002Fspan>.\u003Cspan class=\"hljs-title function_\">renderAddressEntry\u003C\u002Fspan>():(\u003Cspan class=\"hljs-variable constant_\">FC\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">checkout\u003C\u002Fspan>.\u003Cspan class=\"hljs-title function_\">renderCustomerBilling\u003C\u002Fspan>(),\u003Cspan class=\"hljs-variable constant_\">FC\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">checkout\u003C\u002Fspan>.\u003Cspan class=\"hljs-title function_\">renderCustomerShipping\u003C\u002Fspan>())};\n    {% \u003Cspan class=\"hljs-keyword\">if\u003C\u002Fspan> cart_is_fullpage or context == \u003Cspan class=\"hljs-string\">&#x27;checkout&#x27;\u003C\u002Fspan> %}\u003Cspan class=\"hljs-variable constant_\">FC\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">client\u003C\u002Fspan>.\u003Cspan class=\"hljs-title function_\">on\u003C\u002Fspan>(\u003Cspan class=\"hljs-string\">&#x27;ready&#x27;\u003C\u002Fspan>, customLocationsHandler);{% \u003Cspan class=\"hljs-keyword\">else\u003C\u002Fspan> %}\u003Cspan class=\"hljs-title function_\">customLocationsHandler\u003C\u002Fspan>();{% endif %}\n})(jQuery, \u003Cspan class=\"hljs-variable constant_\">FC\u003C\u002Fspan>);\n\u003C\u002Fspan>\u003Cspan class=\"hljs-tag\">&lt;\u002F\u003Cspan class=\"hljs-name\">script\u003C\u002Fspan>&gt;\u003C\u002Fspan>\n{% endif %}\u003C\u002Fpre>\u003C\u002Fdiv>\u003C\u002Fdiv>\u003C\u002Fsection>\u003Csection id=\"step-2-add-custom-location-rules\" data-title=\"Step 2: Add Custom Location Rules\" data-title-node=\"H2\">\u003Chr class=\"my-8\" style=\"margin-left: -48px; margin-right: -40vw\">\u003Ch2 data-anchor-id=\"step-2-add-custom-location-rules\">Step 2: Add Custom Location Rules\u003C\u002Fh2>\u003Cp>Now the fun part, based on whatever criteria you want, add in the different country\u002Fstate restrictions you require for your checkout. Add your custom code between the \u003Ccode class=\"badge bg-soft-danger text-danger\">\u002F* BEGIN CUSTOM LOCATION LOGIC *\u002F\u003C\u002Fcode> and \u003Ccode class=\"badge bg-soft-danger text-danger\">\u002F* END CUSTOM LOCATION LOGIC *\u002F\u003C\u002Fcode> lines at the top of the script block. There are five functions available to you.\u003C\u002Fp>\u003Ch4>FC.locations.removeCountries()\u003C\u002Fh4>\u003Cp>Removes the specified countries from the specified locations arrays\u003C\u002Fp>\u003Cp>\u003Cstrong>Parameters:\u003C\u002Fstrong>\u003C\u002Fp>\u003Cul>\u003Cli>\u003Cp>\u003Ccode class=\"badge bg-soft-danger text-danger\">countries\u003C\u002Fcode> \u003Cem>&lt;wrap lo&gt;(String or Array)&lt;\u002Fwrap&gt;\u003C\u002Fem> - Either a string or an array of strings of the 2 character ISO country codes\u003C\u002Fp>\u003C\u002Fli>\u003Cli>\u003Cp>\u003Ccode class=\"badge bg-soft-danger text-danger\">locationArrayNames\u003C\u002Fcode> \u003Cem>&lt;wrap lo&gt;(String or Array)&lt;\u002Fwrap&gt;\u003C\u002Fem> - \u003Cem>Optional\u003C\u002Fem> - Either a string of either \u003Ccode class=\"badge bg-soft-danger text-danger\">&#039;billing&#039;\u003C\u002Fcode>, \u003Ccode class=\"badge bg-soft-danger text-danger\">&#039;shipping&#039;\u003C\u002Fcode> or \u003Ccode class=\"badge bg-soft-danger text-danger\">&#039;both&#039;\u003C\u002Fcode>, or an array of both like \u003Ccode class=\"badge bg-soft-danger text-danger\">[&#039;billing&#039;, &#039;shipping&#039;]\u003C\u002Fcode>. If not specified, \u003Ccode class=\"badge bg-soft-danger text-danger\">&#039;both&#039;\u003C\u002Fcode> is the automatic default.\u003C\u002Fp>\u003C\u002Fli>\u003C\u002Ful>\u003Cp>\u003Cstrong>Example:\u003C\u002Fstrong>\u003C\u002Fp>\u003Cul>\u003Cli>\u003Cp>\u003Ccode class=\"badge bg-soft-danger text-danger\">FC.locations.removeCountries(&#039;US&#039;);\u003C\u002Fcode> - Removes the United States from both the billing and the shipping country location fields\u003C\u002Fp>\u003C\u002Fli>\u003Cli>\u003Cp>\u003Ccode class=\"badge bg-soft-danger text-danger\">FC.locations.removeCountries([&#039;CA&#039;, &#039;GB&#039;], &#039;shipping&#039;);\u003C\u002Fcode> - Removes Canada and the United Kingdom from the shipping location fields\u003C\u002Fp>\u003C\u002Fli>\u003C\u002Ful>\u003Chr>\u003Ch4>FC.locations.limitCountriesTo()\u003C\u002Fh4>\u003Cp>Restricts the specified locations arrays to just the countries specified\u003C\u002Fp>\u003Cp>\u003Cstrong>Parameters:\u003C\u002Fstrong>\u003C\u002Fp>\u003Cul>\u003Cli>\u003Cp>\u003Ccode class=\"badge bg-soft-danger text-danger\">countries\u003C\u002Fcode> \u003Cem>&lt;wrap lo&gt;(String or Array)&lt;\u002Fwrap&gt;\u003C\u002Fem> - Either a string or an array of strings of the 2 character ISO country codes\u003C\u002Fp>\u003C\u002Fli>\u003Cli>\u003Cp>\u003Ccode class=\"badge bg-soft-danger text-danger\">locationArrayNames\u003C\u002Fcode> \u003Cem>&lt;wrap lo&gt;(String or Array)&lt;\u002Fwrap&gt;\u003C\u002Fem> - \u003Cem>Optional\u003C\u002Fem> - Either a string of either \u003Ccode class=\"badge bg-soft-danger text-danger\">&#039;billing&#039;\u003C\u002Fcode>, \u003Ccode class=\"badge bg-soft-danger text-danger\">&#039;shipping&#039;\u003C\u002Fcode> or \u003Ccode class=\"badge bg-soft-danger text-danger\">&#039;both&#039;\u003C\u002Fcode>, or an array of both like \u003Ccode class=\"badge bg-soft-danger text-danger\">[&#039;billing&#039;, &#039;shipping&#039;]\u003C\u002Fcode>. If not specified, \u003Ccode class=\"badge bg-soft-danger text-danger\">&#039;both&#039;\u003C\u002Fcode> is the automatic default.\u003C\u002Fp>\u003C\u002Fli>\u003C\u002Ful>\u003Cp>\u003Cstrong>Example:\u003C\u002Fstrong>\u003C\u002Fp>\u003Cul>\u003Cli>\u003Cp>\u003Ccode class=\"badge bg-soft-danger text-danger\">FC.locations.limitCountriesTo(&#039;AU&#039;);\u003C\u002Fcode> - Allows only Australia to be selected in the billing and shipping country location fields\u003C\u002Fp>\u003C\u002Fli>\u003Cli>\u003Cp>\u003Ccode class=\"badge bg-soft-danger text-danger\">FC.locations.limitCountriesTo([&#039;US&#039;, &#039;CA&#039;], &#039;shipping&#039;);\u003C\u002Fcode> - Allows only the United States and Canada to be selected for the shipping country\u003C\u002Fp>\u003C\u002Fli>\u003C\u002Ful>\u003Chr>\u003Ch4>FC.locations.removeStates()\u003C\u002Fh4>\u003Cp>Removes the specified states from the specified locations arrays for the specified country\u003C\u002Fp>\u003Cp>\u003Cstrong>Parameters:\u003C\u002Fstrong>\u003C\u002Fp>\u003Cul>\u003Cli>\u003Cp>\u003Ccode class=\"badge bg-soft-danger text-danger\">country\u003C\u002Fcode> \u003Cem>&lt;wrap lo&gt;(String)&lt;\u002Fwrap&gt;\u003C\u002Fem> - A string of the 2 character ISO country codes\u003C\u002Fp>\u003C\u002Fli>\u003Cli>\u003Cp>\u003Ccode class=\"badge bg-soft-danger text-danger\">states\u003C\u002Fcode> \u003Cem>&lt;wrap lo&gt;(String or Array)&lt;\u002Fwrap&gt;\u003C\u002Fem> - Either a string or an array of strings of the ISO state codes\u003C\u002Fp>\u003C\u002Fli>\u003Cli>\u003Cp>\u003Ccode class=\"badge bg-soft-danger text-danger\">locationArrayNames\u003C\u002Fcode> \u003Cem>&lt;wrap lo&gt;(String or Array)&lt;\u002Fwrap&gt;\u003C\u002Fem> - \u003Cem>Optional\u003C\u002Fem> - Either a string of either \u003Ccode class=\"badge bg-soft-danger text-danger\">&#039;billing&#039;\u003C\u002Fcode>, \u003Ccode class=\"badge bg-soft-danger text-danger\">&#039;shipping&#039;\u003C\u002Fcode> or \u003Ccode class=\"badge bg-soft-danger text-danger\">&#039;both&#039;\u003C\u002Fcode>, or an array of both like \u003Ccode class=\"badge bg-soft-danger text-danger\">[&#039;billing&#039;, &#039;shipping&#039;]\u003C\u002Fcode>. If not specified, \u003Ccode class=\"badge bg-soft-danger text-danger\">&#039;both&#039;\u003C\u002Fcode> is the automatic default.\u003C\u002Fp>\u003C\u002Fli>\u003C\u002Ful>\u003Cp>\u003Cstrong>Example:\u003C\u002Fstrong>\u003C\u002Fp>\u003Cul>\u003Cli>\u003Cp>\u003Ccode class=\"badge bg-soft-danger text-danger\">FC.locations.removeStates(&#039;US&#039;, &#039;AK&#039;);\u003C\u002Fcode> - Prevents Alaska from being selected as a state when the United States is selected\u003C\u002Fp>\u003C\u002Fli>\u003Cli>\u003Cp>\u003Ccode class=\"badge bg-soft-danger text-danger\">FC.locations.removeStates(&#039;US&#039;, [&#039;AK&#039;, &#039;HI&#039;], &#039;shipping&#039;);\u003C\u002Fcode> - Prevents Alaska and Hawaii from being selected as a state for shipping when the United States is selected as the shipping country\u003C\u002Fp>\u003C\u002Fli>\u003C\u002Ful>\u003Chr>\u003Ch4>FC.locations.limitStatesTo()\u003C\u002Fh4>\u003Cp>Restricts the states for the specified country to only those specified\u003C\u002Fp>\u003Cp>\u003Cstrong>Parameters:\u003C\u002Fstrong>\u003C\u002Fp>\u003Cul>\u003Cli>\u003Cp>\u003Ccode class=\"badge bg-soft-danger text-danger\">country\u003C\u002Fcode> \u003Cem>&lt;wrap lo&gt;(String)&lt;\u002Fwrap&gt;\u003C\u002Fem> - A string of the 2 character ISO country codes\u003C\u002Fp>\u003C\u002Fli>\u003Cli>\u003Cp>\u003Ccode class=\"badge bg-soft-danger text-danger\">states\u003C\u002Fcode> \u003Cem>&lt;wrap lo&gt;(String or Array)&lt;\u002Fwrap&gt;\u003C\u002Fem> - Either a string or an array of strings of the ISO state codes\u003C\u002Fp>\u003C\u002Fli>\u003Cli>\u003Cp>\u003Ccode class=\"badge bg-soft-danger text-danger\">locationArrayNames\u003C\u002Fcode> \u003Cem>&lt;wrap lo&gt;(String or Array)&lt;\u002Fwrap&gt;\u003C\u002Fem> - \u003Cem>Optional\u003C\u002Fem> - Either a string of either \u003Ccode class=\"badge bg-soft-danger text-danger\">&#039;billing&#039;\u003C\u002Fcode>, \u003Ccode class=\"badge bg-soft-danger text-danger\">&#039;shipping&#039;\u003C\u002Fcode> or \u003Ccode class=\"badge bg-soft-danger text-danger\">&#039;both&#039;\u003C\u002Fcode>, or an array of both like \u003Ccode class=\"badge bg-soft-danger text-danger\">[&#039;billing&#039;, &#039;shipping&#039;]\u003C\u002Fcode>. If not specified, \u003Ccode class=\"badge bg-soft-danger text-danger\">&#039;both&#039;\u003C\u002Fcode> is the automatic default.\u003C\u002Fp>\u003C\u002Fli>\u003C\u002Ful>\u003Cp>\u003Cstrong>Example:\u003C\u002Fstrong>\u003C\u002Fp>\u003Cul>\u003Cli>\u003Cp>\u003Ccode class=\"badge bg-soft-danger text-danger\">FC.locations.limitStatesTo(&#039;US&#039;, &#039;CA&#039;);\u003C\u002Fcode> - Allows only California to be selected as a state when the United States is selected\u003C\u002Fp>\u003C\u002Fli>\u003Cli>\u003Cp>\u003Ccode class=\"badge bg-soft-danger text-danger\">FC.locations.limitStatesTo(&#039;AU&#039;, [&#039;SA&#039;, &#039;VIC&#039;, &#039;QLD&#039;], &#039;shipping&#039;);\u003C\u002Fcode> - Allows only South Australia, Victoria and Queensland from being selected for shipping when Australia is selected as the shipping country.\u003C\u002Fp>\u003C\u002Fli>\u003C\u002Ful>\u003Chr>\u003Ch4>FC.locations.reset()\u003C\u002Fh4>\u003Cp>Resets the location restrictions back to the store default, as set in the &quot;configuration&quot; in the Foxy administration. Best used through the javascript events on the cart\u002Fcheckout to trigger the reset based on events, such as removing an item from the cart.\u003C\u002Fp>\u003Cp>\u003Cstrong>Parameters:\u003C\u002Fstrong>\u003C\u002Fp>\u003Cul>\u003Cli>\u003Cp>\u003Ccode class=\"badge bg-soft-danger text-danger\">locationArrayNames\u003C\u002Fcode> \u003Cem>&lt;wrap lo&gt;(String or Array)&lt;\u002Fwrap&gt;\u003C\u002Fem> - \u003Cem>Optional\u003C\u002Fem> - Either a string of either \u003Ccode class=\"badge bg-soft-danger text-danger\">&#039;billing&#039;\u003C\u002Fcode>, \u003Ccode class=\"badge bg-soft-danger text-danger\">&#039;shipping&#039;\u003C\u002Fcode> or \u003Ccode class=\"badge bg-soft-danger text-danger\">&#039;both&#039;\u003C\u002Fcode>, or an array of both like \u003Ccode class=\"badge bg-soft-danger text-danger\">[&#039;billing&#039;, &#039;shipping&#039;]\u003C\u002Fcode>. If not specified, \u003Ccode class=\"badge bg-soft-danger text-danger\">&#039;both&#039;\u003C\u002Fcode> is the automatic default.\u003C\u002Fp>\u003C\u002Fli>\u003C\u002Ful>\u003Cp>\u003Cstrong>Example:\u003C\u002Fstrong>\u003C\u002Fp>\u003Cul>\u003Cli>\u003Cp>\u003Ccode class=\"badge bg-soft-danger text-danger\">FC.locations.reset;\u003C\u002Fcode> - Reset the location restrictions back to default\u003C\u002Fp>\u003C\u002Fli>\u003Cli>\u003Cp>\u003Ccode class=\"badge bg-soft-danger text-danger\">FC.client.on(&#039;cart-item-remove.done&#039;, function() { FC.locations.reset(); });\u003C\u002Fcode> - Reset location restrictions whenever an item is removed from the cart\u003C\u002Fp>\u003C\u002Fli>\u003C\u002Ful>\u003C\u002Fsection>\u003Csection id=\"examples\" data-title=\"Examples\" data-title-node=\"H3\">\u003Ch3 data-anchor-id=\"examples\">Examples\u003C\u002Fh3>\u003Ch4>Example 1\u003C\u002Fh4>\u003Cul>\u003Cli>\u003Cp>Restricting the checkout to only allow shipping to the United States, but allow billing to be from any country\u003C\u002Fp>\u003C\u002Fli>\u003C\u002Ful>\u003Cp>javascript\u003C\u002Fp>\u003Cdiv class=\"position-relative w-100 overflow-hidden rounded-2\" data-code-block>\u003Cdiv class=\"d-flex justify-content-end border-bottom\" style=\"background:#2b2c3b;\">\u003Cbutton type=\"button\" class=\"btn btn-link btn-sm text-light\" title=\"Copy\" data-code-button>\u003Cspan data-code-default style=\"\">\u003Ci class=\"fal fa-copy me-2\">\u003C\u002Fi> Copy \u003C\u002Fspan>\u003Cspan class=\"text-success\" data-code-success style=\"display:none;\">\u003Ci class=\"fal fa-check ms-2\">\u003C\u002Fi> Copied \u003C\u002Fspan>\u003C\u002Fbutton>\u003C\u002Fdiv>\u003Cdiv class=\"small\">\u003Cpre class=\"hljs p-2\" data-code-content>FC.locations.limitCountriesTo(&#x27;US&#x27;, &#x27;shipping&#x27;);\u003C\u002Fpre>\u003C\u002Fdiv>\u003C\u002Fdiv>\u003Ch4>Example 2\u003C\u002Fh4>\u003Cul>\u003Cli>\u003Cp>Only allow customers from the US and Canada, and not from Alaska or Hawaii.\u003C\u002Fp>\u003C\u002Fli>\u003C\u002Ful>\u003Cp>javascript\u003C\u002Fp>\u003Cdiv class=\"position-relative w-100 overflow-hidden rounded-2\" data-code-block>\u003Cdiv class=\"d-flex justify-content-end border-bottom\" style=\"background:#2b2c3b;\">\u003Cbutton type=\"button\" class=\"btn btn-link btn-sm text-light\" title=\"Copy\" data-code-button>\u003Cspan data-code-default style=\"\">\u003Ci class=\"fal fa-copy me-2\">\u003C\u002Fi> Copy \u003C\u002Fspan>\u003Cspan class=\"text-success\" data-code-success style=\"display:none;\">\u003Ci class=\"fal fa-check ms-2\">\u003C\u002Fi> Copied \u003C\u002Fspan>\u003C\u002Fbutton>\u003C\u002Fdiv>\u003Cdiv class=\"small\">\u003Cpre class=\"hljs p-2\" data-code-content>FC.locations.limitCountriesTo([&#x27;US&#x27;, &#x27;CA&#x27;]);\nFC.locations.removeStates(&#x27;US&#x27;, [&#x27;AK&#x27;, &#x27;HI&#x27;]);\u003C\u002Fpre>\u003C\u002Fdiv>\u003C\u002Fdiv>\u003Ch4>Example 3\u003C\u002Fh4>\u003Cul>\u003Cli>\u003Cp>Remove all non-standard US States\u003C\u002Fp>\u003C\u002Fli>\u003C\u002Ful>\u003Cp>javascript\u003C\u002Fp>\u003Cdiv class=\"position-relative w-100 overflow-hidden rounded-2\" data-code-block>\u003Cdiv class=\"d-flex justify-content-end border-bottom\" style=\"background:#2b2c3b;\">\u003Cbutton type=\"button\" class=\"btn btn-link btn-sm text-light\" title=\"Copy\" data-code-button>\u003Cspan data-code-default style=\"\">\u003Ci class=\"fal fa-copy me-2\">\u003C\u002Fi> Copy \u003C\u002Fspan>\u003Cspan class=\"text-success\" data-code-success style=\"display:none;\">\u003Ci class=\"fal fa-check ms-2\">\u003C\u002Fi> Copied \u003C\u002Fspan>\u003C\u002Fbutton>\u003C\u002Fdiv>\u003Cdiv class=\"small\">\u003Cpre class=\"hljs p-2\" data-code-content>FC.locations.removeStates(&#x27;US&#x27;, [&#x27;AF&#x27;,&#x27;AA&#x27;,&#x27;AC&#x27;,&#x27;AE&#x27;,&#x27;AM&#x27;,&#x27;AP&#x27;,&#x27;AS&#x27;,&#x27;PR&#x27;,&#x27;VI&#x27;,&#x27;GU&#x27;,&#x27;FM&#x27;,&#x27;MH&#x27;,&#x27;MP&#x27;], &#x27;both&#x27;);\u003C\u002Fpre>\u003C\u002Fdiv>\u003C\u002Fdiv>\u003Ch4>Example 4\u003C\u002Fh4>\u003Cul>\u003Cli>\u003Cp>Remove countries that are currently under sanction restrictions from the US Office of Foreign Assets Control (Note that this list may not be up to date)\u003C\u002Fp>\u003C\u002Fli>\u003C\u002Ful>\u003Cp>javascript\u003C\u002Fp>\u003Cdiv class=\"position-relative w-100 overflow-hidden rounded-2\" data-code-block>\u003Cdiv class=\"d-flex justify-content-end border-bottom\" style=\"background:#2b2c3b;\">\u003Cbutton type=\"button\" class=\"btn btn-link btn-sm text-light\" title=\"Copy\" data-code-button>\u003Cspan data-code-default style=\"\">\u003Ci class=\"fal fa-copy me-2\">\u003C\u002Fi> Copy \u003C\u002Fspan>\u003Cspan class=\"text-success\" data-code-success style=\"display:none;\">\u003Ci class=\"fal fa-check ms-2\">\u003C\u002Fi> Copied \u003C\u002Fspan>\u003C\u002Fbutton>\u003C\u002Fdiv>\u003Cdiv class=\"small\">\u003Cpre class=\"hljs p-2\" data-code-content>FC.locations.removeCountries([&#x27;CU&#x27;,&#x27;IR&#x27;,&#x27;SD&#x27;,&#x27;KP&#x27;]);\u003C\u002Fpre>\u003C\u002Fdiv>\u003C\u002Fdiv>\u003C\u002Fsection>\u003Csection id=\"what-about-making-it-read-only\" data-title=\"What about making it read-only?\" data-title-node=\"H2\">\u003Chr class=\"my-8\" style=\"margin-left: -48px; margin-right: -40vw\">\u003Ch2 data-anchor-id=\"what-about-making-it-read-only\">What about making it read-only?\u003C\u002Fh2>\u003Cp>As part of the new autocomplete functionality from version 1.0, any location object that only has one option will automatically become read-only with that location selected by default. If you want to set a field read only, utilise the \u003Ccode class=\"badge bg-soft-danger text-danger\">limitCountriesTo()\u003C\u002Fcode> or \u003Ccode class=\"badge bg-soft-danger text-danger\">limitStatesTo()\u003C\u002Fcode> functions with only a single location specified.\u003C\u002Fp>\u003C\u002Fsection>\u003Csection id=\"changelog\" data-title=\"Changelog\" data-title-node=\"H2\">\u003Chr class=\"my-8\" style=\"margin-left: -48px; margin-right: -40vw\">\u003Ch2 data-anchor-id=\"changelog\">Changelog\u003C\u002Fh2>\u003Cul>\u003Cli>\u003Cp>2014\u002F08\u002F21 - v2.0 - Initial version\u003C\u002Fp>\u003C\u002Fli>\u003Cli>\u003Cp>2019\u002F11\u002F09 - v2.1 - Adding \u003Ccode class=\"badge bg-soft-danger text-danger\">reset()\u003C\u002Fcode> function\u003C\u002Fp>\u003C\u002Fli>\u003Cli>\u003Cp>2020\u002F02\u002F20 - v2.2 - Triggering \u003Ccode class=\"badge bg-soft-danger text-danger\">reset()\u003C\u002Fcode> before the custom logic is run subsequent times on the same page\u003C\u002Fp>\u003C\u002Fli>\u003C\u002Ful>\u003C\u002Fsection>",[1118,1121,1123,1125,1128,1130],{"id":1119,"title":357,"level":1120},"important-note","H2",{"id":1122,"title":372,"level":1120},"step-1-add-javascript",{"id":1124,"title":388,"level":1120},"step-2-add-custom-location-rules",{"id":1126,"title":948,"level":1127},"examples","H3",{"id":1129,"title":1046,"level":1120},"what-about-making-it-read-only",{"id":1131,"title":1067,"level":1120},"changelog",[1133],{"type":1134,"content":1135},"html","\u003Cp>The following functionality adds some helper functions to your templates to allow you to dynamically restrict the countries and states that can be used by your customers to check out.\u003C\u002Fp>\u003Cblockquote>\u003Cp>\u003Cstrong>Important:\u003C\u002Fstrong> The functionality described on this page require advanced javascript knowledge, and are not officially supported. They are included in our official wiki because certain shipping methods and functionality are not natively supported, and though we are working on radically improving our shipping functionality, in the meantime these methods may be great workarounds.\u003C\u002Fp>\u003C\u002Fblockquote>\u003Cp>See the changelog for details on updates to this script.\u003C\u002Fp>\u003Ch2>Important note\u003C\u002Fh2>\u003Cp>Starting in 2.0, there is now a template configuration option to limit countries and states from right within your store&#039;s Foxy administration. This new option allows you to alter what locations are available for both the billing and shipping (either matching or independent of each other), without the need for the following snippet. You can access this feature from the &quot;configuration&quot; section under &quot;templates&quot;, look for &quot;Customize allowlist\u002Fblocklist filtering of countries and regions&quot;.\u003C\u002Fp>\u003Cp>If you need to dynamically restrict the locations - for example, prevent orders from outside your country if perishable products are purchased, you can utilise the following script to do that. Otherwise, if your restrictions are static and don&#039;t depend on certain conditions being met, use the option in your store&#039;s admin.\u003C\u002Fp>\u003Ch2>Step 1: Add Javascript\u003C\u002Fh2>\u003Cp>Add the following in the &quot;footer&quot; section of the &quot;Add custom header and footer code to your templates&quot; option, found on the &quot;configuration&quot; page of your store&#039;s Foxy administration.\u003C\u002Fp>\u003Cpre>\u003Ccode>{% if context == &#039;cart&#039; or context == &#039;checkout&#039; %}\n&lt;script type=&quot;text\u002Fjavascript&quot; charset=&quot;utf-8&quot;&gt;\n(function($, FC) {\n    FC.locations.logic = function() {\n    \u002F* BEGIN CUSTOM LOCATION LOGIC *\u002F\n\n    \u002F* END CUSTOM LOCATION LOGIC *\u002F\n    };\n\n    \u002F* Country\u002FState Helper Functions v2.2 *\u002F\n    FC.locations.removeCountries=function(a,b){if(&quot;undefined&quot;==typeof a)return!1;&quot;string&quot;==typeof a&amp;&amp;(a=[a]);b=FC.locations.validateLocationArrayNames(b);for(l in b){0===FC.json.config[&quot;locations_&quot;+b[l]].length&amp;&amp;(FC.json.config[&quot;locations_&quot;+b[l]]={});for(var c in a)FC.json.config[&quot;locations_&quot;+b[l]][a[c]]=&quot;*&quot;}return!0};\n    FC.locations.limitCountriesTo=function(a,b){if(&quot;undefined&quot;==typeof a)return!1;&quot;string&quot;==typeof a&amp;&amp;(a=[a]);b=FC.locations.validateLocationArrayNames(b);for(l in b){var c=FC.json.config.locations;FC.json.config[&quot;locations_&quot;+b[l]]={};for(var d in c)-1==a.indexOf(d)&amp;&amp;(FC.json.config[&quot;locations_&quot;+b[l]][d]=&quot;*&quot;)}return!0};\n    FC.locations.removeStates=function(a,b,c){if(&quot;undefined&quot;==typeof a||&quot;undefined&quot;==typeof b)return!1;&quot;string&quot;==typeof b&amp;&amp;(b=[b]);c=FC.locations.validateLocationArrayNames(c);for(l in c){if(&quot;undefined&quot;==typeof FC.json.config.locations[a])return!1;FC.json.config[&quot;locations_&quot;+c[l]].hasOwnProperty(a)||(FC.json.config[&quot;locations_&quot;+c[l]][a]=[]);for(var d in b)FC.json.config[&quot;locations_&quot;+c[l]][a].push(b[d])}return!0};\n    FC.locations.limitStatesTo=function(a,b,c){if(&quot;undefined&quot;==typeof a||&quot;undefined&quot;==typeof b)return!1;&quot;string&quot;==typeof b&amp;&amp;(b=[b]);c=FC.locations.validateLocationArrayNames(c);for(l in c){var d=FC.json.config.locations;if(&quot;undefined&quot;==typeof d[a])return!1;FC.json.config[&quot;locations_&quot;+c[l]][a]=[];for(var e in d[a].r.options)-1==jQuery.inArray(e,b)&amp;&amp;FC.json.config[&quot;locations_&quot;+c[l]][a].push(e)}return!0};\n    FC.locations.validateLocationArrayNames=function(a){if(&quot;undefined&quot;==typeof a||&quot;&quot;==a||&quot;both&quot;==a)a=[&quot;billing&quot;,&quot;shipping&quot;];&quot;string&quot;==typeof a&amp;&amp;(a=[a]);for(var b=0;b&lt;a.length;b++)&quot;customer&quot;==a[b]&amp;&amp;(a[b]=&quot;billing&quot;);return a};FC.locations.reset=function(a){a=FC.locations.validateLocationArrayNames(a);for(l in a)FC.json.config[&quot;locations_&quot;+a[l]]=FC.locations.hasOwnProperty(&quot;locations_&quot;+a[l]+&quot;_default&quot;)?FC.locations[&quot;locations_&quot;+a[l]+&quot;_default&quot;]:{};customLocationsExecute()};\n    function customLocationsHandler(){FC.locations.hasOwnProperty(&quot;locations_billing_default&quot;)?FC.locations.reset():(FC.locations.locations_billing_default=FC.json.config.locations_billing,FC.locations.locations_shipping_default=FC.json.config.locations_shipping,customLocationsExecute())}\n    function customLocationsExecute(){FC.locations.logic();FC.Template(FC.json.context).clearOutput();&quot;cart&quot;==FC.json.context?FC.cart.renderAddressEntry():(FC.checkout.renderCustomerBilling(),FC.checkout.renderCustomerShipping())};\n    {% if cart_is_fullpage or context == &#039;checkout&#039; %}FC.client.on(&#039;ready&#039;, customLocationsHandler);{% else %}customLocationsHandler();{% endif %}\n})(jQuery, FC);\n&lt;\u002Fscript&gt;\n{% endif %}\u003C\u002Fcode>\u003C\u002Fpre>\u003Ch2>Step 2: Add Custom Location Rules\u003C\u002Fh2>\u003Cp>Now the fun part, based on whatever criteria you want, add in the different country\u002Fstate restrictions you require for your checkout. Add your custom code between the \u003Ccode class=\"badge bg-soft-danger text-danger\">\u002F* BEGIN CUSTOM LOCATION LOGIC *\u002F\u003C\u002Fcode> and \u003Ccode class=\"badge bg-soft-danger text-danger\">\u002F* END CUSTOM LOCATION LOGIC *\u002F\u003C\u002Fcode> lines at the top of the script block. There are five functions available to you.\u003C\u002Fp>\u003Ch4>FC.locations.removeCountries()\u003C\u002Fh4>\u003Cp>Removes the specified countries from the specified locations arrays\u003C\u002Fp>\u003Cp>\u003Cstrong>Parameters:\u003C\u002Fstrong>\u003C\u002Fp>\u003Cul>\u003Cli>\u003Cp>\u003Ccode class=\"badge bg-soft-danger text-danger\">countries\u003C\u002Fcode> \u003Cem>&lt;wrap lo&gt;(String or Array)&lt;\u002Fwrap&gt;\u003C\u002Fem> - Either a string or an array of strings of the 2 character ISO country codes\u003C\u002Fp>\u003C\u002Fli>\u003Cli>\u003Cp>\u003Ccode class=\"badge bg-soft-danger text-danger\">locationArrayNames\u003C\u002Fcode> \u003Cem>&lt;wrap lo&gt;(String or Array)&lt;\u002Fwrap&gt;\u003C\u002Fem> - \u003Cem>Optional\u003C\u002Fem> - Either a string of either \u003Ccode class=\"badge bg-soft-danger text-danger\">&#039;billing&#039;\u003C\u002Fcode>, \u003Ccode class=\"badge bg-soft-danger text-danger\">&#039;shipping&#039;\u003C\u002Fcode> or \u003Ccode class=\"badge bg-soft-danger text-danger\">&#039;both&#039;\u003C\u002Fcode>, or an array of both like \u003Ccode class=\"badge bg-soft-danger text-danger\">[&#039;billing&#039;, &#039;shipping&#039;]\u003C\u002Fcode>. If not specified, \u003Ccode class=\"badge bg-soft-danger text-danger\">&#039;both&#039;\u003C\u002Fcode> is the automatic default.\u003C\u002Fp>\u003C\u002Fli>\u003C\u002Ful>\u003Cp>\u003Cstrong>Example:\u003C\u002Fstrong>\u003C\u002Fp>\u003Cul>\u003Cli>\u003Cp>\u003Ccode class=\"badge bg-soft-danger text-danger\">FC.locations.removeCountries(&#039;US&#039;);\u003C\u002Fcode> - Removes the United States from both the billing and the shipping country location fields\u003C\u002Fp>\u003C\u002Fli>\u003Cli>\u003Cp>\u003Ccode class=\"badge bg-soft-danger text-danger\">FC.locations.removeCountries([&#039;CA&#039;, &#039;GB&#039;], &#039;shipping&#039;);\u003C\u002Fcode> - Removes Canada and the United Kingdom from the shipping location fields\u003C\u002Fp>\u003C\u002Fli>\u003C\u002Ful>\u003Chr>\u003Ch4>FC.locations.limitCountriesTo()\u003C\u002Fh4>\u003Cp>Restricts the specified locations arrays to just the countries specified\u003C\u002Fp>\u003Cp>\u003Cstrong>Parameters:\u003C\u002Fstrong>\u003C\u002Fp>\u003Cul>\u003Cli>\u003Cp>\u003Ccode class=\"badge bg-soft-danger text-danger\">countries\u003C\u002Fcode> \u003Cem>&lt;wrap lo&gt;(String or Array)&lt;\u002Fwrap&gt;\u003C\u002Fem> - Either a string or an array of strings of the 2 character ISO country codes\u003C\u002Fp>\u003C\u002Fli>\u003Cli>\u003Cp>\u003Ccode class=\"badge bg-soft-danger text-danger\">locationArrayNames\u003C\u002Fcode> \u003Cem>&lt;wrap lo&gt;(String or Array)&lt;\u002Fwrap&gt;\u003C\u002Fem> - \u003Cem>Optional\u003C\u002Fem> - Either a string of either \u003Ccode class=\"badge bg-soft-danger text-danger\">&#039;billing&#039;\u003C\u002Fcode>, \u003Ccode class=\"badge bg-soft-danger text-danger\">&#039;shipping&#039;\u003C\u002Fcode> or \u003Ccode class=\"badge bg-soft-danger text-danger\">&#039;both&#039;\u003C\u002Fcode>, or an array of both like \u003Ccode class=\"badge bg-soft-danger text-danger\">[&#039;billing&#039;, &#039;shipping&#039;]\u003C\u002Fcode>. If not specified, \u003Ccode class=\"badge bg-soft-danger text-danger\">&#039;both&#039;\u003C\u002Fcode> is the automatic default.\u003C\u002Fp>\u003C\u002Fli>\u003C\u002Ful>\u003Cp>\u003Cstrong>Example:\u003C\u002Fstrong>\u003C\u002Fp>\u003Cul>\u003Cli>\u003Cp>\u003Ccode class=\"badge bg-soft-danger text-danger\">FC.locations.limitCountriesTo(&#039;AU&#039;);\u003C\u002Fcode> - Allows only Australia to be selected in the billing and shipping country location fields\u003C\u002Fp>\u003C\u002Fli>\u003Cli>\u003Cp>\u003Ccode class=\"badge bg-soft-danger text-danger\">FC.locations.limitCountriesTo([&#039;US&#039;, &#039;CA&#039;], &#039;shipping&#039;);\u003C\u002Fcode> - Allows only the United States and Canada to be selected for the shipping country\u003C\u002Fp>\u003C\u002Fli>\u003C\u002Ful>\u003Chr>\u003Ch4>FC.locations.removeStates()\u003C\u002Fh4>\u003Cp>Removes the specified states from the specified locations arrays for the specified country\u003C\u002Fp>\u003Cp>\u003Cstrong>Parameters:\u003C\u002Fstrong>\u003C\u002Fp>\u003Cul>\u003Cli>\u003Cp>\u003Ccode class=\"badge bg-soft-danger text-danger\">country\u003C\u002Fcode> \u003Cem>&lt;wrap lo&gt;(String)&lt;\u002Fwrap&gt;\u003C\u002Fem> - A string of the 2 character ISO country codes\u003C\u002Fp>\u003C\u002Fli>\u003Cli>\u003Cp>\u003Ccode class=\"badge bg-soft-danger text-danger\">states\u003C\u002Fcode> \u003Cem>&lt;wrap lo&gt;(String or Array)&lt;\u002Fwrap&gt;\u003C\u002Fem> - Either a string or an array of strings of the ISO state codes\u003C\u002Fp>\u003C\u002Fli>\u003Cli>\u003Cp>\u003Ccode class=\"badge bg-soft-danger text-danger\">locationArrayNames\u003C\u002Fcode> \u003Cem>&lt;wrap lo&gt;(String or Array)&lt;\u002Fwrap&gt;\u003C\u002Fem> - \u003Cem>Optional\u003C\u002Fem> - Either a string of either \u003Ccode class=\"badge bg-soft-danger text-danger\">&#039;billing&#039;\u003C\u002Fcode>, \u003Ccode class=\"badge bg-soft-danger text-danger\">&#039;shipping&#039;\u003C\u002Fcode> or \u003Ccode class=\"badge bg-soft-danger text-danger\">&#039;both&#039;\u003C\u002Fcode>, or an array of both like \u003Ccode class=\"badge bg-soft-danger text-danger\">[&#039;billing&#039;, &#039;shipping&#039;]\u003C\u002Fcode>. If not specified, \u003Ccode class=\"badge bg-soft-danger text-danger\">&#039;both&#039;\u003C\u002Fcode> is the automatic default.\u003C\u002Fp>\u003C\u002Fli>\u003C\u002Ful>\u003Cp>\u003Cstrong>Example:\u003C\u002Fstrong>\u003C\u002Fp>\u003Cul>\u003Cli>\u003Cp>\u003Ccode class=\"badge bg-soft-danger text-danger\">FC.locations.removeStates(&#039;US&#039;, &#039;AK&#039;);\u003C\u002Fcode> - Prevents Alaska from being selected as a state when the United States is selected\u003C\u002Fp>\u003C\u002Fli>\u003Cli>\u003Cp>\u003Ccode class=\"badge bg-soft-danger text-danger\">FC.locations.removeStates(&#039;US&#039;, [&#039;AK&#039;, &#039;HI&#039;], &#039;shipping&#039;);\u003C\u002Fcode> - Prevents Alaska and Hawaii from being selected as a state for shipping when the United States is selected as the shipping country\u003C\u002Fp>\u003C\u002Fli>\u003C\u002Ful>\u003Chr>\u003Ch4>FC.locations.limitStatesTo()\u003C\u002Fh4>\u003Cp>Restricts the states for the specified country to only those specified\u003C\u002Fp>\u003Cp>\u003Cstrong>Parameters:\u003C\u002Fstrong>\u003C\u002Fp>\u003Cul>\u003Cli>\u003Cp>\u003Ccode class=\"badge bg-soft-danger text-danger\">country\u003C\u002Fcode> \u003Cem>&lt;wrap lo&gt;(String)&lt;\u002Fwrap&gt;\u003C\u002Fem> - A string of the 2 character ISO country codes\u003C\u002Fp>\u003C\u002Fli>\u003Cli>\u003Cp>\u003Ccode class=\"badge bg-soft-danger text-danger\">states\u003C\u002Fcode> \u003Cem>&lt;wrap lo&gt;(String or Array)&lt;\u002Fwrap&gt;\u003C\u002Fem> - Either a string or an array of strings of the ISO state codes\u003C\u002Fp>\u003C\u002Fli>\u003Cli>\u003Cp>\u003Ccode class=\"badge bg-soft-danger text-danger\">locationArrayNames\u003C\u002Fcode> \u003Cem>&lt;wrap lo&gt;(String or Array)&lt;\u002Fwrap&gt;\u003C\u002Fem> - \u003Cem>Optional\u003C\u002Fem> - Either a string of either \u003Ccode class=\"badge bg-soft-danger text-danger\">&#039;billing&#039;\u003C\u002Fcode>, \u003Ccode class=\"badge bg-soft-danger text-danger\">&#039;shipping&#039;\u003C\u002Fcode> or \u003Ccode class=\"badge bg-soft-danger text-danger\">&#039;both&#039;\u003C\u002Fcode>, or an array of both like \u003Ccode class=\"badge bg-soft-danger text-danger\">[&#039;billing&#039;, &#039;shipping&#039;]\u003C\u002Fcode>. If not specified, \u003Ccode class=\"badge bg-soft-danger text-danger\">&#039;both&#039;\u003C\u002Fcode> is the automatic default.\u003C\u002Fp>\u003C\u002Fli>\u003C\u002Ful>\u003Cp>\u003Cstrong>Example:\u003C\u002Fstrong>\u003C\u002Fp>\u003Cul>\u003Cli>\u003Cp>\u003Ccode class=\"badge bg-soft-danger text-danger\">FC.locations.limitStatesTo(&#039;US&#039;, &#039;CA&#039;);\u003C\u002Fcode> - Allows only California to be selected as a state when the United States is selected\u003C\u002Fp>\u003C\u002Fli>\u003Cli>\u003Cp>\u003Ccode class=\"badge bg-soft-danger text-danger\">FC.locations.limitStatesTo(&#039;AU&#039;, [&#039;SA&#039;, &#039;VIC&#039;, &#039;QLD&#039;], &#039;shipping&#039;);\u003C\u002Fcode> - Allows only South Australia, Victoria and Queensland from being selected for shipping when Australia is selected as the shipping country.\u003C\u002Fp>\u003C\u002Fli>\u003C\u002Ful>\u003Chr>\u003Ch4>FC.locations.reset()\u003C\u002Fh4>\u003Cp>Resets the location restrictions back to the store default, as set in the &quot;configuration&quot; in the Foxy administration. Best used through the javascript events on the cart\u002Fcheckout to trigger the reset based on events, such as removing an item from the cart.\u003C\u002Fp>\u003Cp>\u003Cstrong>Parameters:\u003C\u002Fstrong>\u003C\u002Fp>\u003Cul>\u003Cli>\u003Cp>\u003Ccode class=\"badge bg-soft-danger text-danger\">locationArrayNames\u003C\u002Fcode> \u003Cem>&lt;wrap lo&gt;(String or Array)&lt;\u002Fwrap&gt;\u003C\u002Fem> - \u003Cem>Optional\u003C\u002Fem> - Either a string of either \u003Ccode class=\"badge bg-soft-danger text-danger\">&#039;billing&#039;\u003C\u002Fcode>, \u003Ccode class=\"badge bg-soft-danger text-danger\">&#039;shipping&#039;\u003C\u002Fcode> or \u003Ccode class=\"badge bg-soft-danger text-danger\">&#039;both&#039;\u003C\u002Fcode>, or an array of both like \u003Ccode class=\"badge bg-soft-danger text-danger\">[&#039;billing&#039;, &#039;shipping&#039;]\u003C\u002Fcode>. If not specified, \u003Ccode class=\"badge bg-soft-danger text-danger\">&#039;both&#039;\u003C\u002Fcode> is the automatic default.\u003C\u002Fp>\u003C\u002Fli>\u003C\u002Ful>\u003Cp>\u003Cstrong>Example:\u003C\u002Fstrong>\u003C\u002Fp>\u003Cul>\u003Cli>\u003Cp>\u003Ccode class=\"badge bg-soft-danger text-danger\">FC.locations.reset;\u003C\u002Fcode> - Reset the location restrictions back to default\u003C\u002Fp>\u003C\u002Fli>\u003Cli>\u003Cp>\u003Ccode class=\"badge bg-soft-danger text-danger\">FC.client.on(&#039;cart-item-remove.done&#039;, function() { FC.locations.reset(); });\u003C\u002Fcode> - Reset location restrictions whenever an item is removed from the cart\u003C\u002Fp>\u003C\u002Fli>\u003C\u002Ful>\u003Ch3>Examples\u003C\u002Fh3>\u003Ch4>Example 1\u003C\u002Fh4>\u003Cul>\u003Cli>\u003Cp>Restricting the checkout to only allow shipping to the United States, but allow billing to be from any country\u003C\u002Fp>\u003C\u002Fli>\u003C\u002Ful>\u003Cp>javascript\u003C\u002Fp>\u003Cpre>\u003Ccode>FC.locations.limitCountriesTo(&#039;US&#039;, &#039;shipping&#039;);\u003C\u002Fcode>\u003C\u002Fpre>\u003Ch4>Example 2\u003C\u002Fh4>\u003Cul>\u003Cli>\u003Cp>Only allow customers from the US and Canada, and not from Alaska or Hawaii.\u003C\u002Fp>\u003C\u002Fli>\u003C\u002Ful>\u003Cp>javascript\u003C\u002Fp>\u003Cpre>\u003Ccode>FC.locations.limitCountriesTo([&#039;US&#039;, &#039;CA&#039;]);\nFC.locations.removeStates(&#039;US&#039;, [&#039;AK&#039;, &#039;HI&#039;]);\u003C\u002Fcode>\u003C\u002Fpre>\u003Ch4>Example 3\u003C\u002Fh4>\u003Cul>\u003Cli>\u003Cp>Remove all non-standard US States\u003C\u002Fp>\u003C\u002Fli>\u003C\u002Ful>\u003Cp>javascript\u003C\u002Fp>\u003Cpre>\u003Ccode>FC.locations.removeStates(&#039;US&#039;, [&#039;AF&#039;,&#039;AA&#039;,&#039;AC&#039;,&#039;AE&#039;,&#039;AM&#039;,&#039;AP&#039;,&#039;AS&#039;,&#039;PR&#039;,&#039;VI&#039;,&#039;GU&#039;,&#039;FM&#039;,&#039;MH&#039;,&#039;MP&#039;], &#039;both&#039;);\u003C\u002Fcode>\u003C\u002Fpre>\u003Ch4>Example 4\u003C\u002Fh4>\u003Cul>\u003Cli>\u003Cp>Remove countries that are currently under sanction restrictions from the US Office of Foreign Assets Control (Note that this list may not be up to date)\u003C\u002Fp>\u003C\u002Fli>\u003C\u002Ful>\u003Cp>javascript\u003C\u002Fp>\u003Cpre>\u003Ccode>FC.locations.removeCountries([&#039;CU&#039;,&#039;IR&#039;,&#039;SD&#039;,&#039;KP&#039;]);\u003C\u002Fcode>\u003C\u002Fpre>\u003Ch2>What about making it read-only?\u003C\u002Fh2>\u003Cp>As part of the new autocomplete functionality from version 1.0, any location object that only has one option will automatically become read-only with that location selected by default. If you want to set a field read only, utilise the \u003Ccode class=\"badge bg-soft-danger text-danger\">limitCountriesTo()\u003C\u002Fcode> or \u003Ccode class=\"badge bg-soft-danger text-danger\">limitStatesTo()\u003C\u002Fcode> functions with only a single location specified.\u003C\u002Fp>\u003Ch2>Changelog\u003C\u002Fh2>\u003Cul>\u003Cli>\u003Cp>2014\u002F08\u002F21 - v2.0 - Initial version\u003C\u002Fp>\u003C\u002Fli>\u003Cli>\u003Cp>2019\u002F11\u002F09 - v2.1 - Adding \u003Ccode class=\"badge bg-soft-danger text-danger\">reset()\u003C\u002Fcode> function\u003C\u002Fp>\u003C\u002Fli>\u003Cli>\u003Cp>2020\u002F02\u002F20 - v2.2 - Triggering \u003Ccode class=\"badge bg-soft-danger text-danger\">reset()\u003C\u002Fcode> before the custom logic is run subsequent times on the same page\u003C\u002Fp>\u003C\u002Fli>\u003C\u002Ful>",{"name":1137,"created_at":1138,"published_at":1139,"updated_at":1140,"id":1141,"uuid":47,"content":1142,"slug":48,"full_slug":48,"sort_by_date":59,"position":1320,"tag_list":1321,"is_startpage":24,"parent_id":59,"meta_data":59,"group_id":1322,"first_published_at":1323,"release_id":59,"lang":65,"path":59,"alternates":1324,"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":1143,"_uid":1146,"title":1147,"action":1148,"fields":1149,"method":1296,"columns":1297,"subtitle":1311,"component":48,"button_text":1317,"submit_title":1318,"submit_subtitle":1319},{"_uid":1144,"title":1137,"plugin":1145,"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",[1150,1155,1159,1267,1270,1275,1290],{"_uid":1151,"name":1152,"type":332,"label":1153,"options":13,"required":33,"component":1154,"placeholder":13},"9a70b226-2036-4f90-a052-b3efa61c5896","name","Name","form___field",{"_uid":1156,"name":1157,"type":1157,"label":1158,"options":13,"required":33,"component":1154,"placeholder":13},"86ba35be-ff43-4a28-8633-14052a8f6622","email","Email Address",{"_uid":1160,"name":1161,"type":1162,"label":1163,"options":1164,"required":33,"component":1154,"conditions":1165,"placeholder":13},"3f827475-492c-4f97-aa1e-2386ac263b6c","topic","select","Topic","Presales, Support, Billing, Partnerships, Order Enquiry, Other",[1166,1221,1231,1238,1246,1254,1260],{"_uid":1167,"equals":1168,"fields":1169,"component":1220},"e21d97dd-e68e-4fa6-ba97-bc40f3041dde","Order Enquiry",[1170],{"_uid":1171,"body":1172,"type":1218,"title":13,"component":1219},"b64992bc-6d53-48b8-b7a0-d81e5a062e50",{"type":324,"content":1173},[1174],{"type":327,"content":1175},[1176,1178,1186,1188,1190,1191,1195,1197,1201,1209,1211,1216],{"text":1177,"type":332},"We are ",{"text":1179,"type":332,"marks":1180},"Foxy.io",[1181],{"type":1182,"attrs":1183},"link",{"href":1184,"uuid":59,"anchor":59,"custom":1185,"target":59,"linktype":31},"http:\u002F\u002FFoxy.io",{},{"text":1187,"type":332},", 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":1189},"hard_break",{"type":1189},{"text":1192,"type":332,"marks":1193},"NOTE:",[1194],{"type":343},{"text":1196,"type":332}," We are ",{"text":1198,"type":332,"marks":1199},"not ",[1200],{"type":444},{"text":1202,"type":332,"marks":1203},"Foxy.in",[1204,1208],{"type":1182,"attrs":1205},{"href":1206,"uuid":59,"anchor":59,"custom":1207,"target":59,"linktype":31},"http:\u002F\u002FFoxy.in",{},{"type":444},{"text":1210,"type":332},". We are not in any way affiliated with ",{"text":1202,"type":332,"marks":1212},[1213],{"type":1182,"attrs":1214},{"href":1206,"uuid":59,"anchor":59,"custom":1215,"target":59,"linktype":31},{},{"text":1217,"type":332},", and cannot help in any way with your order from that website.","danger","global___alert","form___condition",{"_uid":1222,"equals":1223,"fields":1224,"component":1220},"8765c3e1-25cf-44aa-b8ea-fc6094acf9c3","Presales",[1225],{"_uid":1226,"name":1227,"type":1228,"label":13,"options":13,"required":24,"component":1154,"conditions":1229,"placeholder":13,"default_value":1230},"cf464f8e-d643-4f6e-af29-d3abffaf7380","department_email_address","hidden",[],"hello@foxy.io",{"_uid":1232,"equals":208,"fields":1233,"component":1220},"4007b6d8-77e5-421d-bd1e-6f336dd853fb",[1234],{"_uid":1235,"name":1227,"type":1228,"label":13,"options":13,"required":24,"component":1154,"conditions":1236,"placeholder":13,"default_value":1237},"7b4c6aa5-a68c-45e0-9ce1-0a36af10c0c2",[],"help@foxy.io",{"_uid":1239,"equals":1240,"fields":1241,"component":1220},"1dbb8f11-613d-43cd-9e09-1b94f6e19219","Billing",[1242],{"_uid":1243,"name":1227,"type":1228,"label":13,"options":13,"required":24,"component":1154,"conditions":1244,"placeholder":13,"default_value":1245},"a0ac0d1b-bc4f-4a6c-a682-581d450b0b73",[],"help+billing@foxy.io",{"_uid":1247,"equals":1248,"fields":1249,"component":1220},"a0a53a50-7172-4a29-ba58-181e38874e12","Partnerships",[1250],{"_uid":1251,"name":1227,"type":1228,"label":13,"options":13,"required":24,"component":1154,"conditions":1252,"placeholder":13,"default_value":1253},"7aa011d9-f374-4aed-b5a5-929b54aaf152",[],"partners@foxy.io",{"_uid":1255,"equals":1168,"fields":1256,"component":1220},"a4cd431f-25d5-41c7-bfdc-02c908c8fb47",[1257],{"_uid":1258,"name":1227,"type":1228,"label":13,"options":13,"required":24,"component":1154,"conditions":1259,"placeholder":13,"default_value":1230},"f5d52168-d6ae-451b-94ee-2ced1cbd28ad",[],{"_uid":1261,"equals":1262,"fields":1263,"component":1220},"25aba1ed-eb41-4bbc-aa89-f7a7167ea86e","Other",[1264],{"_uid":1265,"name":1227,"type":1228,"label":13,"options":13,"required":24,"component":1154,"conditions":1266,"placeholder":13,"default_value":1230},"f40dfaef-c203-4b71-bf4e-e1b43cef192b",[],{"_uid":1268,"component":1269},"e9c53a05-f40a-4510-aaf8-bc072a235a0c","form___subject",{"_uid":1271,"name":1272,"type":1273,"label":1274,"options":13,"required":33,"component":1154,"placeholder":13},"a4c4d385-fff4-4978-99fb-b68cfea623d6","message","textarea","Message",{"_uid":1276,"name":1277,"type":1162,"label":1278,"options":1279,"required":33,"component":1154,"conditions":1280,"placeholder":13},"8a3c9f85-f438-427d-9c7a-d7b295a14b5b","existing_user","Are you an existing user?","No, Yes",[1281],{"_uid":1282,"equals":1283,"fields":1284,"component":1220},"115933d6-262a-4b59-8fa8-579c5ad73de1","Yes",[1285],{"_uid":1286,"name":1287,"type":332,"label":1288,"options":13,"required":33,"component":1154,"conditions":1289,"placeholder":13},"44b6ff23-98f0-4e95-b7f5-c23e06415c2d","subdomain","Store Subdomain",[],{"_uid":1291,"name":1292,"type":1162,"label":1293,"options":1294,"required":33,"component":1154,"conditions":1295,"placeholder":13},"922a5cef-3af2-4113-8855-36c7910e3ee3","user_type","What type of user are you?","Developer, Designer, Merchant",[],"POST",[1298],{"_uid":1299,"text":1300,"title":1309,"component":1310},"7323b90d-a93a-4bf1-baa9-20d0b7ead61b",{"type":324,"content":1301},[1302],{"type":327,"content":1303},[1304,1306,1307],{"text":1305,"type":332},"855.369.9227",{"type":1189},{"text":1308,"type":332},"9:30am-6pm Central M-F","Pre-sales, Sales, & Partnerships","contact___footer_column",{"type":324,"content":1312},[1313],{"type":327,"content":1314},[1315],{"text":1316,"type":332},"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",[],[288,1326,1355],{"name":1327,"created_at":1328,"published_at":1329,"updated_at":1330,"id":1331,"uuid":1332,"content":1333,"slug":1348,"full_slug":1349,"sort_by_date":59,"position":1350,"tag_list":1351,"is_startpage":24,"parent_id":310,"meta_data":59,"group_id":1352,"first_published_at":1353,"release_id":59,"lang":65,"path":59,"alternates":1354,"default_full_slug":59,"translated_slugs":59},"Checkout","2024-11-06T19:56:29.907Z","2026-07-02T22:04:34.438Z","2026-07-02T22:04:34.451Z",14898631,"60b73dc2-7635-487c-bd1f-fd7fba18ab4d",{"_uid":1334,"icon":13,"name":1327,"type":1335,"guides":1336,"pinned":24,"summary":1337,"category":13,"component":297,"blog_posts":1338,"content_hub":24,"icon_custom":1339,"case_studies":1341,"faq_sections":1342,"help_articles":1343,"featured_guides":1344,"mailbox_category":13,"featured_articles":1345,"featured_blog_posts":1346,"featured_case_studies":1347},"0a484217-201f-4f60-a813-d8d8bda736e4","simple",[],"How the checkout works, configuration options, customizations, and advanced integrations.",[],{"id":59,"alt":59,"name":13,"focus":59,"title":59,"source":59,"filename":13,"copyright":59,"fieldtype":81,"meta_data":1340},{},[],[],[],[],[],[],[],"checkout","help\u002Fcategories\u002Fcheckout",0,[],"b3bfcd1f-8386-4ed8-9218-2f4c2989a1b2","2024-11-06T19:56:44.870Z",[],{"name":1356,"created_at":1357,"published_at":1358,"updated_at":1359,"id":1360,"uuid":1106,"content":1361,"slug":1373,"full_slug":1374,"sort_by_date":59,"position":1375,"tag_list":1376,"is_startpage":24,"parent_id":310,"meta_data":59,"group_id":1377,"first_published_at":1358,"release_id":59,"lang":65,"path":59,"alternates":1378,"default_full_slug":59,"translated_slugs":59},"Configure The Checkout","2026-07-01T21:47:18.962Z","2026-07-01T21:49:01.946Z","2026-07-01T21:49:01.970Z",193547628436796,{"_uid":1362,"icon":13,"name":1356,"type":1335,"pinned":24,"summary":1363,"category":1332,"component":297,"blog_posts":1364,"icon_custom":1365,"case_studies":1367,"faq_sections":1368,"featured_guides":1369,"mailbox_category":13,"featured_articles":1370,"featured_blog_posts":1371,"featured_case_studies":1372},"490f188d-cc3f-4d7e-a9f2-7885fd5ac029","Set up and configure checkout behavior, including required fields, guest\u002Faccount settings, and address autocomplete.",[],{"id":59,"alt":59,"name":13,"focus":59,"title":59,"source":59,"filename":13,"copyright":59,"fieldtype":81,"meta_data":1366},{},[],[],[],[],[],[],"configure-the-checkout","help\u002Fcategories\u002Fconfigure-the-checkout",-490,[],"1c00ed16-7940-48bd-9daf-8b28c2c7a207",[],{},1784742856710]