[{"data":1,"prerenderedAt":1436},["ShallowReactive",2],{"header:help":3,"footer:default":67,"story:navigation\u002Fsearch:help":250,"story:help\u002Fcategories":288,"story:help\u002Farticles\u002Fupdate-product-totals-with-multicurrency-support-before-add-to-cart":314,"no-guide:update-product-totals-with-multicurrency-support-before-add-to-cart":59,"article:\u002Fhelp\u002Farticles\u002Fupdate-product-totals-with-multicurrency-support-before-add-to-cart":1190,"story:contact":1221,"help:tree:a35f060c-799a-4ebb-8b95-452152320048":1409,"_apollo:default":1435},{"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":1183,"full_slug":1184,"sort_by_date":59,"position":1185,"tag_list":1186,"is_startpage":24,"parent_id":1187,"meta_data":59,"group_id":1188,"first_published_at":317,"release_id":59,"lang":65,"path":59,"alternates":1189,"default_full_slug":59,"translated_slugs":59},"Update product totals with multicurrency support before add to cart","2026-07-22T17:21:07.911Z","2026-07-22T17:44:56.916Z","2026-07-22T17:44:56.934Z",200913993418882,"a35f060c-799a-4ebb-8b95-452152320048",{"_uid":322,"body":323,"name":315,"image":1178,"pinned":24,"summary":1180,"category":1181,"component":266,"related_articles":1182},"4d41d031-9dbd-40cc-8dba-b3cd86ebd6b9",{"type":324,"content":325},"doc",[326,333,338,343,375,382,400,419,425,430,435,441,446,451,456,461,466,477,482,492,497,514,519,540,551,556,561,572,583,891,910,915,920,937,957,962,967,982,1011,1016,1021,1032,1043,1048,1053,1073,1087,1092,1103,1108,1113,1118,1123,1128,1133,1138],{"type":327,"attrs":328,"content":329},"paragraph",{"textAlign":59},[330],{"text":331,"type":332},"For stores looking to support multiple different currencies, it's important to be able to show product prices in those different currencies. This helps customers to be able to know exactly what they'll be paying - rather than needing to do those calculations themselves.","text",{"type":327,"attrs":334,"content":335},{"textAlign":59},[336],{"text":337,"type":332},"Not all website builders and CMS's support setting multiple prices for a single product though, so you can be limited to just a single currency that you can display your prices in.",{"type":327,"attrs":339,"content":340},{"textAlign":59},[341],{"text":342,"type":332},"The following snippet will allow you to add the following functionality to your website:",{"type":344,"content":345},"bullet_list",[346,354,361,368],{"type":347,"content":348},"list_item",[349],{"type":327,"attrs":350,"content":351},{"textAlign":59},[352],{"text":353,"type":332},"Dynamically set the template set for the cart on initial page load, based on the location of the customer, which will set the locale, language and currency of the cart.",{"type":347,"content":355},[356],{"type":327,"attrs":357,"content":358},{"textAlign":59},[359],{"text":360,"type":332},"Convert the prices and price modifiers in all product add to cart forms to the cart currency",{"type":347,"content":362},[363],{"type":327,"attrs":364,"content":365},{"textAlign":59},[366],{"text":367,"type":332},"Convert all prices displayed to customers to the cart currency",{"type":347,"content":369},[370],{"type":327,"attrs":371,"content":372},{"textAlign":59},[373],{"text":374,"type":332},"Display a dynamic product total, taking into consideration a change in quantity or product options that include a price modifier.",{"type":376,"attrs":377,"content":379},"heading",{"level":378,"textAlign":59},2,[380],{"text":381,"type":332},"Step 1: Include snippet",{"type":327,"attrs":383,"content":384},{"textAlign":59},[385,387,392,394,398],{"text":386,"type":332},"Paste the following code before the closing ",{"text":388,"type":332,"marks":389},"\u003C\u002Fbody>",[390],{"type":391},"code",{"text":393,"type":332}," tag of any page that you want to add this functionality to. It can also be included in an existing javascript file on your page if you prefer. This snippet relies on the ",{"text":395,"type":332,"marks":396},"loader.js",[397],{"type":391},{"text":399,"type":332}," file also being included on your page.",{"type":401,"content":402},"blockquote",[403],{"type":327,"attrs":404,"content":405},{"textAlign":59},[406,411,413,417],{"text":407,"type":332,"marks":408},"Tip:",[409],{"type":410},"bold",{"text":412,"type":332}," This is ",{"text":414,"type":332,"marks":415},"not",[416],{"type":410},{"text":418,"type":332}," required on the cart, checkout or receipt pages, so it should not be placed in those templates or in your store's admin settings. Just on your own website.",{"type":420,"attrs":421,"content":422},"code_block",{"class":59},[423],{"text":424,"type":332},"\u003Cscript>\n\u002F* Foxy Dynamic Product Prices and Currency Conversion v0.8, https:\u002F\u002Ffoxy.io *\u002F\n!function(t,e){var n=function(t){return new i(t)};n.version=\"0.1.3\";var a=t.fxSetup||{rates:{},base:\"\"};n.rates=a.rates,n.base=a.base,n.settings={from:a.from||n.base,to:a.to||n.base};var r=n.convert=function(t,e){if(\"object\"==typeof t&&t.length){for(var a=0;a\u003Ct.length;a++)t[a]=r(t[a],e);return t}(e=e||{}).from||(e.from=n.settings.from),e.to||(e.to=n.settings.to);a=e.to;var i=e.from,s=n.rates;if(s[n.base]=1,!s[a]||!s[i])throw\"fx error\";return t*(a=i===n.base?s[a]:a===n.base?1\u002Fs[i]:s[a]*(1\u002Fs[i]))},i=function(t){\"string\"==typeof t?(this._v=parseFloat(t.replace(\u002F[^0-9-.]\u002Fg,\"\")),this._fx=t.replace(\u002F([^A-Za-z])\u002Fg,\"\")):this._v=t};(a=n.prototype=i.prototype).convert=function(){var t=Array.prototype.slice.call(arguments);return t.unshift(this._v),r.apply(n,t)},a.from=function(t){return(t=n(r(this._v,{from:t,to:n.base})))._fx=n.base,t},a.to=function(t){return r(this._v,{from:this._fx?this._fx:n.settings.from,to:t})},\"undefined\"!=typeof exports?(\"undefined\"!=typeof module&&module.exports&&(exports=module.exports=n),exports.fx=fx):\"function\"==typeof define&&define.amd?define([],(function(){return n})):(n.noConflict=function(e){return function(){return t.fx=e,n.noConflict=undefined,n}}(t.fx),t.fx=n)}(this),function(t){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=t():\"function\"==typeof define&&define.amd?define([],t):(\"undefined\"!=typeof window?window:\"undefined\"!=typeof global?global:\"undefined\"!=typeof self?self:this).numberCurrencyFormat=t()}((function(){return function t(e,n,a){function r(s,o){if(!n[s]){if(!e[s]){var c=\"function\"==typeof require&&require;if(!o&&c)return c(s,!0);if(i)return i(s,!0);var u=new Error(\"Cannot find module '\"+s+\"'\");throw u.code=\"MODULE_NOT_FOUND\",u}var f=n[s]={exports:{}};e[s][0].call(f.exports,(function(t){return r(e[s][1][t]||t)}),f,f.exports,t,e,n,a)}return n[s].exports}for(var i=\"function\"==typeof require&&require,s=0;s\u003Ca.length;s++)r(a[s]);return r}({1:[function(t,e,n){\"use strict\";const a=\"LEFT\",r=\"ALWAYS\",i=\"NEVER\",s=\"IF_NEEDED\",o=\"AS_IS\",c={currency:\"\",showDecimals:r,thousandSeparator:\",\",decimalSeparator:\".\",currencyPosition:\"RIGHT\",decimalsDigits:2,spacing:!0,arithmeticalRounding:!1};function u(t,e){return void 0!==t?t:e}function f(t){return t?{currency:t.currency||c.currency,thousandSeparator:u(t.thousandSeparator,c.thousandSeparator),decimalSeparator:u(t.decimalSeparator,c.decimalSeparator),showDecimals:t.showDecimals||c.showDecimals,decimalsDigits:u(t.decimalsDigits,c.decimalsDigits),currencyPosition:t.currencyPosition||c.currencyPosition,spacing:u(t.spacing,c.spacing),arithmeticalRounding:u(t.arithmeticalRounding,c.arithmeticalRounding)}:c}function l(t){return\u002F^[\\.,]$\u002F.test(t)}e.exports={format:function(t,e){const n=f(e),c=n.showDecimals===o?t.toString():parseFloat((n.arithmeticalRounding?function(t,e){return+(Math.round(t+\"e+\"+e)+\"e-\"+e)}(t,n.decimalsDigits):+t).toString()).toFixed(n.showDecimals===i?0:n.decimalsDigits);if(isNaN(c))return t;const u=c.split(\".\"),l=u[0],d=u[1]||\"\",p=n.showDecimals===r||n.showDecimals===s&&+d>0||n.showDecimals===o&&d.length>0?n.decimalSeparator+d:\"\",h=(m=l,g=n.thousandSeparator,m.split(\"\").reduce((function(t,e,n){return t+e+(n\u003Cm.length-1&&(m.length-n-1)%3==0&&\"-\"!==e?g:\"\")}),\"\")+p);var m,g;if(n.currency){const t=n.spacing?\" \":\"\";return n.currencyPosition===a?n.currency+t+h:h+t+n.currency}return h},unformat:function(t,e){const n=f(e),a=e&&e.decimalSeparator,r=t.replace(\u002F\\s\u002Fg,\"\").match(\u002F[0-9]+|[^0-9]+\u002Fgi).map((function(t,e){return{value:t,isNumber:\u002F[0-9]+\u002F.test(t),index:e}})),i=r.filter((function(t){return t.isNumber})),s=r.filter((function(t){return!t.isNumber})),o=i[0],c=i[i.length-1],u=o.value>0?o:i.length>1&&i[1].value>0?i[1]:void 0;if(!u)return 0;const d=u.index>0?r[u.index-1]:void 0,p=d&&1===s.length&&l(d.value),h=c.index-1,m=h>=0&&r[h],g=s.filter((function(t){return t.index>o.index&&t.index\u003Ch})).map((function(t){return t.value})),_=g.length>0&&g.indexOf(m.value)\u003C0,y=m&&m.value===a,v=c.value.length===n.decimalsDigits&&m&&l(m.value),x=(a?y:v||y||p||_)?c.value.length:0,b=d&&d.value,j=b&&\"-\"===b[b.length-1],w=i.map((function(t){return t.value})).join(\"\");return parseFloat(w\u002FMath.pow(10,x))*(j?-1:1)}}},{}]},{},[1])(1)}));var FC=FC||{};!function(t,e){var n={version:.8},r=\u002F([{\\|])p([+\\-:])([\\d\\.]+)(?:\\D{3})?([\\|}])\u002F,i=\u002F^(\\d+):\u002F,s=!1,o={base:\"USD\",sets:[],max_rate_cache:12,rounding:\"minimal\",convert_display_only:!1,active_class:\"active\",use_openexchangerates:!1,adjust_price_display:null};function c(){for(var t=e.json.shipping_address.country,n=\"\"==e.json.template_set?\"DEFAULT\":e.json.template_set,a=\"DEFAULT\",r=0;r\u003Csettings.sets.length;r++)settings.sets[r].hasOwnProperty(\"countries\")&&settings.sets[r].countries.indexOf(t)>-1&&(a=settings.sets[r].template_set);F()||(O(),a==n)?(m(),u()):h(a)}function u(n){var a=settings.sets.map((function(t,e){return t.currency})).filter((function(t,e,n){return n.indexOf(t)===e})),r=(n=void 0!==n&&n,F());r.hasOwnProperty(\"rates\")&&(Date.now()-r.rates.timestamp)\u002F60\u003C36e4*parseFloat(settings.max_rate_cache)&&(n||r.fcsid==e.json.session_id)?(fx.rates=r.rates.rates,fx.base=r.rates.base,d()):n||(settings.use_openexchangerates?t.getJSON(\"https:\u002F\u002Fopenexchangerates.org\u002Fapi\u002Flatest.json?app_id=\"+settings.use_openexchangerates+\"&prettyprint=false&symbols=\"+a.join(\",\"),(function(t){l(t.rates,t.base),d()})):t.getJSON(\"https:\u002F\u002Fwww.floatrates.com\u002Fdaily\u002F\"+settings.base+\".json\",(function(t){for(var e={},n=0;n\u003Ca.length;n++)(t.hasOwnProperty(a[n].toLowerCase())||a[n]==settings.base)&&(e[a[n]]=a[n]==settings.base?1:t[a[n].toLowerCase()].rate);l(e,settings.base),d()})))}function l(t,e){fx.rates=t,fx.base=e,O({rates:t,base:e,timestamp:Date.now()})}function d(){var n=F();if(!n)return console.log(\"FC.currency: Unable to find locale information\"),!1;var a=D(),i=e.json.item_count>0?e.json.locale_info.int_curr_symbol.trim():n.locale.int_curr_symbol.trim(),s=e.json.item_count>0?e.json.locale_info.mon_decimal_point:n.locale.mon_decimal_point;t(\".fc-currency-price\").each((function(){var a,r=settings.base;t(this).data(\"fc-currency\")&&(r=t(this).data(\"fc-currency\"),a=s);var o=S(t(this).html(),a),c=o;r!=i&&(c=g(c=fx.convert(o,{from:r,to:i}))),t(this).html(e.util.money_format(n.currency_format,_(c)).trim()).data(\"fc-currency\",i).show()})),t('form[action*=\"'+a+'\"]').each((function(){var e=t(this).find('[name=\"price\"], [name$=\":price\"]');if(0==e.length)return!1;var n=settings.base;if(t(this).data(\"fc-currency\"))n=t(this).data(\"fc-currency\");else{var a=\u002F([\\d\\.]+)([A-Z]{3})$\u002Fi,s=e.first().val().replace(\" \",\"\");s.match(a);a.test(s)&&(n=a.exec(s)[2].toUpperCase())}n!=i&&(t(this).find(\"[value*='{p'], [value*='|p']\").each((function(){var t=this.value.match(r);if(t){var e=fx.convert(parseFloat(t[3]),{from:n,to:i});e=g(e),settings.convert_display_only||(this.value=this.value.replace(r,\"$1p$2\"+e.toFixed(2)+i.toLowerCase()+\"$4\"))}})),e.each((function(){var t=S(this.value),e=fx.convert(t,{from:n,to:i});e=g(e),settings.convert_display_only||(this.value=e.toFixed(2)+i.toLowerCase())})),t(this).data(\"fc-currency\",i)),y()}))}function h(t){e.client.request(\"https:\u002F\u002F\"+e.json.config.store_domain+\"\u002Fcart?template_set=\"+t).done((function(){O(),c()}))}function m(){for(var n=F(),a=!1,r=e.json.item_count>0?\"\"==e.json.template_set?\"DEFAULT\":e.json.template_set:n.template_set,i=0;i\u003Csettings.sets.length;i++)settings.sets[i].template_set==r&&(a=r);a&&(t(\"[data-fc-template-set].\"+settings.active_class).removeClass(settings.active_class),t('[data-fc-template-set=\"'+a+'\"]').addClass(settings.active_class))}function g(t){var e=[\"full\",\"half\",\"minimal\",\"none\",!1].indexOf(settings.rounding)>-1?settings.rounding:o.rounding;if(\"full\"==e)return Math.ceil(t);if(\"half\"==e){var n=t%1;return Math.floor(t)+(0==n?0:n\u003C=.5?.5:1)}return\"minimal\"==e?Math.ceil(20*t)\u002F20:t}function _(t){return\"function\"==typeof settings.adjust_price_display&&(adjusted_price=settings.adjust_price_display(t),void 0!==adjusted_price)?parseFloat(adjusted_price):t}function y(){ADJUST={},t(\"input,select\").off(\"change.foxy-dynamic-price\"),t('form[action*=\"'+D()+'\"]').each((function(){var e=t(this),n=\"\",a={products:{}};t(this).find(\"[name='name'],[name^='name||'],[name$=':name'],[name*=':name||']\").each((function(){var t=b(this.name),r=t?t+\":\":\"\",i=S(e.find(\"[name='\"+r+\"price'],[name^='\"+r+\"price||']\").first().val()),s={id:t,code:\"\",base_price:i||0,quantity:1,attributes:{},has_quantity:!1},o=e.find(\"[name='\"+r+\"quantity'],[name^='\"+r+\"quantity||']\"),c=e.find(\"[name='\"+r+\"code'],[name^='\"+r+\"code||']\");if(c.length>0&&(s.code=v(c.first().val()),\"\"===n&&(n=s.code)),o.length>0){var u=0,f=j(o);[\"select\",\"text\",\"hidden\"].indexOf(f)>-1?(s.has_quantity=!0,u=parseFloat(v(o.val()))):[\"radio\",\"checkbox\"].indexOf(f)>-1&&(s.has_quantity=!0,1==o.filter(\":checked\").length&&(u=parseFloat(v(o.filter(\":checked\").val())))),isNaN(u)&&(u=0),s.quantity=u}a.products[t]=s}));e.attr(\"data-fc-form-code\")&&(n=e.attr(\"data-fc-form-code\")),\"\"!==n&&(t(this).find(\"input,select\").each((function(){var e=b(this.name),i=function(t){return x(t)[2]}(this.name),s=j(t(this));if(\"quantity\"!=i)if(\"price\"!=i||\"hidden\"==s){if(\"SELECT\"==this.tagName){var o=!1;t(this).children(\"option\").each((function(){this.value.search(r)>-1&&(o=!0)})),o&&(t(this).data(\"fc-adjust-for\",n),a.products[e].attributes[v(this.name)]=v(this.value),t(this).on(\"change.foxy-dynamic-price\",(function(){ADJUST[t(this).data(\"fc-adjust-for\")].products[e].attributes[v(this.name)]=v(this.value),w()})))}else if(this.value.search(r)>-1)switch(t(this).data(\"fc-adjust-for\",n),t(this).attr(\"type\")){case\"checkbox\":t(this).is(\":checked\")?a.products[e].attributes[v(this.name)]=v(this.value):a.products[e].attributes[v(this.name)]=\"\",t(this).on(\"change.foxy-dynamic-price\",(function(){t(this).is(\":checked\")?ADJUST[t(this).data(\"fc-adjust-for\")].products[e].attributes[v(this.name)]=v(this.value):ADJUST[t(this).data(\"fc-adjust-for\")].products[e].attributes[v(this.name)]=\"\",w()}));break;case\"radio\":a.products[e].attributes.hasOwnProperty(v(this.name))||(a.products[e].attributes[v(this.name)]=\"\"),t(this).is(\":checked\")&&(a.products[e].attributes[v(this.name)]=v(this.value)),t(\"[name='\"+this.name+\"']\").data(\"fc-adjust-for\",n).on(\"change.foxy-dynamic-price\",(function(){ADJUST[t(this).data(\"fc-adjust-for\")].products[e].attributes[v(this.name)]=v(this.value),w()}))}}else t(this).data(\"fc-adjust-for\",n).on(\"change.foxy-dynamic-price\",(function(){var n=0;([\"select\",\"text\"].indexOf(s)>-1||[\"radio\",\"checkbox\"].indexOf(s)>-1&&t(this).is(\":checked\"))&&(n=parseFloat(v(this.value))),isNaN(n)&&(n=0),ADJUST[t(this).data(\"fc-adjust-for\")].products[e].base_price=n,w()}));else t(this).data(\"fc-adjust-for\",n).on(\"change.foxy-dynamic-price\",(function(){var n=0;([\"select\",\"text\"].indexOf(s)>-1||[\"radio\",\"checkbox\"].indexOf(s)>-1&&t(this).is(\":checked\"))&&(n=parseFloat(v(this.value))),isNaN(n)&&(n=0),ADJUST[t(this).data(\"fc-adjust-for\")].products[e].quantity=n,w()}))})),ADJUST[n]=a)})),n._ADJUST=ADJUST,w()}function v(t){return t.replace(\u002F\\|\\|[\\d\\w]+(?:\\|\\|open)?$\u002F,\"\")}function x(t){return(t=v(t)).match(\u002F(?:(\\d+):)?(.*)\u002F)}function b(t){var e=x(t);return i.test(this.name)&&(prefix=parseInt(this.name.match(i)[0])),void 0===e[1]?0:parseInt(e[1])}function j(t){if(\"SELECT\"==t[0].tagName)return\"select\";if(\"INPUT\"==t[0].tagName)switch(t.attr(\"type\").toLowerCase()){case\"text\":case\"number\":case\"tel\":return\"text\";default:return t.attr(\"type\").toLowerCase()}}function w(){for(f in ADJUST){var n=0,i=0;for(p in ADJUST[f].products){var s=ADJUST[f].products[p].base_price,o=0;for(a in ADJUST[f].products[p].attributes){var c=ADJUST[f].products[p].attributes[a].match(r);if(c)switch(c[2]){case\":\":s=parseFloat(c[3]);break;case\"+\":o+=parseFloat(c[3]);break;case\"-\":o-=parseFloat(c[3])}}s+=o,n+=s*=ADJUST[f].products[p].quantity,i+=ADJUST[f].products[p].quantity}\"function\"==typeof fcFormatPrice&&(n=fcFormatPrice(n,f)),\"function\"==typeof fcFormatQuantity&&(i=fcFormatQuantity(i,f));var u=F(),l=e.util.money_format(u.currency_format,_(n)).trim();t(\".\"+f+\"_total, .\"+f+\"-total\").html(l),t(\".\"+f+\"_total_quantity, .\"+f+\"-total-quantity\").html(i)}}function D(){var t=F();return e.json.hasOwnProperty(\"config\")?e.json.config.store_domain:t?t.store_domain:\".foxycart.com\"}function S(t,e){try{var n={};return e&&(n.decimalSeparator=e),numberCurrencyFormat.unformat(t,n)}catch(t){return!1}}function O(t){var n=F(),a=Object.assign({},n);n&&\"\"==e.json.template_set&&void 0!==t||Object.assign(a,{fcsid:e.json.session_id,store_domain:e.json.config.store_domain,template_set:\"\"==e.json.template_set?\"DEFAULT\":e.json.template_set,locale:e.json.locale_info,currency_format:e.json.config.currency_format}),\"object\"==typeof t&&Object.assign(a,{rates:t}),localStorage.setItem(\"fc_currency_config\",JSON.stringify(a))}function F(){var t=JSON.parse(localStorage.getItem(\"fc_currency_config\"));return!(null===t||e.hasOwnProperty(\"json\")&&e.json.hasOwnProperty(\"session_id\")&&t.fcsid!==e.json.session_id)&&t}e.hasOwnProperty(\"util\")||(e.util={},e.util.money_format=function(t,n){if(\"number\"!=typeof n)return null;var a=e.json.locale_info;return t.replace(\u002F%((=.|[+^(!-])*?)(\\d*?)(#(\\d+))?(\\.(\\d+))?([in%])\u002Fg,(function(t,r,i,s,o,c,u,f,l){if(t=u=\"\",\"%\"===l)return\"%\";u=r&&\u002F=.\u002F.test(r)?r.match(\u002F=(.)\u002F)[1]:\" \",o=!r||-1===r.indexOf(\"!\"),s=parseInt(s,10)||0,(i=0>n)&&(n=-n),f=\"\"===f||void 0===f?\"i\"===l?a.int_frac_digits:a.frac_digits:parseInt(f,10);var d=(n=(n=e.util.round(n,f)).toFixed(f)).indexOf(\".\");f=-1!==d?n.slice(0,d):n,d=-1!==d?n.slice(d+1):\"\";var p=function(t,e,n){return(t=t.split(\"\")).splice(e,0,n),t.join(\"\")},h=f.length,m=h\u003C(c=parseInt(c,10));if(m){var g=c-h;f=Array(g+1).join(u)+f}if(-1===r.indexOf(\"^\")){if(c=a.mon_thousands_sep,(h=a.mon_grouping)[0]\u003Cf.length)for(var _=0,y=f.length;_\u003Ch.length&&!(0>=(y-=h[_]));_++)m&&y\u003Cg&&(c=u),f=p(f,y,c);if(0\u003Ch[_-1])for(;y>h[_-1];)y-=h[_-1],m&&y\u003Cg&&(c=u),f=p(f,y,c)}if(u=d?f+a.mon_decimal_point+d:f,g=\"\",o&&(g=\"i\"===l?a.int_curr_symbol:a.currency_symbol),l=i?a.n_sign_posn:a.p_sign_posn,_=i?a.n_sep_by_space:a.p_sep_by_space,y=i?a.n_cs_precedes:a.p_cs_precedes,-1!==r.indexOf(\"(\"))t=(y?g+(1===_?\" \":\"\"):\"\")+u+(y?\"\":(1===_?\" \":\"\")+g),t=i?\"(\"+t+\")\":\" \"+t+\" \";else switch(c=a.positive_sign,o=a.negative_sign,f=i?o:c,d=\"\",l&&(d=Array((i?c:o).length-f.length+1).join(\" \")),l){case 0:t=\"(\"+(y?g+(1===_?\" \":\"\")+u:u+(1===_?\" \":\"\")+g)+\")\";break;case 1:t=d+f+(2===_?\" \":\"\")+(y?g+(1===_?\" \":\"\")+u:u+(1===_?\" \":\"\")+g);break;case 2:t=(y?g+(1===_?\" \":\"\")+u:u+(1===_?\" \":\"\")+g)+(2===_?\" \":\"\")+f+d;break;case 3:t=y?d+f+(2===_?\" \":\"\")+g+(1===_?\" \":\"\")+u:u+(1===_?\" \":\"\")+f+d+(2===_?\" \":\"\")+g;break;case 4:t=y?g+(2===_?\" \":\"\")+d+f+(1===_?\" \":\"\")+u:u+(1===_?\" \":\"\")+g+(2===_?\" \":\"\")+f+d}return 0\u003C(s-=t.length)&&(s=Array(s+1).join(\" \"),t=-1!==r.indexOf(\"-\")?t+s:s+t),t}))},e.util.round=function(t,e){var n=Math.pow(10,e);return 5\u003C=10*t*n%10&&(t+=1\u002F(10*n)),Math.round(t*n)\u002Fn}),n.update=function(){settings=e.hasOwnProperty(\"currency_config\")?Object.assign({},o,e.currency_config):Object.assign({},o),s=e.hasOwnProperty(\"session\")&&!0===e.session.initialized;var t=F();!t||e.hasOwnProperty(\"json\")&&0!=e.json.item_count||(e.hasOwnProperty(\"json\")||(e.json={}),e.json.currency_format=t.currency_format,e.json.locale_info=t.locale,e.json.item_count=0),(t&&!s||s)&&(settings.sets.length>1?s?c():(m(),u(!0)):(t||O(),y()))};var A=\"function\"==typeof e.onLoad?e.onLoad:function(){};e.onLoad=function(){e.client.on(\"ready.done\",n.update),A()},t((function(){n.update(),t(\"body\").on(\"click\",\"[data-fc-template-set]\",(function(e){var n=function(t){for(var e=!1,n=0;n\u003Csettings.sets.length;n++)settings.sets[n].template_set==t&&(e=settings.sets[n]);return e}(t(this).attr(\"data-fc-template-set\"));n&&(e.preventDefault(),s&&h(n.template_set))}))})),e.currency=n}(jQuery,FC);\n\u003C\u002Fscript>",{"type":376,"attrs":426,"content":427},{"level":378,"textAlign":59},[428],{"text":429,"type":332},"Step 2: Set up forms",{"type":327,"attrs":431,"content":432},{"textAlign":59},[433],{"text":434,"type":332},"For the dynamic product total calculation to work, you need to set up your product add to cart forms as follows:",{"type":376,"attrs":436,"content":438},{"level":437,"textAlign":59},3,[439],{"text":440,"type":332},"Product Code",{"type":327,"attrs":442,"content":443},{"textAlign":59},[444],{"text":445,"type":332},"Every Foxy based product that you want to dynamically calculate the total for needs to have a unique product code set like this:",{"type":420,"attrs":447,"content":448},{"class":59},[449],{"text":450,"type":332},"\u003Cinput type=\"hidden\" name=\"code\" value=\"mycode\" \u002F>",{"type":327,"attrs":452,"content":453},{"textAlign":59},[454],{"text":455,"type":332},"If you have multiple products within a single form, the code from the first product in your form will be used as the code for the form. If you're not able to know what product code is first, or you just want to set a specific code to use for the price modifier without relying on the product's code, you can also add a data attribute to your form like this:",{"type":420,"attrs":457,"content":458},{"class":59},[459],{"text":460,"type":332},"\u003Cform ... data-fc-form-code=\"mycode\">",{"type":376,"attrs":462,"content":463},{"level":437,"textAlign":59},[464],{"text":465,"type":332},"Total Price Element",{"type":327,"attrs":467,"content":468},{"textAlign":59},[469,471,475],{"text":470,"type":332},"Next, set an element for where the total product cost is shown and updated, by combining the code from above and ",{"text":472,"type":332,"marks":473},"-total",[474],{"type":391},{"text":476,"type":332}," as its class, like this:",{"type":420,"attrs":478,"content":479},{"class":59},[480],{"text":481,"type":332},"\u003Ch4 class=\"mycode-total\">$20.00\u003C\u002Fh4>",{"type":327,"attrs":483,"content":484},{"textAlign":59},[485,487,491],{"text":486,"type":332},"If you'd like to show the total quantity, you can also do that using an element with a class that is a combination of the code and ",{"text":488,"type":332,"marks":489},"-total-quantity",[490],{"type":391},{"text":476,"type":332},{"type":420,"attrs":493,"content":494},{"class":59},[495],{"text":496,"type":332},"\u003Cp class=\"mycode-total-quantity\">0\u003C\u002Fp>",{"type":327,"attrs":498,"content":499},{"textAlign":59},[500,502,506,508,512],{"text":501,"type":332},"You can also use classes with underscores instead if needed, such as ",{"text":503,"type":332,"marks":504},"mycode_total",[505],{"type":391},{"text":507,"type":332}," and ",{"text":509,"type":332,"marks":510},"mycode_total_quantity",[511],{"type":391},{"text":513,"type":332},".",{"type":376,"attrs":515,"content":516},{"level":437,"textAlign":59},[517],{"text":518,"type":332},"Product Price Element",{"type":327,"attrs":520,"content":521},{"textAlign":59},[522,524,528,529,533,535,538],{"text":523,"type":332},"As with a normal Foxy product form, the ",{"text":525,"type":332,"marks":526},"name",[527],{"type":391},{"text":507,"type":332},{"text":530,"type":332,"marks":531},"price",[532],{"type":391},{"text":534,"type":332}," inputs are required. The snippet will use the ",{"text":530,"type":332,"marks":536},[537],{"type":391},{"text":539,"type":332}," inputs in the form to determine the base prices for the products present.",{"type":327,"attrs":541,"content":542},{"textAlign":59},[543,545,549],{"text":544,"type":332},"If you wanted to specify a different currency for that product than your store's default currency as the starting base price, you can append the currency code to the price (like ",{"text":546,"type":332,"marks":547},"29.95eur",[548],{"type":391},{"text":550,"type":332}," for €29,95). It will use that currency as the base currency for all products within that form, so ensure that if you take this approach, all prices (including product option modifiers) are in that currency.",{"type":376,"attrs":552,"content":553},{"level":378,"textAlign":59},[554],{"text":555,"type":332},"Step 3: Configuration for currency conversion",{"type":327,"attrs":557,"content":558},{"textAlign":59},[559],{"text":560,"type":332},"By default, the snippet will just handle calculating the dynamic product price. It can also support dynamically converting your product prices to different currencies, as well as automatically assigning a currency based on the location of a customer.",{"type":401,"content":562},[563],{"type":327,"attrs":564,"content":565},{"textAlign":59},[566,570],{"text":567,"type":332,"marks":568},"Note:",[569],{"type":410},{"text":571,"type":332}," The dynamic currency conversion feature relies on your store having multiple template sets configured. If you haven't set up multiple template sets on your Foxy store yet, you can see information on creating those here.",{"type":327,"attrs":573,"content":574},{"textAlign":59},[575,577,581],{"text":576,"type":332},"If you'd like to also enable multiple currencies for your product prices, the snippet includes a number of options for configuring this functionality. The configuration is applied with javascript through an object variable of ",{"text":578,"type":332,"marks":579},"FC.currency_config",[580],{"type":391},{"text":582,"type":332},". These are the different configuration options available:",{"type":344,"content":584},[585,608,651,674,703,729,749,820,844,871],{"type":347,"content":586},[587],{"type":327,"attrs":588,"content":589},{"textAlign":59},[590,594,596,600,602,606],{"text":591,"type":332,"marks":592},"base",[593],{"type":391},{"text":595,"type":332}," ",{"text":597,"type":332,"marks":598},"Accepts:",[599],{"type":410},{"text":601,"type":332}," String, 3 character currency code ",{"text":603,"type":332,"marks":604},"Description:",[605],{"type":410},{"text":607,"type":332}," Set to the currency that your product prices are in by default. Required for dynamic currency conversion.",{"type":347,"content":609},[610],{"type":327,"attrs":611,"content":612},{"textAlign":59},[613,617,618,621,623,626,628,632,634,638,640,644,645,649],{"text":614,"type":332,"marks":615},"sets",[616],{"type":391},{"text":595,"type":332},{"text":597,"type":332,"marks":619},[620],{"type":410},{"text":622,"type":332}," Array of different currencies available for your store ",{"text":603,"type":332,"marks":624},[625],{"type":410},{"text":627,"type":332}," This array will contain the details for each template set configured on ",{"text":629,"type":332,"marks":630},"Settings > Templates",[631],{"type":410},{"text":633,"type":332}," that you want to use on your store. Each object in the array includes three variables, ",{"text":635,"type":332,"marks":636},"currency",[637],{"type":391},{"text":639,"type":332},", ",{"text":641,"type":332,"marks":642},"template_set",[643],{"type":391},{"text":507,"type":332},{"text":646,"type":332,"marks":647},"countries",[648],{"type":391},{"text":650,"type":332},". Required when using dynamic currency conversion.",{"type":347,"content":652},[653],{"type":327,"attrs":654,"content":655},{"textAlign":59},[656,660,661,664,665,668,670,673],{"text":657,"type":332,"marks":658},"sets.currency",[659],{"type":391},{"text":595,"type":332},{"text":597,"type":332,"marks":662},[663],{"type":410},{"text":601,"type":332},{"text":603,"type":332,"marks":666},[667],{"type":410},{"text":669,"type":332}," Set to the currency that this particular template set uses. Required when including ",{"text":614,"type":332,"marks":671},[672],{"type":391},{"text":513,"type":332},{"type":347,"content":675},[676],{"type":327,"attrs":677,"content":678},{"textAlign":59},[679,683,684,687,689,692,694,697,699,702],{"text":680,"type":332,"marks":681},"sets.template_set",[682],{"type":391},{"text":595,"type":332},{"text":597,"type":332,"marks":685},[686],{"type":410},{"text":688,"type":332}," String, Template set code ",{"text":603,"type":332,"marks":690},[691],{"type":410},{"text":693,"type":332}," Set to the code of the template set, as set on ",{"text":629,"type":332,"marks":695},[696],{"type":410},{"text":698,"type":332},". Required when including ",{"text":614,"type":332,"marks":700},[701],{"type":391},{"text":513,"type":332},{"type":347,"content":704},[705],{"type":327,"attrs":706,"content":707},{"textAlign":59},[708,712,713,716,718,721,723,727],{"text":709,"type":332,"marks":710},"sets.countries",[711],{"type":391},{"text":595,"type":332},{"text":597,"type":332,"marks":714},[715],{"type":410},{"text":717,"type":332}," Array of 2 character country codes ",{"text":603,"type":332,"marks":719},[720],{"type":410},{"text":722,"type":332}," A list of countries that will automatically be set to this template set on initial page load. If a customer visits that doesn't match any country in a set, then it will switch to the ",{"text":724,"type":332,"marks":725},"DEFAULT",[726],{"type":391},{"text":728,"type":332}," template set. If not set, this template set will not be set automatically, but could be selected manually.",{"type":347,"content":730},[731],{"type":327,"attrs":732,"content":733},{"textAlign":59},[734,738,739,742,744,747],{"text":735,"type":332,"marks":736},"max_rate_cache",[737],{"type":391},{"text":595,"type":332},{"text":597,"type":332,"marks":740},[741],{"type":410},{"text":743,"type":332}," Number ",{"text":603,"type":332,"marks":745},[746],{"type":410},{"text":748,"type":332}," The number of hours that the rates should be cached before being refreshed. Defaults to 12 hours.",{"type":347,"content":750},[751],{"type":327,"attrs":752,"content":753},{"textAlign":59},[754,758,759,762,763,767,768,772,773,777,778,782,783,786,788,791,793,796,798,802,803,806,807,811,812,815,817],{"text":755,"type":332,"marks":756},"rounding",[757],{"type":391},{"text":595,"type":332},{"text":597,"type":332,"marks":760},[761],{"type":410},{"text":595,"type":332},{"text":764,"type":332,"marks":765},"full",[766],{"type":391},{"text":639,"type":332},{"text":769,"type":332,"marks":770},"half",[771],{"type":391},{"text":639,"type":332},{"text":774,"type":332,"marks":775},"minimal",[776],{"type":391},{"text":639,"type":332},{"text":779,"type":332,"marks":780},"none",[781],{"type":391},{"text":595,"type":332},{"text":603,"type":332,"marks":784},[785],{"type":410},{"text":787,"type":332}," Configure how the prices should be rounded when being converted. ",{"text":764,"type":332,"marks":789},[790],{"type":391},{"text":792,"type":332}," will round up to the nearest whole number, ",{"text":769,"type":332,"marks":794},[795],{"type":391},{"text":797,"type":332}," will round up to the nearest ",{"text":799,"type":332,"marks":800},".50",[801],{"type":391},{"text":639,"type":332},{"text":774,"type":332,"marks":804},[805],{"type":391},{"text":797,"type":332},{"text":808,"type":332,"marks":809},"0.05",[810],{"type":391},{"text":507,"type":332},{"text":779,"type":332,"marks":813},[814],{"type":391},{"text":816,"type":332}," will not round at all. Default is ",{"text":774,"type":332,"marks":818},[819],{"type":391},{"type":347,"content":821},[822],{"type":327,"attrs":823,"content":824},{"textAlign":59},[825,829,830,833,835,838,840],{"text":826,"type":332,"marks":827},"active_class",[828],{"type":391},{"text":595,"type":332},{"text":597,"type":332,"marks":831},[832],{"type":410},{"text":834,"type":332}," String ",{"text":603,"type":332,"marks":836},[837],{"type":410},{"text":839,"type":332}," Customise what class is added to the template set selectors for the current active template set. Default is ",{"text":841,"type":332,"marks":842},"active",[843],{"type":391},{"type":347,"content":845},[846],{"type":327,"attrs":847,"content":848},{"textAlign":59},[849,853,854,857,858,861,863,869],{"text":850,"type":332,"marks":851},"use_openexchangerates",[852],{"type":391},{"text":595,"type":332},{"text":597,"type":332,"marks":855},[856],{"type":410},{"text":834,"type":332},{"text":603,"type":332,"marks":859},[860],{"type":410},{"text":862,"type":332}," Set to the API key for your OpenExchangeRates account if you would prefer to use it instead of the default ",{"text":864,"type":332,"marks":865},"https:\u002F\u002Ffloatrates.com",[866],{"type":867,"attrs":868},"link",{"href":864,"uuid":59,"anchor":59,"target":59,"linktype":31},{"text":870,"type":332}," source for currency rates.",{"type":347,"content":872},[873],{"type":327,"attrs":874,"content":875},{"textAlign":59},[876,880,881,884,886,889],{"text":877,"type":332,"marks":878},"adjust_price_display",[879],{"type":391},{"text":595,"type":332},{"text":597,"type":332,"marks":882},[883],{"type":410},{"text":885,"type":332}," Function ",{"text":603,"type":332,"marks":887},[888],{"type":410},{"text":890,"type":332}," Create a function to modify only the price displayed on the page, for example to make a tax exclusive price in your add to cart to be displayed as tax inclusive to the customer. The function is passed a single argument for the price to be modified, and the function must return the modified price as well.",{"type":401,"content":892},[893],{"type":327,"attrs":894,"content":895},{"textAlign":59},[896,899,901,904,905,908],{"text":407,"type":332,"marks":897},[898],{"type":410},{"text":900,"type":332}," All of the configuration options are optional, but to offer dynamic currency conversion ",{"text":591,"type":332,"marks":902},[903],{"type":391},{"text":507,"type":332},{"text":614,"type":332,"marks":906},[907],{"type":391},{"text":909,"type":332}," are required.",{"type":327,"attrs":911,"content":912},{"textAlign":59},[913],{"text":914,"type":332},"As an example, assume you had four template sets on your store. The store's DEFAULT template set is configured for USD, as are the product prices on the website by default, but there are also template sets for CAD, as well as Euro in both French and German languages. Your configuration could look like this, included above the snippet from step 1:",{"type":420,"attrs":916,"content":917},{"class":59},[918],{"text":919,"type":332},"\u003Cscript>\nvar FC = FC || {};\nFC.currency_config = {\n    'base': 'USD',\n    'sets': [\n        {\n            'currency': 'USD',\n            'template_set': 'DEFAULT',\n            'countries': ['US']\n        },\n        {\n            'currency': 'CAD',\n            'template_set': 'Canada',\n            'countries': ['CA']\n        },\n        {\n            'currency': 'EUR',\n            'template_set': 'Germany',\n            'countries': ['DE', 'BE']\n        },\n        {\n            'currency': 'EUR',\n            'template_set': 'France',\n            'countries': ['FR']\n        },\n    ]\n};\n\u003C\u002Fscript>",{"type":327,"attrs":921,"content":922},{"textAlign":59},[923,925,929,931,935],{"text":924,"type":332},"If a customer from Germany or Belgium visits your website, it will automatically apply the template set from your store with a code of ",{"text":926,"type":332,"marks":927},"Germany",[928],{"type":391},{"text":930,"type":332},", and then convert the prices to all be in Euro. If someone visits from Canada, then it will update to the ",{"text":932,"type":332,"marks":933},"Canada",[934],{"type":391},{"text":936,"type":332}," template set, and change the prices to Canadian dollars.",{"type":327,"attrs":938,"content":939},{"textAlign":59},[940,942,945,946,950,952,955],{"text":941,"type":332},"If curreny conversion is enabled for the snippet, then any ",{"text":530,"type":332,"marks":943},[944],{"type":391},{"text":507,"type":332},{"text":947,"type":332,"marks":948},"p",[949],{"type":391},{"text":951,"type":332}," product option modifiers will be dynamically converted to the current currency of the cart, rounding as specified by the ",{"text":755,"type":332,"marks":953},[954],{"type":391},{"text":956,"type":332}," configuration option.",{"type":327,"attrs":958,"content":959},{"textAlign":59},[960],{"text":961,"type":332},"Here is an example with all configuration options for the snippet:",{"type":420,"attrs":963,"content":964},{"class":59},[965],{"text":966,"type":332},"\u003Cscript>\nvar FC = FC || {};\nFC.currency_config = {\n    'base': 'USD',\n    'sets': [\n        {\n            'currency': 'USD',\n            'template_set': 'DEFAULT',\n            'countries': ['US']\n        },\n        {\n            'currency': 'CAD',\n            'template_set': 'Canada',\n            'countries': ['CA']\n        }\n    ],\n    'max_rate_cache': 12,\n    'rounding': 'half',\n    'active_class': 'currency-option-active',\n    'use_openexchangerates': 'abc123abc123abc123',\n    'adjust_price_display': function(price) { return price * 1.25; }\n};\n\u003C\u002Fscript>",{"type":401,"content":968},[969],{"type":327,"attrs":970,"content":971},{"textAlign":59},[972,976,977,980],{"text":973,"type":332,"marks":974},"Important:",[975],{"type":410},{"text":595,"type":332},{"text":567,"type":332,"marks":978},[979],{"type":410},{"text":981,"type":332}," The above is simply an example of what it looks like with all attributes for the configuration option. You will not want to copy this to use directly in your set up, but rather review each configuration option and only add them if you actually need them.",{"type":401,"content":983},[984],{"type":327,"attrs":985,"content":986},{"textAlign":59},[987,990,992,997,999,1005,1007,1010],{"text":567,"type":332,"marks":988},[989],{"type":410},{"text":991,"type":332}," By default this snippet will pull the currency conversion rates from ",{"text":993,"type":332,"marks":994},"floatrates.com",[995],{"type":867,"attrs":996},{"href":864,"uuid":59,"anchor":59,"target":59,"linktype":31},{"text":998,"type":332},". It does also support ",{"text":1000,"type":332,"marks":1001},"Open Exchange Rates",[1002],{"type":867,"attrs":1003},{"href":1004,"uuid":59,"anchor":59,"target":59,"linktype":31},"https:\u002F\u002Fopenexchangerates.org\u002F",{"text":1006,"type":332}," (which is also what we use for our own default currency conversion in the cart), but you'll need to create your own account and specify your API key using the ",{"text":850,"type":332,"marks":1008},[1009],{"type":391},{"text":956,"type":332},{"type":376,"attrs":1012,"content":1013},{"level":378,"textAlign":59},[1014],{"text":1015,"type":332},"Step 4: Set up a currency switcher",{"type":327,"attrs":1017,"content":1018},{"textAlign":59},[1019],{"text":1020,"type":332},"Although the snippet will automatically set a customers template set based on their location, you'll probably also want to allow customers to switch template sets on the fly, or perhaps have a modal window that displays to allow them to select an option.",{"type":327,"attrs":1022,"content":1023},{"textAlign":59},[1024,1026,1030],{"text":1025,"type":332},"You can set up your currency switcher however you want - it just requires a data attribute of ",{"text":1027,"type":332,"marks":1028},"data-fc-template-set",[1029],{"type":391},{"text":1031,"type":332}," be added to each link that designates what currency set it is for from your configuration from step 3.",{"type":327,"attrs":1033,"content":1034},{"textAlign":59},[1035,1037,1041],{"text":1036,"type":332},"For example, to have a link use the German Euro template set from the earlier example, you would add a data attribute of ",{"text":1038,"type":332,"marks":1039},"data-fc-template-set=\"Germany\"",[1040],{"type":391},{"text":1042,"type":332}," to the link element.",{"type":327,"attrs":1044,"content":1045},{"textAlign":59},[1046],{"text":1047,"type":332},"Here's an example of what the currency switcher could look like:",{"type":420,"attrs":1049,"content":1050},{"class":59},[1051],{"text":1052,"type":332},"\u003Cp>Select a locale: \u003Ca data-fc-template-set=\"DEFAULT\" href=\"#\">USD\u003C\u002Fa> |  \u003Ca data-fc-template-set=\"Canada\" href=\"#\">CAD\u003C\u002Fa> | \u003Ca data-fc-template-set=\"Germany\" href=\"#\">EUR (DE)\u003C\u002Fa> | \u003Ca data-fc-template-set=\"France\" href=\"#\">EUR (FR)\u003C\u002Fa>\u003C\u002Fp>",{"type":327,"attrs":1054,"content":1055},{"textAlign":59},[1056,1058,1061,1063,1066,1068,1072],{"text":1057,"type":332},"The ",{"text":1027,"type":332,"marks":1059},[1060],{"type":391},{"text":1062,"type":332}," value needs to match the ",{"text":641,"type":332,"marks":1064},[1065],{"type":391},{"text":1067,"type":332}," from the ",{"text":1069,"type":332,"marks":1070},"FC.currency_config.sets",[1071],{"type":391},{"text":956,"type":332},{"type":327,"attrs":1074,"content":1075},{"textAlign":59},[1076,1078,1081,1083,1086],{"text":1077,"type":332},"For styling - note that whichever template set is active will have a class added. By default the added class will be ",{"text":841,"type":332,"marks":1079},[1080],{"type":391},{"text":1082,"type":332},", but you can customise that using the ",{"text":826,"type":332,"marks":1084},[1085],{"type":391},{"text":956,"type":332},{"type":376,"attrs":1088,"content":1089},{"level":378,"textAlign":59},[1090],{"text":1091,"type":332},"Step 5: Allowing currency conversion for other prices",{"type":327,"attrs":1093,"content":1094},{"textAlign":59},[1095,1097,1101],{"text":1096,"type":332},"You may also have some prices listed on your site outside of your add to cart forms. For example, on a category listing page. To have these prices be converted to the currency of the cart, you just need to add a class to the element of ",{"text":1098,"type":332,"marks":1099},".fc-currency-price",[1100],{"type":391},{"text":1102,"type":332},", and the snippet will take care of the rest. For example:",{"type":420,"attrs":1104,"content":1105},{"class":59},[1106],{"text":1107,"type":332},"\u003Ch4 class=\"fc-currency-price\">$15.99\u003C\u002Fh4>",{"type":376,"attrs":1109,"content":1110},{"level":378,"textAlign":59},[1111],{"text":1112,"type":332},"That's it!",{"type":327,"attrs":1114,"content":1115},{"textAlign":59},[1116],{"text":1117,"type":332},"That should be it. Give your site a test and confirm that everything is working as you expect it to.",{"type":376,"attrs":1119,"content":1120},{"level":378,"textAlign":59},[1121],{"text":1122,"type":332},"Advanced: Dynamically triggering recalculation",{"type":327,"attrs":1124,"content":1125},{"textAlign":59},[1126],{"text":1127,"type":332},"If for whatever reason you need to trigger the dynamic price calculations to be recreated - for example if you dynamically add in a new input that includes a price modifier, you can execute this function in your javascript:",{"type":420,"attrs":1129,"content":1130},{"class":59},[1131],{"text":1132,"type":332},"FC.currency.update();",{"type":376,"attrs":1134,"content":1135},{"level":378,"textAlign":59},[1136],{"text":1137,"type":332},"Notes and Limitations",{"type":344,"content":1139},[1140,1159,1171],{"type":347,"content":1141},[1142],{"type":327,"attrs":1143,"content":1144},{"textAlign":59},[1145,1147,1151,1153,1157],{"text":1146,"type":332},"On the first time this snippet is run, it is run ",{"text":1148,"type":332,"marks":1149},"after",[1150],{"type":410},{"text":1152,"type":332}," the Foxy javascript has been initialized. As such - there may be a small time while the page is loading before the dynamic total is calculated. The snippet then uses your browser's ",{"text":1154,"type":332,"marks":1155},"localStorage",[1156],{"type":391},{"text":1158,"type":332}," to store key information to execute on page load for subsequent pages to minimise any delay on converting.",{"type":347,"content":1160},[1161],{"type":327,"attrs":1162,"content":1163},{"textAlign":59},[1164,1166,1169],{"text":1165,"type":332},"Currently only product ",{"text":530,"type":332,"marks":1167},[1168],{"type":391},{"text":1170,"type":332}," inputs and price product option modifiers are converted. Product level discounts are not currently converted.",{"type":347,"content":1172},[1173],{"type":327,"attrs":1174,"content":1175},{"textAlign":59},[1176],{"text":1177,"type":332},"Product links are also not currently converted.",{"id":59,"alt":59,"name":13,"focus":59,"title":59,"source":59,"filename":13,"copyright":59,"fieldtype":81,"meta_data":1179},{},"How to update product prices as options change, switch template sets, and convert prices to other currencies before add to cart.","c79a3dcc-329d-4b00-84cb-a4c50922a48f",[],"update-product-totals-with-multicurrency-support-before-add-to-cart","help\u002Farticles\u002Fupdate-product-totals-with-multicurrency-support-before-add-to-cart",-4370,[],2659,"f470304a-b3c6-4d9b-830c-37358b6a1bc8",[],{"html":1191,"sections":1192,"segments":1217},"\u003Cp>For stores looking to support multiple different currencies, it&#039;s important to be able to show product prices in those different currencies. This helps customers to be able to know exactly what they&#039;ll be paying - rather than needing to do those calculations themselves.\u003C\u002Fp>\u003Cp>Not all website builders and CMS&#039;s support setting multiple prices for a single product though, so you can be limited to just a single currency that you can display your prices in.\u003C\u002Fp>\u003Cp>The following snippet will allow you to add the following functionality to your website:\u003C\u002Fp>\u003Cul>\u003Cli>\u003Cp>Dynamically set the template set for the cart on initial page load, based on the location of the customer, which will set the locale, language and currency of the cart.\u003C\u002Fp>\u003C\u002Fli>\u003Cli>\u003Cp>Convert the prices and price modifiers in all product add to cart forms to the cart currency\u003C\u002Fp>\u003C\u002Fli>\u003Cli>\u003Cp>Convert all prices displayed to customers to the cart currency\u003C\u002Fp>\u003C\u002Fli>\u003Cli>\u003Cp>Display a dynamic product total, taking into consideration a change in quantity or product options that include a price modifier.\u003C\u002Fp>\u003C\u002Fli>\u003C\u002Ful>\u003Csection id=\"step-1-include-snippet\" data-title=\"Step 1: Include snippet\" data-title-node=\"H2\">\u003Chr class=\"my-8\" style=\"margin-left: -48px; margin-right: -40vw\">\u003Ch2 data-anchor-id=\"step-1-include-snippet\">Step 1: Include snippet\u003C\u002Fh2>\u003Cp>Paste the following code before the closing \u003Ccode class=\"badge bg-soft-danger text-danger\">&lt;\u002Fbody&gt;\u003C\u002Fcode> tag of any page that you want to add this functionality to. It can also be included in an existing javascript file on your page if you prefer. This snippet relies on the \u003Ccode class=\"badge bg-soft-danger text-danger\">loader.js\u003C\u002Fcode> file also being included on your page.\u003C\u002Fp>\u003Cblockquote>\u003Cp>\u003Cstrong>Tip:\u003C\u002Fstrong> This is \u003Cstrong>not\u003C\u002Fstrong> required on the cart, checkout or receipt pages, so it should not be placed in those templates or in your store&#039;s admin settings. Just on your own website.\u003C\u002Fp>\u003C\u002Fblockquote>\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>\u003Cspan class=\"hljs-tag\">&lt;\u003Cspan class=\"hljs-name\">script\u003C\u002Fspan>&gt;\u003C\u002Fspan>\u003Cspan class=\"language-javascript\">\n\u003Cspan class=\"hljs-comment\">\u002F* Foxy Dynamic Product Prices and Currency Conversion v0.8, https:\u002F\u002Ffoxy.io *\u002F\u003C\u002Fspan>\n!\u003Cspan class=\"hljs-keyword\">function\u003C\u002Fspan>(\u003Cspan class=\"hljs-params\">t,e\u003C\u002Fspan>){\u003Cspan class=\"hljs-keyword\">var\u003C\u002Fspan> n=\u003Cspan class=\"hljs-keyword\">function\u003C\u002Fspan>(\u003Cspan class=\"hljs-params\">t\u003C\u002Fspan>){\u003Cspan class=\"hljs-keyword\">return\u003C\u002Fspan> \u003Cspan class=\"hljs-keyword\">new\u003C\u002Fspan> \u003Cspan class=\"hljs-title function_\">i\u003C\u002Fspan>(t)};n.\u003Cspan class=\"hljs-property\">version\u003C\u002Fspan>=\u003Cspan class=\"hljs-string\">&quot;0.1.3&quot;\u003C\u002Fspan>;\u003Cspan class=\"hljs-keyword\">var\u003C\u002Fspan> a=t.\u003Cspan class=\"hljs-property\">fxSetup\u003C\u002Fspan>||{\u003Cspan class=\"hljs-attr\">rates\u003C\u002Fspan>:{},\u003Cspan class=\"hljs-attr\">base\u003C\u002Fspan>:\u003Cspan class=\"hljs-string\">&quot;&quot;\u003C\u002Fspan>};n.\u003Cspan class=\"hljs-property\">rates\u003C\u002Fspan>=a.\u003Cspan class=\"hljs-property\">rates\u003C\u002Fspan>,n.\u003Cspan class=\"hljs-property\">base\u003C\u002Fspan>=a.\u003Cspan class=\"hljs-property\">base\u003C\u002Fspan>,n.\u003Cspan class=\"hljs-property\">settings\u003C\u002Fspan>={\u003Cspan class=\"hljs-attr\">from\u003C\u002Fspan>:a.\u003Cspan class=\"hljs-property\">from\u003C\u002Fspan>||n.\u003Cspan class=\"hljs-property\">base\u003C\u002Fspan>,\u003Cspan class=\"hljs-attr\">to\u003C\u002Fspan>:a.\u003Cspan class=\"hljs-property\">to\u003C\u002Fspan>||n.\u003Cspan class=\"hljs-property\">base\u003C\u002Fspan>};\u003Cspan class=\"hljs-keyword\">var\u003C\u002Fspan> r=n.\u003Cspan class=\"hljs-property\">convert\u003C\u002Fspan>=\u003Cspan class=\"hljs-keyword\">function\u003C\u002Fspan>(\u003Cspan class=\"hljs-params\">t,e\u003C\u002Fspan>){\u003Cspan class=\"hljs-keyword\">if\u003C\u002Fspan>(\u003Cspan class=\"hljs-string\">&quot;object&quot;\u003C\u002Fspan>==\u003Cspan class=\"hljs-keyword\">typeof\u003C\u002Fspan> t&amp;&amp;t.\u003Cspan class=\"hljs-property\">length\u003C\u002Fspan>){\u003Cspan class=\"hljs-keyword\">for\u003C\u002Fspan>(\u003Cspan class=\"hljs-keyword\">var\u003C\u002Fspan> a=\u003Cspan class=\"hljs-number\">0\u003C\u002Fspan>;a&lt;t.\u003Cspan class=\"hljs-property\">length\u003C\u002Fspan>;a++)t[a]=\u003Cspan class=\"hljs-title function_\">r\u003C\u002Fspan>(t[a],e);\u003Cspan class=\"hljs-keyword\">return\u003C\u002Fspan> t}(e=e||{}).\u003Cspan class=\"hljs-property\">from\u003C\u002Fspan>||(e.\u003Cspan class=\"hljs-property\">from\u003C\u002Fspan>=n.\u003Cspan class=\"hljs-property\">settings\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">from\u003C\u002Fspan>),e.\u003Cspan class=\"hljs-property\">to\u003C\u002Fspan>||(e.\u003Cspan class=\"hljs-property\">to\u003C\u002Fspan>=n.\u003Cspan class=\"hljs-property\">settings\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">to\u003C\u002Fspan>);a=e.\u003Cspan class=\"hljs-property\">to\u003C\u002Fspan>;\u003Cspan class=\"hljs-keyword\">var\u003C\u002Fspan> i=e.\u003Cspan class=\"hljs-property\">from\u003C\u002Fspan>,s=n.\u003Cspan class=\"hljs-property\">rates\u003C\u002Fspan>;\u003Cspan class=\"hljs-keyword\">if\u003C\u002Fspan>(s[n.\u003Cspan class=\"hljs-property\">base\u003C\u002Fspan>]=\u003Cspan class=\"hljs-number\">1\u003C\u002Fspan>,!s[a]||!s[i])\u003Cspan class=\"hljs-keyword\">throw\u003C\u002Fspan>\u003Cspan class=\"hljs-string\">&quot;fx error&quot;\u003C\u002Fspan>;\u003Cspan class=\"hljs-keyword\">return\u003C\u002Fspan> t*(a=i===n.\u003Cspan class=\"hljs-property\">base\u003C\u002Fspan>?s[a]:a===n.\u003Cspan class=\"hljs-property\">base\u003C\u002Fspan>?\u003Cspan class=\"hljs-number\">1\u003C\u002Fspan>\u002Fs[i]:s[a]*(\u003Cspan class=\"hljs-number\">1\u003C\u002Fspan>\u002Fs[i]))},i=\u003Cspan class=\"hljs-keyword\">function\u003C\u002Fspan>(\u003Cspan class=\"hljs-params\">t\u003C\u002Fspan>){\u003Cspan class=\"hljs-string\">&quot;string&quot;\u003C\u002Fspan>==\u003Cspan class=\"hljs-keyword\">typeof\u003C\u002Fspan> t?(\u003Cspan class=\"hljs-variable language_\">this\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">_v\u003C\u002Fspan>=\u003Cspan class=\"hljs-built_in\">parseFloat\u003C\u002Fspan>(t.\u003Cspan class=\"hljs-title function_\">replace\u003C\u002Fspan>(\u003Cspan class=\"hljs-regexp\">\u002F[^0-9-.]\u002Fg\u003C\u002Fspan>,\u003Cspan class=\"hljs-string\">&quot;&quot;\u003C\u002Fspan>)),\u003Cspan class=\"hljs-variable language_\">this\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">_fx\u003C\u002Fspan>=t.\u003Cspan class=\"hljs-title function_\">replace\u003C\u002Fspan>(\u003Cspan class=\"hljs-regexp\">\u002F([^A-Za-z])\u002Fg\u003C\u002Fspan>,\u003Cspan class=\"hljs-string\">&quot;&quot;\u003C\u002Fspan>)):\u003Cspan class=\"hljs-variable language_\">this\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">_v\u003C\u002Fspan>=t};(a=n.\u003Cspan class=\"hljs-property\">\u003Cspan class=\"hljs-keyword\">prototype\u003C\u002Fspan>\u003C\u002Fspan>=i.\u003Cspan class=\"hljs-property\">\u003Cspan class=\"hljs-keyword\">prototype\u003C\u002Fspan>\u003C\u002Fspan>).\u003Cspan class=\"hljs-property\">convert\u003C\u002Fspan>=\u003Cspan class=\"hljs-keyword\">function\u003C\u002Fspan>(\u003Cspan class=\"hljs-params\">\u003C\u002Fspan>){\u003Cspan class=\"hljs-keyword\">var\u003C\u002Fspan> t=\u003Cspan class=\"hljs-title class_\">Array\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">\u003Cspan class=\"hljs-keyword\">prototype\u003C\u002Fspan>\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">slice\u003C\u002Fspan>.\u003Cspan class=\"hljs-title function_\">call\u003C\u002Fspan>(\u003Cspan class=\"hljs-variable language_\">arguments\u003C\u002Fspan>);\u003Cspan class=\"hljs-keyword\">return\u003C\u002Fspan> t.\u003Cspan class=\"hljs-title function_\">unshift\u003C\u002Fspan>(\u003Cspan class=\"hljs-variable language_\">this\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">_v\u003C\u002Fspan>),r.\u003Cspan class=\"hljs-title function_\">apply\u003C\u002Fspan>(n,t)},a.\u003Cspan class=\"hljs-property\">from\u003C\u002Fspan>=\u003Cspan class=\"hljs-keyword\">function\u003C\u002Fspan>(\u003Cspan class=\"hljs-params\">t\u003C\u002Fspan>){\u003Cspan class=\"hljs-keyword\">return\u003C\u002Fspan>(t=\u003Cspan class=\"hljs-title function_\">n\u003C\u002Fspan>(\u003Cspan class=\"hljs-title function_\">r\u003C\u002Fspan>(\u003Cspan class=\"hljs-variable language_\">this\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">_v\u003C\u002Fspan>,{\u003Cspan class=\"hljs-attr\">from\u003C\u002Fspan>:t,\u003Cspan class=\"hljs-attr\">to\u003C\u002Fspan>:n.\u003Cspan class=\"hljs-property\">base\u003C\u002Fspan>}))).\u003Cspan class=\"hljs-property\">_fx\u003C\u002Fspan>=n.\u003Cspan class=\"hljs-property\">base\u003C\u002Fspan>,t},a.\u003Cspan class=\"hljs-property\">to\u003C\u002Fspan>=\u003Cspan class=\"hljs-keyword\">function\u003C\u002Fspan>(\u003Cspan class=\"hljs-params\">t\u003C\u002Fspan>){\u003Cspan class=\"hljs-keyword\">return\u003C\u002Fspan> \u003Cspan class=\"hljs-title function_\">r\u003C\u002Fspan>(\u003Cspan class=\"hljs-variable language_\">this\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">_v\u003C\u002Fspan>,{\u003Cspan class=\"hljs-attr\">from\u003C\u002Fspan>:\u003Cspan class=\"hljs-variable language_\">this\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">_fx\u003C\u002Fspan>?\u003Cspan class=\"hljs-variable language_\">this\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">_fx\u003C\u002Fspan>:n.\u003Cspan class=\"hljs-property\">settings\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">from\u003C\u002Fspan>,\u003Cspan class=\"hljs-attr\">to\u003C\u002Fspan>:t})},\u003Cspan class=\"hljs-string\">&quot;undefined&quot;\u003C\u002Fspan>!=\u003Cspan class=\"hljs-keyword\">typeof\u003C\u002Fspan> \u003Cspan class=\"hljs-built_in\">exports\u003C\u002Fspan>?(\u003Cspan class=\"hljs-string\">&quot;undefined&quot;\u003C\u002Fspan>!=\u003Cspan class=\"hljs-keyword\">typeof\u003C\u002Fspan> \u003Cspan class=\"hljs-variable language_\">module\u003C\u002Fspan>&amp;&amp;\u003Cspan class=\"hljs-variable language_\">module\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">exports\u003C\u002Fspan>&amp;&amp;(\u003Cspan class=\"hljs-built_in\">exports\u003C\u002Fspan>=\u003Cspan class=\"hljs-variable language_\">module\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">exports\u003C\u002Fspan>=n),\u003Cspan class=\"hljs-built_in\">exports\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">fx\u003C\u002Fspan>=fx):\u003Cspan class=\"hljs-string\">&quot;function&quot;\u003C\u002Fspan>==\u003Cspan class=\"hljs-keyword\">typeof\u003C\u002Fspan> define&amp;&amp;define.\u003Cspan class=\"hljs-property\">amd\u003C\u002Fspan>?\u003Cspan class=\"hljs-title function_\">define\u003C\u002Fspan>([],(\u003Cspan class=\"hljs-keyword\">function\u003C\u002Fspan>(\u003Cspan class=\"hljs-params\">\u003C\u002Fspan>){\u003Cspan class=\"hljs-keyword\">return\u003C\u002Fspan> n})):(n.\u003Cspan class=\"hljs-property\">noConflict\u003C\u002Fspan>=\u003Cspan class=\"hljs-keyword\">function\u003C\u002Fspan>(\u003Cspan class=\"hljs-params\">e\u003C\u002Fspan>){\u003Cspan class=\"hljs-keyword\">return\u003C\u002Fspan> \u003Cspan class=\"hljs-keyword\">function\u003C\u002Fspan>(\u003Cspan class=\"hljs-params\">\u003C\u002Fspan>){\u003Cspan class=\"hljs-keyword\">return\u003C\u002Fspan> t.\u003Cspan class=\"hljs-property\">fx\u003C\u002Fspan>=e,n.\u003Cspan class=\"hljs-property\">noConflict\u003C\u002Fspan>=\u003Cspan class=\"hljs-literal\">undefined\u003C\u002Fspan>,n}}(t.\u003Cspan class=\"hljs-property\">fx\u003C\u002Fspan>),t.\u003Cspan class=\"hljs-property\">fx\u003C\u002Fspan>=n)}(\u003Cspan class=\"hljs-variable language_\">this\u003C\u002Fspan>),\u003Cspan class=\"hljs-keyword\">function\u003C\u002Fspan>(\u003Cspan class=\"hljs-params\">t\u003C\u002Fspan>){\u003Cspan class=\"hljs-string\">&quot;object&quot;\u003C\u002Fspan>==\u003Cspan class=\"hljs-keyword\">typeof\u003C\u002Fspan> \u003Cspan class=\"hljs-built_in\">exports\u003C\u002Fspan>&amp;&amp;\u003Cspan class=\"hljs-string\">&quot;undefined&quot;\u003C\u002Fspan>!=\u003Cspan class=\"hljs-keyword\">typeof\u003C\u002Fspan> \u003Cspan class=\"hljs-variable language_\">module\u003C\u002Fspan>?\u003Cspan class=\"hljs-variable language_\">module\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">exports\u003C\u002Fspan>=\u003Cspan class=\"hljs-title function_\">t\u003C\u002Fspan>():\u003Cspan class=\"hljs-string\">&quot;function&quot;\u003C\u002Fspan>==\u003Cspan class=\"hljs-keyword\">typeof\u003C\u002Fspan> define&amp;&amp;define.\u003Cspan class=\"hljs-property\">amd\u003C\u002Fspan>?\u003Cspan class=\"hljs-title function_\">define\u003C\u002Fspan>([],t):(\u003Cspan class=\"hljs-string\">&quot;undefined&quot;\u003C\u002Fspan>!=\u003Cspan class=\"hljs-keyword\">typeof\u003C\u002Fspan> \u003Cspan class=\"hljs-variable language_\">window\u003C\u002Fspan>?\u003Cspan class=\"hljs-attr\">window\u003C\u002Fspan>:\u003Cspan class=\"hljs-string\">&quot;undefined&quot;\u003C\u002Fspan>!=\u003Cspan class=\"hljs-keyword\">typeof\u003C\u002Fspan> \u003Cspan class=\"hljs-variable language_\">global\u003C\u002Fspan>?\u003Cspan class=\"hljs-attr\">global\u003C\u002Fspan>:\u003Cspan class=\"hljs-string\">&quot;undefined&quot;\u003C\u002Fspan>!=\u003Cspan class=\"hljs-keyword\">typeof\u003C\u002Fspan> self?\u003Cspan class=\"hljs-attr\">self\u003C\u002Fspan>:\u003Cspan class=\"hljs-variable language_\">this\u003C\u002Fspan>).\u003Cspan class=\"hljs-property\">numberCurrencyFormat\u003C\u002Fspan>=\u003Cspan class=\"hljs-title function_\">t\u003C\u002Fspan>()}((\u003Cspan class=\"hljs-keyword\">function\u003C\u002Fspan>(\u003Cspan class=\"hljs-params\">\u003C\u002Fspan>){\u003Cspan class=\"hljs-keyword\">return\u003C\u002Fspan> \u003Cspan class=\"hljs-keyword\">function\u003C\u002Fspan> \u003Cspan class=\"hljs-title function_\">t\u003C\u002Fspan>(\u003Cspan class=\"hljs-params\">e,n,a\u003C\u002Fspan>){\u003Cspan class=\"hljs-keyword\">function\u003C\u002Fspan> \u003Cspan class=\"hljs-title function_\">r\u003C\u002Fspan>(\u003Cspan class=\"hljs-params\">s,o\u003C\u002Fspan>){\u003Cspan class=\"hljs-keyword\">if\u003C\u002Fspan>(!n[s]){\u003Cspan class=\"hljs-keyword\">if\u003C\u002Fspan>(!e[s]){\u003Cspan class=\"hljs-keyword\">var\u003C\u002Fspan> c=\u003Cspan class=\"hljs-string\">&quot;function&quot;\u003C\u002Fspan>==\u003Cspan class=\"hljs-keyword\">typeof\u003C\u002Fspan> \u003Cspan class=\"hljs-built_in\">require\u003C\u002Fspan>&amp;&amp;\u003Cspan class=\"hljs-built_in\">require\u003C\u002Fspan>;\u003Cspan class=\"hljs-keyword\">if\u003C\u002Fspan>(!o&amp;&amp;c)\u003Cspan class=\"hljs-keyword\">return\u003C\u002Fspan> \u003Cspan class=\"hljs-title function_\">c\u003C\u002Fspan>(s,!\u003Cspan class=\"hljs-number\">0\u003C\u002Fspan>);\u003Cspan class=\"hljs-keyword\">if\u003C\u002Fspan>(i)\u003Cspan class=\"hljs-keyword\">return\u003C\u002Fspan> \u003Cspan class=\"hljs-title function_\">i\u003C\u002Fspan>(s,!\u003Cspan class=\"hljs-number\">0\u003C\u002Fspan>);\u003Cspan class=\"hljs-keyword\">var\u003C\u002Fspan> u=\u003Cspan class=\"hljs-keyword\">new\u003C\u002Fspan> \u003Cspan class=\"hljs-title class_\">Error\u003C\u002Fspan>(\u003Cspan class=\"hljs-string\">&quot;Cannot find module &#x27;&quot;\u003C\u002Fspan>+s+\u003Cspan class=\"hljs-string\">&quot;&#x27;&quot;\u003C\u002Fspan>);\u003Cspan class=\"hljs-keyword\">throw\u003C\u002Fspan> u.\u003Cspan class=\"hljs-property\">code\u003C\u002Fspan>=\u003Cspan class=\"hljs-string\">&quot;MODULE_NOT_FOUND&quot;\u003C\u002Fspan>,u}\u003Cspan class=\"hljs-keyword\">var\u003C\u002Fspan> f=n[s]={\u003Cspan class=\"hljs-attr\">exports\u003C\u002Fspan>:{}};e[s][\u003Cspan class=\"hljs-number\">0\u003C\u002Fspan>].\u003Cspan class=\"hljs-title function_\">call\u003C\u002Fspan>(f.\u003Cspan class=\"hljs-property\">exports\u003C\u002Fspan>,(\u003Cspan class=\"hljs-keyword\">function\u003C\u002Fspan>(\u003Cspan class=\"hljs-params\">t\u003C\u002Fspan>){\u003Cspan class=\"hljs-keyword\">return\u003C\u002Fspan> \u003Cspan class=\"hljs-title function_\">r\u003C\u002Fspan>(e[s][\u003Cspan class=\"hljs-number\">1\u003C\u002Fspan>][t]||t)}),f,f.\u003Cspan class=\"hljs-property\">exports\u003C\u002Fspan>,t,e,n,a)}\u003Cspan class=\"hljs-keyword\">return\u003C\u002Fspan> n[s].\u003Cspan class=\"hljs-property\">exports\u003C\u002Fspan>}\u003Cspan class=\"hljs-keyword\">for\u003C\u002Fspan>(\u003Cspan class=\"hljs-keyword\">var\u003C\u002Fspan> i=\u003Cspan class=\"hljs-string\">&quot;function&quot;\u003C\u002Fspan>==\u003Cspan class=\"hljs-keyword\">typeof\u003C\u002Fspan> \u003Cspan class=\"hljs-built_in\">require\u003C\u002Fspan>&amp;&amp;\u003Cspan class=\"hljs-built_in\">require\u003C\u002Fspan>,s=\u003Cspan class=\"hljs-number\">0\u003C\u002Fspan>;s&lt;a.\u003Cspan class=\"hljs-property\">length\u003C\u002Fspan>;s++)\u003Cspan class=\"hljs-title function_\">r\u003C\u002Fspan>(a[s]);\u003Cspan class=\"hljs-keyword\">return\u003C\u002Fspan> r}({\u003Cspan class=\"hljs-number\">1\u003C\u002Fspan>:[\u003Cspan class=\"hljs-keyword\">function\u003C\u002Fspan>(\u003Cspan class=\"hljs-params\">t,e,n\u003C\u002Fspan>){\u003Cspan class=\"hljs-string\">&quot;use strict&quot;\u003C\u002Fspan>;\u003Cspan class=\"hljs-keyword\">const\u003C\u002Fspan> a=\u003Cspan class=\"hljs-string\">&quot;LEFT&quot;\u003C\u002Fspan>,r=\u003Cspan class=\"hljs-string\">&quot;ALWAYS&quot;\u003C\u002Fspan>,i=\u003Cspan class=\"hljs-string\">&quot;NEVER&quot;\u003C\u002Fspan>,s=\u003Cspan class=\"hljs-string\">&quot;IF_NEEDED&quot;\u003C\u002Fspan>,o=\u003Cspan class=\"hljs-string\">&quot;AS_IS&quot;\u003C\u002Fspan>,c={\u003Cspan class=\"hljs-attr\">currency\u003C\u002Fspan>:\u003Cspan class=\"hljs-string\">&quot;&quot;\u003C\u002Fspan>,\u003Cspan class=\"hljs-attr\">showDecimals\u003C\u002Fspan>:r,\u003Cspan class=\"hljs-attr\">thousandSeparator\u003C\u002Fspan>:\u003Cspan class=\"hljs-string\">&quot;,&quot;\u003C\u002Fspan>,\u003Cspan class=\"hljs-attr\">decimalSeparator\u003C\u002Fspan>:\u003Cspan class=\"hljs-string\">&quot;.&quot;\u003C\u002Fspan>,\u003Cspan class=\"hljs-attr\">currencyPosition\u003C\u002Fspan>:\u003Cspan class=\"hljs-string\">&quot;RIGHT&quot;\u003C\u002Fspan>,\u003Cspan class=\"hljs-attr\">decimalsDigits\u003C\u002Fspan>:\u003Cspan class=\"hljs-number\">2\u003C\u002Fspan>,\u003Cspan class=\"hljs-attr\">spacing\u003C\u002Fspan>:!\u003Cspan class=\"hljs-number\">0\u003C\u002Fspan>,\u003Cspan class=\"hljs-attr\">arithmeticalRounding\u003C\u002Fspan>:!\u003Cspan class=\"hljs-number\">1\u003C\u002Fspan>};\u003Cspan class=\"hljs-keyword\">function\u003C\u002Fspan> \u003Cspan class=\"hljs-title function_\">u\u003C\u002Fspan>(\u003Cspan class=\"hljs-params\">t,e\u003C\u002Fspan>){\u003Cspan class=\"hljs-keyword\">return\u003C\u002Fspan> \u003Cspan class=\"hljs-keyword\">void\u003C\u002Fspan> \u003Cspan class=\"hljs-number\">0\u003C\u002Fspan>!==t?\u003Cspan class=\"hljs-attr\">t\u003C\u002Fspan>:e}\u003Cspan class=\"hljs-keyword\">function\u003C\u002Fspan> \u003Cspan class=\"hljs-title function_\">f\u003C\u002Fspan>(\u003Cspan class=\"hljs-params\">t\u003C\u002Fspan>){\u003Cspan class=\"hljs-keyword\">return\u003C\u002Fspan> t?{\u003Cspan class=\"hljs-attr\">currency\u003C\u002Fspan>:t.\u003Cspan class=\"hljs-property\">currency\u003C\u002Fspan>||c.\u003Cspan class=\"hljs-property\">currency\u003C\u002Fspan>,\u003Cspan class=\"hljs-attr\">thousandSeparator\u003C\u002Fspan>:\u003Cspan class=\"hljs-title function_\">u\u003C\u002Fspan>(t.\u003Cspan class=\"hljs-property\">thousandSeparator\u003C\u002Fspan>,c.\u003Cspan class=\"hljs-property\">thousandSeparator\u003C\u002Fspan>),\u003Cspan class=\"hljs-attr\">decimalSeparator\u003C\u002Fspan>:\u003Cspan class=\"hljs-title function_\">u\u003C\u002Fspan>(t.\u003Cspan class=\"hljs-property\">decimalSeparator\u003C\u002Fspan>,c.\u003Cspan class=\"hljs-property\">decimalSeparator\u003C\u002Fspan>),\u003Cspan class=\"hljs-attr\">showDecimals\u003C\u002Fspan>:t.\u003Cspan class=\"hljs-property\">showDecimals\u003C\u002Fspan>||c.\u003Cspan class=\"hljs-property\">showDecimals\u003C\u002Fspan>,\u003Cspan class=\"hljs-attr\">decimalsDigits\u003C\u002Fspan>:\u003Cspan class=\"hljs-title function_\">u\u003C\u002Fspan>(t.\u003Cspan class=\"hljs-property\">decimalsDigits\u003C\u002Fspan>,c.\u003Cspan class=\"hljs-property\">decimalsDigits\u003C\u002Fspan>),\u003Cspan class=\"hljs-attr\">currencyPosition\u003C\u002Fspan>:t.\u003Cspan class=\"hljs-property\">currencyPosition\u003C\u002Fspan>||c.\u003Cspan class=\"hljs-property\">currencyPosition\u003C\u002Fspan>,\u003Cspan class=\"hljs-attr\">spacing\u003C\u002Fspan>:\u003Cspan class=\"hljs-title function_\">u\u003C\u002Fspan>(t.\u003Cspan class=\"hljs-property\">spacing\u003C\u002Fspan>,c.\u003Cspan class=\"hljs-property\">spacing\u003C\u002Fspan>),\u003Cspan class=\"hljs-attr\">arithmeticalRounding\u003C\u002Fspan>:\u003Cspan class=\"hljs-title function_\">u\u003C\u002Fspan>(t.\u003Cspan class=\"hljs-property\">arithmeticalRounding\u003C\u002Fspan>,c.\u003Cspan class=\"hljs-property\">arithmeticalRounding\u003C\u002Fspan>)}:c}\u003Cspan class=\"hljs-keyword\">function\u003C\u002Fspan> \u003Cspan class=\"hljs-title function_\">l\u003C\u002Fspan>(\u003Cspan class=\"hljs-params\">t\u003C\u002Fspan>){\u003Cspan class=\"hljs-keyword\">return\u003C\u002Fspan>\u003Cspan class=\"hljs-regexp\">\u002F^[\\.,]$\u002F\u003C\u002Fspan>.\u003Cspan class=\"hljs-title function_\">test\u003C\u002Fspan>(t)}e.\u003Cspan class=\"hljs-property\">exports\u003C\u002Fspan>={\u003Cspan class=\"hljs-attr\">format\u003C\u002Fspan>:\u003Cspan class=\"hljs-keyword\">function\u003C\u002Fspan>(\u003Cspan class=\"hljs-params\">t,e\u003C\u002Fspan>){\u003Cspan class=\"hljs-keyword\">const\u003C\u002Fspan> n=\u003Cspan class=\"hljs-title function_\">f\u003C\u002Fspan>(e),c=n.\u003Cspan class=\"hljs-property\">showDecimals\u003C\u002Fspan>===o?t.\u003Cspan class=\"hljs-title function_\">toString\u003C\u002Fspan>():\u003Cspan class=\"hljs-built_in\">parseFloat\u003C\u002Fspan>((n.\u003Cspan class=\"hljs-property\">arithmeticalRounding\u003C\u002Fspan>?\u003Cspan class=\"hljs-keyword\">function\u003C\u002Fspan>(\u003Cspan class=\"hljs-params\">t,e\u003C\u002Fspan>){\u003Cspan class=\"hljs-keyword\">return\u003C\u002Fspan>+(\u003Cspan class=\"hljs-title class_\">Math\u003C\u002Fspan>.\u003Cspan class=\"hljs-title function_\">round\u003C\u002Fspan>(t+\u003Cspan class=\"hljs-string\">&quot;e+&quot;\u003C\u002Fspan>+e)+\u003Cspan class=\"hljs-string\">&quot;e-&quot;\u003C\u002Fspan>+e)}(t,n.\u003Cspan class=\"hljs-property\">decimalsDigits\u003C\u002Fspan>):+t).\u003Cspan class=\"hljs-title function_\">toString\u003C\u002Fspan>()).\u003Cspan class=\"hljs-title function_\">toFixed\u003C\u002Fspan>(n.\u003Cspan class=\"hljs-property\">showDecimals\u003C\u002Fspan>===i?\u003Cspan class=\"hljs-number\">0\u003C\u002Fspan>:n.\u003Cspan class=\"hljs-property\">decimalsDigits\u003C\u002Fspan>);\u003Cspan class=\"hljs-keyword\">if\u003C\u002Fspan>(\u003Cspan class=\"hljs-built_in\">isNaN\u003C\u002Fspan>(c))\u003Cspan class=\"hljs-keyword\">return\u003C\u002Fspan> t;\u003Cspan class=\"hljs-keyword\">const\u003C\u002Fspan> u=c.\u003Cspan class=\"hljs-title function_\">split\u003C\u002Fspan>(\u003Cspan class=\"hljs-string\">&quot;.&quot;\u003C\u002Fspan>),l=u[\u003Cspan class=\"hljs-number\">0\u003C\u002Fspan>],d=u[\u003Cspan class=\"hljs-number\">1\u003C\u002Fspan>]||\u003Cspan class=\"hljs-string\">&quot;&quot;\u003C\u002Fspan>,p=n.\u003Cspan class=\"hljs-property\">showDecimals\u003C\u002Fspan>===r||n.\u003Cspan class=\"hljs-property\">showDecimals\u003C\u002Fspan>===s&amp;&amp;+d&gt;\u003Cspan class=\"hljs-number\">0\u003C\u002Fspan>||n.\u003Cspan class=\"hljs-property\">showDecimals\u003C\u002Fspan>===o&amp;&amp;d.\u003Cspan class=\"hljs-property\">length\u003C\u002Fspan>&gt;\u003Cspan class=\"hljs-number\">0\u003C\u002Fspan>?n.\u003Cspan class=\"hljs-property\">decimalSeparator\u003C\u002Fspan>+\u003Cspan class=\"hljs-attr\">d\u003C\u002Fspan>:\u003Cspan class=\"hljs-string\">&quot;&quot;\u003C\u002Fspan>,h=(m=l,g=n.\u003Cspan class=\"hljs-property\">thousandSeparator\u003C\u002Fspan>,m.\u003Cspan class=\"hljs-title function_\">split\u003C\u002Fspan>(\u003Cspan class=\"hljs-string\">&quot;&quot;\u003C\u002Fspan>).\u003Cspan class=\"hljs-title function_\">reduce\u003C\u002Fspan>((\u003Cspan class=\"hljs-keyword\">function\u003C\u002Fspan>(\u003Cspan class=\"hljs-params\">t,e,n\u003C\u002Fspan>){\u003Cspan class=\"hljs-keyword\">return\u003C\u002Fspan> t+e+(n&lt;m.\u003Cspan class=\"hljs-property\">length\u003C\u002Fspan>-\u003Cspan class=\"hljs-number\">1\u003C\u002Fspan>&amp;&amp;(m.\u003Cspan class=\"hljs-property\">length\u003C\u002Fspan>-n-\u003Cspan class=\"hljs-number\">1\u003C\u002Fspan>)%\u003Cspan class=\"hljs-number\">3\u003C\u002Fspan>==\u003Cspan class=\"hljs-number\">0\u003C\u002Fspan>&amp;&amp;\u003Cspan class=\"hljs-string\">&quot;-&quot;\u003C\u002Fspan>!==e?\u003Cspan class=\"hljs-attr\">g\u003C\u002Fspan>:\u003Cspan class=\"hljs-string\">&quot;&quot;\u003C\u002Fspan>)}),\u003Cspan class=\"hljs-string\">&quot;&quot;\u003C\u002Fspan>)+p);\u003Cspan class=\"hljs-keyword\">var\u003C\u002Fspan> m,g;\u003Cspan class=\"hljs-keyword\">if\u003C\u002Fspan>(n.\u003Cspan class=\"hljs-property\">currency\u003C\u002Fspan>){\u003Cspan class=\"hljs-keyword\">const\u003C\u002Fspan> t=n.\u003Cspan class=\"hljs-property\">spacing\u003C\u002Fspan>?\u003Cspan class=\"hljs-string\">&quot; &quot;\u003C\u002Fspan>:\u003Cspan class=\"hljs-string\">&quot;&quot;\u003C\u002Fspan>;\u003Cspan class=\"hljs-keyword\">return\u003C\u002Fspan> n.\u003Cspan class=\"hljs-property\">currencyPosition\u003C\u002Fspan>===a?n.\u003Cspan class=\"hljs-property\">currency\u003C\u002Fspan>+t+\u003Cspan class=\"hljs-attr\">h\u003C\u002Fspan>:h+t+n.\u003Cspan class=\"hljs-property\">currency\u003C\u002Fspan>}\u003Cspan class=\"hljs-keyword\">return\u003C\u002Fspan> h},\u003Cspan class=\"hljs-attr\">unformat\u003C\u002Fspan>:\u003Cspan class=\"hljs-keyword\">function\u003C\u002Fspan>(\u003Cspan class=\"hljs-params\">t,e\u003C\u002Fspan>){\u003Cspan class=\"hljs-keyword\">const\u003C\u002Fspan> n=\u003Cspan class=\"hljs-title function_\">f\u003C\u002Fspan>(e),a=e&amp;&amp;e.\u003Cspan class=\"hljs-property\">decimalSeparator\u003C\u002Fspan>,r=t.\u003Cspan class=\"hljs-title function_\">replace\u003C\u002Fspan>(\u003Cspan class=\"hljs-regexp\">\u002F\\s\u002Fg\u003C\u002Fspan>,\u003Cspan class=\"hljs-string\">&quot;&quot;\u003C\u002Fspan>).\u003Cspan class=\"hljs-title function_\">match\u003C\u002Fspan>(\u003Cspan class=\"hljs-regexp\">\u002F[0-9]+|[^0-9]+\u002Fgi\u003C\u002Fspan>).\u003Cspan class=\"hljs-title function_\">map\u003C\u002Fspan>((\u003Cspan class=\"hljs-keyword\">function\u003C\u002Fspan>(\u003Cspan class=\"hljs-params\">t,e\u003C\u002Fspan>){\u003Cspan class=\"hljs-keyword\">return\u003C\u002Fspan>{\u003Cspan class=\"hljs-attr\">value\u003C\u002Fspan>:t,\u003Cspan class=\"hljs-attr\">isNumber\u003C\u002Fspan>:\u003Cspan class=\"hljs-regexp\">\u002F[0-9]+\u002F\u003C\u002Fspan>.\u003Cspan class=\"hljs-title function_\">test\u003C\u002Fspan>(t),\u003Cspan class=\"hljs-attr\">index\u003C\u002Fspan>:e}})),i=r.\u003Cspan class=\"hljs-title function_\">filter\u003C\u002Fspan>((\u003Cspan class=\"hljs-keyword\">function\u003C\u002Fspan>(\u003Cspan class=\"hljs-params\">t\u003C\u002Fspan>){\u003Cspan class=\"hljs-keyword\">return\u003C\u002Fspan> t.\u003Cspan class=\"hljs-property\">isNumber\u003C\u002Fspan>})),s=r.\u003Cspan class=\"hljs-title function_\">filter\u003C\u002Fspan>((\u003Cspan class=\"hljs-keyword\">function\u003C\u002Fspan>(\u003Cspan class=\"hljs-params\">t\u003C\u002Fspan>){\u003Cspan class=\"hljs-keyword\">return\u003C\u002Fspan>!t.\u003Cspan class=\"hljs-property\">isNumber\u003C\u002Fspan>})),o=i[\u003Cspan class=\"hljs-number\">0\u003C\u002Fspan>],c=i[i.\u003Cspan class=\"hljs-property\">length\u003C\u002Fspan>-\u003Cspan class=\"hljs-number\">1\u003C\u002Fspan>],u=o.\u003Cspan class=\"hljs-property\">value\u003C\u002Fspan>&gt;\u003Cspan class=\"hljs-number\">0\u003C\u002Fspan>?\u003Cspan class=\"hljs-attr\">o\u003C\u002Fspan>:i.\u003Cspan class=\"hljs-property\">length\u003C\u002Fspan>&gt;\u003Cspan class=\"hljs-number\">1\u003C\u002Fspan>&amp;&amp;i[\u003Cspan class=\"hljs-number\">1\u003C\u002Fspan>].\u003Cspan class=\"hljs-property\">value\u003C\u002Fspan>&gt;\u003Cspan class=\"hljs-number\">0\u003C\u002Fspan>?i[\u003Cspan class=\"hljs-number\">1\u003C\u002Fspan>]:\u003Cspan class=\"hljs-keyword\">void\u003C\u002Fspan> \u003Cspan class=\"hljs-number\">0\u003C\u002Fspan>;\u003Cspan class=\"hljs-keyword\">if\u003C\u002Fspan>(!u)\u003Cspan class=\"hljs-keyword\">return\u003C\u002Fspan> \u003Cspan class=\"hljs-number\">0\u003C\u002Fspan>;\u003Cspan class=\"hljs-keyword\">const\u003C\u002Fspan> d=u.\u003Cspan class=\"hljs-property\">index\u003C\u002Fspan>&gt;\u003Cspan class=\"hljs-number\">0\u003C\u002Fspan>?r[u.\u003Cspan class=\"hljs-property\">index\u003C\u002Fspan>-\u003Cspan class=\"hljs-number\">1\u003C\u002Fspan>]:\u003Cspan class=\"hljs-keyword\">void\u003C\u002Fspan> \u003Cspan class=\"hljs-number\">0\u003C\u002Fspan>,p=d&amp;&amp;\u003Cspan class=\"hljs-number\">1\u003C\u002Fspan>===s.\u003Cspan class=\"hljs-property\">length\u003C\u002Fspan>&amp;&amp;\u003Cspan class=\"hljs-title function_\">l\u003C\u002Fspan>(d.\u003Cspan class=\"hljs-property\">value\u003C\u002Fspan>),h=c.\u003Cspan class=\"hljs-property\">index\u003C\u002Fspan>-\u003Cspan class=\"hljs-number\">1\u003C\u002Fspan>,m=h&gt;=\u003Cspan class=\"hljs-number\">0\u003C\u002Fspan>&amp;&amp;r[h],g=s.\u003Cspan class=\"hljs-title function_\">filter\u003C\u002Fspan>((\u003Cspan class=\"hljs-keyword\">function\u003C\u002Fspan>(\u003Cspan class=\"hljs-params\">t\u003C\u002Fspan>){\u003Cspan class=\"hljs-keyword\">return\u003C\u002Fspan> t.\u003Cspan class=\"hljs-property\">index\u003C\u002Fspan>&gt;o.\u003Cspan class=\"hljs-property\">index\u003C\u002Fspan>&amp;&amp;t.\u003Cspan class=\"hljs-property\">index\u003C\u002Fspan>&lt;h})).\u003Cspan class=\"hljs-title function_\">map\u003C\u002Fspan>((\u003Cspan class=\"hljs-keyword\">function\u003C\u002Fspan>(\u003Cspan class=\"hljs-params\">t\u003C\u002Fspan>){\u003Cspan class=\"hljs-keyword\">return\u003C\u002Fspan> t.\u003Cspan class=\"hljs-property\">value\u003C\u002Fspan>})),_=g.\u003Cspan class=\"hljs-property\">length\u003C\u002Fspan>&gt;\u003Cspan class=\"hljs-number\">0\u003C\u002Fspan>&amp;&amp;g.\u003Cspan class=\"hljs-title function_\">indexOf\u003C\u002Fspan>(m.\u003Cspan class=\"hljs-property\">value\u003C\u002Fspan>)&lt;\u003Cspan class=\"hljs-number\">0\u003C\u002Fspan>,y=m&amp;&amp;m.\u003Cspan class=\"hljs-property\">value\u003C\u002Fspan>===a,v=c.\u003Cspan class=\"hljs-property\">value\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">length\u003C\u002Fspan>===n.\u003Cspan class=\"hljs-property\">decimalsDigits\u003C\u002Fspan>&amp;&amp;m&amp;&amp;\u003Cspan class=\"hljs-title function_\">l\u003C\u002Fspan>(m.\u003Cspan class=\"hljs-property\">value\u003C\u002Fspan>),x=(a?\u003Cspan class=\"hljs-attr\">y\u003C\u002Fspan>:v||y||p||_)?c.\u003Cspan class=\"hljs-property\">value\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">length\u003C\u002Fspan>:\u003Cspan class=\"hljs-number\">0\u003C\u002Fspan>,b=d&amp;&amp;d.\u003Cspan class=\"hljs-property\">value\u003C\u002Fspan>,j=b&amp;&amp;\u003Cspan class=\"hljs-string\">&quot;-&quot;\u003C\u002Fspan>===b[b.\u003Cspan class=\"hljs-property\">length\u003C\u002Fspan>-\u003Cspan class=\"hljs-number\">1\u003C\u002Fspan>],w=i.\u003Cspan class=\"hljs-title function_\">map\u003C\u002Fspan>((\u003Cspan class=\"hljs-keyword\">function\u003C\u002Fspan>(\u003Cspan class=\"hljs-params\">t\u003C\u002Fspan>){\u003Cspan class=\"hljs-keyword\">return\u003C\u002Fspan> t.\u003Cspan class=\"hljs-property\">value\u003C\u002Fspan>})).\u003Cspan class=\"hljs-title function_\">join\u003C\u002Fspan>(\u003Cspan class=\"hljs-string\">&quot;&quot;\u003C\u002Fspan>);\u003Cspan class=\"hljs-keyword\">return\u003C\u002Fspan> \u003Cspan class=\"hljs-built_in\">parseFloat\u003C\u002Fspan>(w\u002F\u003Cspan class=\"hljs-title class_\">Math\u003C\u002Fspan>.\u003Cspan class=\"hljs-title function_\">pow\u003C\u002Fspan>(\u003Cspan class=\"hljs-number\">10\u003C\u002Fspan>,x))*(j?-\u003Cspan class=\"hljs-number\">1\u003C\u002Fspan>:\u003Cspan class=\"hljs-number\">1\u003C\u002Fspan>)}}},{}]},{},[\u003Cspan class=\"hljs-number\">1\u003C\u002Fspan>])(\u003Cspan class=\"hljs-number\">1\u003C\u002Fspan>)}));\u003Cspan class=\"hljs-keyword\">var\u003C\u002Fspan> \u003Cspan class=\"hljs-variable constant_\">FC\u003C\u002Fspan>=\u003Cspan class=\"hljs-variable constant_\">FC\u003C\u002Fspan>||{};!\u003Cspan class=\"hljs-keyword\">function\u003C\u002Fspan>(\u003Cspan class=\"hljs-params\">t,e\u003C\u002Fspan>){\u003Cspan class=\"hljs-keyword\">var\u003C\u002Fspan> n={\u003Cspan class=\"hljs-attr\">version\u003C\u002Fspan>:\u003Cspan class=\"hljs-number\">.8\u003C\u002Fspan>},r=\u003Cspan class=\"hljs-regexp\">\u002F([{\\|])p([+\\-:])([\\d\\.]+)(?:\\D{3})?([\\|}])\u002F\u003C\u002Fspan>,i=\u003Cspan class=\"hljs-regexp\">\u002F^(\\d+):\u002F\u003C\u002Fspan>,s=!\u003Cspan class=\"hljs-number\">1\u003C\u002Fspan>,o={\u003Cspan class=\"hljs-attr\">base\u003C\u002Fspan>:\u003Cspan class=\"hljs-string\">&quot;USD&quot;\u003C\u002Fspan>,\u003Cspan class=\"hljs-attr\">sets\u003C\u002Fspan>:[],\u003Cspan class=\"hljs-attr\">max_rate_cache\u003C\u002Fspan>:\u003Cspan class=\"hljs-number\">12\u003C\u002Fspan>,\u003Cspan class=\"hljs-attr\">rounding\u003C\u002Fspan>:\u003Cspan class=\"hljs-string\">&quot;minimal&quot;\u003C\u002Fspan>,\u003Cspan class=\"hljs-attr\">convert_display_only\u003C\u002Fspan>:!\u003Cspan class=\"hljs-number\">1\u003C\u002Fspan>,\u003Cspan class=\"hljs-attr\">active_class\u003C\u002Fspan>:\u003Cspan class=\"hljs-string\">&quot;active&quot;\u003C\u002Fspan>,\u003Cspan class=\"hljs-attr\">use_openexchangerates\u003C\u002Fspan>:!\u003Cspan class=\"hljs-number\">1\u003C\u002Fspan>,\u003Cspan class=\"hljs-attr\">adjust_price_display\u003C\u002Fspan>:\u003Cspan class=\"hljs-literal\">null\u003C\u002Fspan>};\u003Cspan class=\"hljs-keyword\">function\u003C\u002Fspan> \u003Cspan class=\"hljs-title function_\">c\u003C\u002Fspan>(\u003Cspan class=\"hljs-params\">\u003C\u002Fspan>){\u003Cspan class=\"hljs-keyword\">for\u003C\u002Fspan>(\u003Cspan class=\"hljs-keyword\">var\u003C\u002Fspan> t=e.\u003Cspan class=\"hljs-property\">json\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">shipping_address\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">country\u003C\u002Fspan>,n=\u003Cspan class=\"hljs-string\">&quot;&quot;\u003C\u002Fspan>==e.\u003Cspan class=\"hljs-property\">json\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">template_set\u003C\u002Fspan>?\u003Cspan class=\"hljs-string\">&quot;DEFAULT&quot;\u003C\u002Fspan>:e.\u003Cspan class=\"hljs-property\">json\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">template_set\u003C\u002Fspan>,a=\u003Cspan class=\"hljs-string\">&quot;DEFAULT&quot;\u003C\u002Fspan>,r=\u003Cspan class=\"hljs-number\">0\u003C\u002Fspan>;r&lt;settings.\u003Cspan class=\"hljs-property\">sets\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">length\u003C\u002Fspan>;r++)settings.\u003Cspan class=\"hljs-property\">sets\u003C\u002Fspan>[r].\u003Cspan class=\"hljs-title function_\">hasOwnProperty\u003C\u002Fspan>(\u003Cspan class=\"hljs-string\">&quot;countries&quot;\u003C\u002Fspan>)&amp;&amp;settings.\u003Cspan class=\"hljs-property\">sets\u003C\u002Fspan>[r].\u003Cspan class=\"hljs-property\">countries\u003C\u002Fspan>.\u003Cspan class=\"hljs-title function_\">indexOf\u003C\u002Fspan>(t)&gt;-\u003Cspan class=\"hljs-number\">1\u003C\u002Fspan>&amp;&amp;(a=settings.\u003Cspan class=\"hljs-property\">sets\u003C\u002Fspan>[r].\u003Cspan class=\"hljs-property\">template_set\u003C\u002Fspan>);\u003Cspan class=\"hljs-title function_\">F\u003C\u002Fspan>()||(\u003Cspan class=\"hljs-title function_\">O\u003C\u002Fspan>(),a==n)?(\u003Cspan class=\"hljs-title function_\">m\u003C\u002Fspan>(),\u003Cspan class=\"hljs-title function_\">u\u003C\u002Fspan>()):\u003Cspan class=\"hljs-title function_\">h\u003C\u002Fspan>(a)}\u003Cspan class=\"hljs-keyword\">function\u003C\u002Fspan> \u003Cspan class=\"hljs-title function_\">u\u003C\u002Fspan>(\u003Cspan class=\"hljs-params\">n\u003C\u002Fspan>){\u003Cspan class=\"hljs-keyword\">var\u003C\u002Fspan> a=settings.\u003Cspan class=\"hljs-property\">sets\u003C\u002Fspan>.\u003Cspan class=\"hljs-title function_\">map\u003C\u002Fspan>((\u003Cspan class=\"hljs-keyword\">function\u003C\u002Fspan>(\u003Cspan class=\"hljs-params\">t,e\u003C\u002Fspan>){\u003Cspan class=\"hljs-keyword\">return\u003C\u002Fspan> t.\u003Cspan class=\"hljs-property\">currency\u003C\u002Fspan>})).\u003Cspan class=\"hljs-title function_\">filter\u003C\u002Fspan>((\u003Cspan class=\"hljs-keyword\">function\u003C\u002Fspan>(\u003Cspan class=\"hljs-params\">t,e,n\u003C\u002Fspan>){\u003Cspan class=\"hljs-keyword\">return\u003C\u002Fspan> n.\u003Cspan class=\"hljs-title function_\">indexOf\u003C\u002Fspan>(t)===e})),r=(n=\u003Cspan class=\"hljs-keyword\">void\u003C\u002Fspan> \u003Cspan class=\"hljs-number\">0\u003C\u002Fspan>!==n&amp;&amp;n,\u003Cspan class=\"hljs-title function_\">F\u003C\u002Fspan>());r.\u003Cspan class=\"hljs-title function_\">hasOwnProperty\u003C\u002Fspan>(\u003Cspan class=\"hljs-string\">&quot;rates&quot;\u003C\u002Fspan>)&amp;&amp;(\u003Cspan class=\"hljs-title class_\">Date\u003C\u002Fspan>.\u003Cspan class=\"hljs-title function_\">now\u003C\u002Fspan>()-r.\u003Cspan class=\"hljs-property\">rates\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">timestamp\u003C\u002Fspan>)\u002F\u003Cspan class=\"hljs-number\">60\u003C\u002Fspan>&lt;\u003Cspan class=\"hljs-number\">36e4\u003C\u002Fspan>*\u003Cspan class=\"hljs-built_in\">parseFloat\u003C\u002Fspan>(settings.\u003Cspan class=\"hljs-property\">max_rate_cache\u003C\u002Fspan>)&amp;&amp;(n||r.\u003Cspan class=\"hljs-property\">fcsid\u003C\u002Fspan>==e.\u003Cspan class=\"hljs-property\">json\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">session_id\u003C\u002Fspan>)?(fx.\u003Cspan class=\"hljs-property\">rates\u003C\u002Fspan>=r.\u003Cspan class=\"hljs-property\">rates\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">rates\u003C\u002Fspan>,fx.\u003Cspan class=\"hljs-property\">base\u003C\u002Fspan>=r.\u003Cspan class=\"hljs-property\">rates\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">base\u003C\u002Fspan>,\u003Cspan class=\"hljs-title function_\">d\u003C\u002Fspan>()):n||(settings.\u003Cspan class=\"hljs-property\">use_openexchangerates\u003C\u002Fspan>?t.\u003Cspan class=\"hljs-title function_\">getJSON\u003C\u002Fspan>(\u003Cspan class=\"hljs-string\">&quot;https:\u002F\u002Fopenexchangerates.org\u002Fapi\u002Flatest.json?app_id=&quot;\u003C\u002Fspan>+settings.\u003Cspan class=\"hljs-property\">use_openexchangerates\u003C\u002Fspan>+\u003Cspan class=\"hljs-string\">&quot;&amp;prettyprint=false&amp;symbols=&quot;\u003C\u002Fspan>+a.\u003Cspan class=\"hljs-title function_\">join\u003C\u002Fspan>(\u003Cspan class=\"hljs-string\">&quot;,&quot;\u003C\u002Fspan>),(\u003Cspan class=\"hljs-keyword\">function\u003C\u002Fspan>(\u003Cspan class=\"hljs-params\">t\u003C\u002Fspan>){\u003Cspan class=\"hljs-title function_\">l\u003C\u002Fspan>(t.\u003Cspan class=\"hljs-property\">rates\u003C\u002Fspan>,t.\u003Cspan class=\"hljs-property\">base\u003C\u002Fspan>),\u003Cspan class=\"hljs-title function_\">d\u003C\u002Fspan>()})):t.\u003Cspan class=\"hljs-title function_\">getJSON\u003C\u002Fspan>(\u003Cspan class=\"hljs-string\">&quot;https:\u002F\u002Fwww.floatrates.com\u002Fdaily\u002F&quot;\u003C\u002Fspan>+settings.\u003Cspan class=\"hljs-property\">base\u003C\u002Fspan>+\u003Cspan class=\"hljs-string\">&quot;.json&quot;\u003C\u002Fspan>,(\u003Cspan class=\"hljs-keyword\">function\u003C\u002Fspan>(\u003Cspan class=\"hljs-params\">t\u003C\u002Fspan>){\u003Cspan class=\"hljs-keyword\">for\u003C\u002Fspan>(\u003Cspan class=\"hljs-keyword\">var\u003C\u002Fspan> e={},n=\u003Cspan class=\"hljs-number\">0\u003C\u002Fspan>;n&lt;a.\u003Cspan class=\"hljs-property\">length\u003C\u002Fspan>;n++)(t.\u003Cspan class=\"hljs-title function_\">hasOwnProperty\u003C\u002Fspan>(a[n].\u003Cspan class=\"hljs-title function_\">toLowerCase\u003C\u002Fspan>())||a[n]==settings.\u003Cspan class=\"hljs-property\">base\u003C\u002Fspan>)&amp;&amp;(e[a[n]]=a[n]==settings.\u003Cspan class=\"hljs-property\">base\u003C\u002Fspan>?\u003Cspan class=\"hljs-number\">1\u003C\u002Fspan>:t[a[n].\u003Cspan class=\"hljs-title function_\">toLowerCase\u003C\u002Fspan>()].\u003Cspan class=\"hljs-property\">rate\u003C\u002Fspan>);\u003Cspan class=\"hljs-title function_\">l\u003C\u002Fspan>(e,settings.\u003Cspan class=\"hljs-property\">base\u003C\u002Fspan>),\u003Cspan class=\"hljs-title function_\">d\u003C\u002Fspan>()})))}\u003Cspan class=\"hljs-keyword\">function\u003C\u002Fspan> \u003Cspan class=\"hljs-title function_\">l\u003C\u002Fspan>(\u003Cspan class=\"hljs-params\">t,e\u003C\u002Fspan>){fx.\u003Cspan class=\"hljs-property\">rates\u003C\u002Fspan>=t,fx.\u003Cspan class=\"hljs-property\">base\u003C\u002Fspan>=e,\u003Cspan class=\"hljs-title function_\">O\u003C\u002Fspan>({\u003Cspan class=\"hljs-attr\">rates\u003C\u002Fspan>:t,\u003Cspan class=\"hljs-attr\">base\u003C\u002Fspan>:e,\u003Cspan class=\"hljs-attr\">timestamp\u003C\u002Fspan>:\u003Cspan class=\"hljs-title class_\">Date\u003C\u002Fspan>.\u003Cspan class=\"hljs-title function_\">now\u003C\u002Fspan>()})}\u003Cspan class=\"hljs-keyword\">function\u003C\u002Fspan> \u003Cspan class=\"hljs-title function_\">d\u003C\u002Fspan>(\u003Cspan class=\"hljs-params\">\u003C\u002Fspan>){\u003Cspan class=\"hljs-keyword\">var\u003C\u002Fspan> n=\u003Cspan class=\"hljs-title function_\">F\u003C\u002Fspan>();\u003Cspan class=\"hljs-keyword\">if\u003C\u002Fspan>(!n)\u003Cspan class=\"hljs-keyword\">return\u003C\u002Fspan> \u003Cspan class=\"hljs-variable language_\">console\u003C\u002Fspan>.\u003Cspan class=\"hljs-title function_\">log\u003C\u002Fspan>(\u003Cspan class=\"hljs-string\">&quot;FC.currency: Unable to find locale information&quot;\u003C\u002Fspan>),!\u003Cspan class=\"hljs-number\">1\u003C\u002Fspan>;\u003Cspan class=\"hljs-keyword\">var\u003C\u002Fspan> a=\u003Cspan class=\"hljs-title function_\">D\u003C\u002Fspan>(),i=e.\u003Cspan class=\"hljs-property\">json\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">item_count\u003C\u002Fspan>&gt;\u003Cspan class=\"hljs-number\">0\u003C\u002Fspan>?e.\u003Cspan class=\"hljs-property\">json\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">locale_info\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">int_curr_symbol\u003C\u002Fspan>.\u003Cspan class=\"hljs-title function_\">trim\u003C\u002Fspan>():n.\u003Cspan class=\"hljs-property\">locale\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">int_curr_symbol\u003C\u002Fspan>.\u003Cspan class=\"hljs-title function_\">trim\u003C\u002Fspan>(),s=e.\u003Cspan class=\"hljs-property\">json\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">item_count\u003C\u002Fspan>&gt;\u003Cspan class=\"hljs-number\">0\u003C\u002Fspan>?e.\u003Cspan class=\"hljs-property\">json\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">locale_info\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">mon_decimal_point\u003C\u002Fspan>:n.\u003Cspan class=\"hljs-property\">locale\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">mon_decimal_point\u003C\u002Fspan>;\u003Cspan class=\"hljs-title function_\">t\u003C\u002Fspan>(\u003Cspan class=\"hljs-string\">&quot;.fc-currency-price&quot;\u003C\u002Fspan>).\u003Cspan class=\"hljs-title function_\">each\u003C\u002Fspan>((\u003Cspan class=\"hljs-keyword\">function\u003C\u002Fspan>(\u003Cspan class=\"hljs-params\">\u003C\u002Fspan>){\u003Cspan class=\"hljs-keyword\">var\u003C\u002Fspan> a,r=settings.\u003Cspan class=\"hljs-property\">base\u003C\u002Fspan>;\u003Cspan class=\"hljs-title function_\">t\u003C\u002Fspan>(\u003Cspan class=\"hljs-variable language_\">this\u003C\u002Fspan>).\u003Cspan class=\"hljs-title function_\">data\u003C\u002Fspan>(\u003Cspan class=\"hljs-string\">&quot;fc-currency&quot;\u003C\u002Fspan>)&amp;&amp;(r=\u003Cspan class=\"hljs-title function_\">t\u003C\u002Fspan>(\u003Cspan class=\"hljs-variable language_\">this\u003C\u002Fspan>).\u003Cspan class=\"hljs-title function_\">data\u003C\u002Fspan>(\u003Cspan class=\"hljs-string\">&quot;fc-currency&quot;\u003C\u002Fspan>),a=s);\u003Cspan class=\"hljs-keyword\">var\u003C\u002Fspan> o=\u003Cspan class=\"hljs-title function_\">S\u003C\u002Fspan>(\u003Cspan class=\"hljs-title function_\">t\u003C\u002Fspan>(\u003Cspan class=\"hljs-variable language_\">this\u003C\u002Fspan>).\u003Cspan class=\"hljs-title function_\">html\u003C\u002Fspan>(),a),c=o;r!=i&amp;&amp;(c=\u003Cspan class=\"hljs-title function_\">g\u003C\u002Fspan>(c=fx.\u003Cspan class=\"hljs-title function_\">convert\u003C\u002Fspan>(o,{\u003Cspan class=\"hljs-attr\">from\u003C\u002Fspan>:r,\u003Cspan class=\"hljs-attr\">to\u003C\u002Fspan>:i}))),\u003Cspan class=\"hljs-title function_\">t\u003C\u002Fspan>(\u003Cspan class=\"hljs-variable language_\">this\u003C\u002Fspan>).\u003Cspan class=\"hljs-title function_\">html\u003C\u002Fspan>(e.\u003Cspan class=\"hljs-property\">util\u003C\u002Fspan>.\u003Cspan class=\"hljs-title function_\">money_format\u003C\u002Fspan>(n.\u003Cspan class=\"hljs-property\">currency_format\u003C\u002Fspan>,\u003Cspan class=\"hljs-title function_\">_\u003C\u002Fspan>(c)).\u003Cspan class=\"hljs-title function_\">trim\u003C\u002Fspan>()).\u003Cspan class=\"hljs-title function_\">data\u003C\u002Fspan>(\u003Cspan class=\"hljs-string\">&quot;fc-currency&quot;\u003C\u002Fspan>,i).\u003Cspan class=\"hljs-title function_\">show\u003C\u002Fspan>()})),\u003Cspan class=\"hljs-title function_\">t\u003C\u002Fspan>(\u003Cspan class=\"hljs-string\">&#x27;form[action*=&quot;&#x27;\u003C\u002Fspan>+a+\u003Cspan class=\"hljs-string\">&#x27;&quot;]&#x27;\u003C\u002Fspan>).\u003Cspan class=\"hljs-title function_\">each\u003C\u002Fspan>((\u003Cspan class=\"hljs-keyword\">function\u003C\u002Fspan>(\u003Cspan class=\"hljs-params\">\u003C\u002Fspan>){\u003Cspan class=\"hljs-keyword\">var\u003C\u002Fspan> e=\u003Cspan class=\"hljs-title function_\">t\u003C\u002Fspan>(\u003Cspan class=\"hljs-variable language_\">this\u003C\u002Fspan>).\u003Cspan class=\"hljs-title function_\">find\u003C\u002Fspan>(\u003Cspan class=\"hljs-string\">&#x27;[name=&quot;price&quot;], [name$=&quot;:price&quot;]&#x27;\u003C\u002Fspan>);\u003Cspan class=\"hljs-keyword\">if\u003C\u002Fspan>(\u003Cspan class=\"hljs-number\">0\u003C\u002Fspan>==e.\u003Cspan class=\"hljs-property\">length\u003C\u002Fspan>)\u003Cspan class=\"hljs-keyword\">return\u003C\u002Fspan>!\u003Cspan class=\"hljs-number\">1\u003C\u002Fspan>;\u003Cspan class=\"hljs-keyword\">var\u003C\u002Fspan> n=settings.\u003Cspan class=\"hljs-property\">base\u003C\u002Fspan>;\u003Cspan class=\"hljs-keyword\">if\u003C\u002Fspan>(\u003Cspan class=\"hljs-title function_\">t\u003C\u002Fspan>(\u003Cspan class=\"hljs-variable language_\">this\u003C\u002Fspan>).\u003Cspan class=\"hljs-title function_\">data\u003C\u002Fspan>(\u003Cspan class=\"hljs-string\">&quot;fc-currency&quot;\u003C\u002Fspan>))n=\u003Cspan class=\"hljs-title function_\">t\u003C\u002Fspan>(\u003Cspan class=\"hljs-variable language_\">this\u003C\u002Fspan>).\u003Cspan class=\"hljs-title function_\">data\u003C\u002Fspan>(\u003Cspan class=\"hljs-string\">&quot;fc-currency&quot;\u003C\u002Fspan>);\u003Cspan class=\"hljs-keyword\">else\u003C\u002Fspan>{\u003Cspan class=\"hljs-keyword\">var\u003C\u002Fspan> a=\u003Cspan class=\"hljs-regexp\">\u002F([\\d\\.]+)([A-Z]{3})$\u002Fi\u003C\u002Fspan>,s=e.\u003Cspan class=\"hljs-title function_\">first\u003C\u002Fspan>().\u003Cspan class=\"hljs-title function_\">val\u003C\u002Fspan>().\u003Cspan class=\"hljs-title function_\">replace\u003C\u002Fspan>(\u003Cspan class=\"hljs-string\">&quot; &quot;\u003C\u002Fspan>,\u003Cspan class=\"hljs-string\">&quot;&quot;\u003C\u002Fspan>);s.\u003Cspan class=\"hljs-title function_\">match\u003C\u002Fspan>(a);a.\u003Cspan class=\"hljs-title function_\">test\u003C\u002Fspan>(s)&amp;&amp;(n=a.\u003Cspan class=\"hljs-title function_\">exec\u003C\u002Fspan>(s)[\u003Cspan class=\"hljs-number\">2\u003C\u002Fspan>].\u003Cspan class=\"hljs-title function_\">toUpperCase\u003C\u002Fspan>())}n!=i&amp;&amp;(\u003Cspan class=\"hljs-title function_\">t\u003C\u002Fspan>(\u003Cspan class=\"hljs-variable language_\">this\u003C\u002Fspan>).\u003Cspan class=\"hljs-title function_\">find\u003C\u002Fspan>(\u003Cspan class=\"hljs-string\">&quot;[value*=&#x27;{p&#x27;], [value*=&#x27;|p&#x27;]&quot;\u003C\u002Fspan>).\u003Cspan class=\"hljs-title function_\">each\u003C\u002Fspan>((\u003Cspan class=\"hljs-keyword\">function\u003C\u002Fspan>(\u003Cspan class=\"hljs-params\">\u003C\u002Fspan>){\u003Cspan class=\"hljs-keyword\">var\u003C\u002Fspan> t=\u003Cspan class=\"hljs-variable language_\">this\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">value\u003C\u002Fspan>.\u003Cspan class=\"hljs-title function_\">match\u003C\u002Fspan>(r);\u003Cspan class=\"hljs-keyword\">if\u003C\u002Fspan>(t){\u003Cspan class=\"hljs-keyword\">var\u003C\u002Fspan> e=fx.\u003Cspan class=\"hljs-title function_\">convert\u003C\u002Fspan>(\u003Cspan class=\"hljs-built_in\">parseFloat\u003C\u002Fspan>(t[\u003Cspan class=\"hljs-number\">3\u003C\u002Fspan>]),{\u003Cspan class=\"hljs-attr\">from\u003C\u002Fspan>:n,\u003Cspan class=\"hljs-attr\">to\u003C\u002Fspan>:i});e=\u003Cspan class=\"hljs-title function_\">g\u003C\u002Fspan>(e),settings.\u003Cspan class=\"hljs-property\">convert_display_only\u003C\u002Fspan>||(\u003Cspan class=\"hljs-variable language_\">this\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">value\u003C\u002Fspan>=\u003Cspan class=\"hljs-variable language_\">this\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">value\u003C\u002Fspan>.\u003Cspan class=\"hljs-title function_\">replace\u003C\u002Fspan>(r,\u003Cspan class=\"hljs-string\">&quot;$1p$2&quot;\u003C\u002Fspan>+e.\u003Cspan class=\"hljs-title function_\">toFixed\u003C\u002Fspan>(\u003Cspan class=\"hljs-number\">2\u003C\u002Fspan>)+i.\u003Cspan class=\"hljs-title function_\">toLowerCase\u003C\u002Fspan>()+\u003Cspan class=\"hljs-string\">&quot;$4&quot;\u003C\u002Fspan>))}})),e.\u003Cspan class=\"hljs-title function_\">each\u003C\u002Fspan>((\u003Cspan class=\"hljs-keyword\">function\u003C\u002Fspan>(\u003Cspan class=\"hljs-params\">\u003C\u002Fspan>){\u003Cspan class=\"hljs-keyword\">var\u003C\u002Fspan> t=\u003Cspan class=\"hljs-title function_\">S\u003C\u002Fspan>(\u003Cspan class=\"hljs-variable language_\">this\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">value\u003C\u002Fspan>),e=fx.\u003Cspan class=\"hljs-title function_\">convert\u003C\u002Fspan>(t,{\u003Cspan class=\"hljs-attr\">from\u003C\u002Fspan>:n,\u003Cspan class=\"hljs-attr\">to\u003C\u002Fspan>:i});e=\u003Cspan class=\"hljs-title function_\">g\u003C\u002Fspan>(e),settings.\u003Cspan class=\"hljs-property\">convert_display_only\u003C\u002Fspan>||(\u003Cspan class=\"hljs-variable language_\">this\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">value\u003C\u002Fspan>=e.\u003Cspan class=\"hljs-title function_\">toFixed\u003C\u002Fspan>(\u003Cspan class=\"hljs-number\">2\u003C\u002Fspan>)+i.\u003Cspan class=\"hljs-title function_\">toLowerCase\u003C\u002Fspan>())})),\u003Cspan class=\"hljs-title function_\">t\u003C\u002Fspan>(\u003Cspan class=\"hljs-variable language_\">this\u003C\u002Fspan>).\u003Cspan class=\"hljs-title function_\">data\u003C\u002Fspan>(\u003Cspan class=\"hljs-string\">&quot;fc-currency&quot;\u003C\u002Fspan>,i)),\u003Cspan class=\"hljs-title function_\">y\u003C\u002Fspan>()}))}\u003Cspan class=\"hljs-keyword\">function\u003C\u002Fspan> \u003Cspan class=\"hljs-title function_\">h\u003C\u002Fspan>(\u003Cspan class=\"hljs-params\">t\u003C\u002Fspan>){e.\u003Cspan class=\"hljs-property\">client\u003C\u002Fspan>.\u003Cspan class=\"hljs-title function_\">request\u003C\u002Fspan>(\u003Cspan class=\"hljs-string\">&quot;https:\u002F\u002F&quot;\u003C\u002Fspan>+e.\u003Cspan class=\"hljs-property\">json\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">config\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">store_domain\u003C\u002Fspan>+\u003Cspan class=\"hljs-string\">&quot;\u002Fcart?template_set=&quot;\u003C\u002Fspan>+t).\u003Cspan class=\"hljs-title function_\">done\u003C\u002Fspan>((\u003Cspan class=\"hljs-keyword\">function\u003C\u002Fspan>(\u003Cspan class=\"hljs-params\">\u003C\u002Fspan>){\u003Cspan class=\"hljs-title function_\">O\u003C\u002Fspan>(),\u003Cspan class=\"hljs-title function_\">c\u003C\u002Fspan>()}))}\u003Cspan class=\"hljs-keyword\">function\u003C\u002Fspan> \u003Cspan class=\"hljs-title function_\">m\u003C\u002Fspan>(\u003Cspan class=\"hljs-params\">\u003C\u002Fspan>){\u003Cspan class=\"hljs-keyword\">for\u003C\u002Fspan>(\u003Cspan class=\"hljs-keyword\">var\u003C\u002Fspan> n=\u003Cspan class=\"hljs-title function_\">F\u003C\u002Fspan>(),a=!\u003Cspan class=\"hljs-number\">1\u003C\u002Fspan>,r=e.\u003Cspan class=\"hljs-property\">json\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">item_count\u003C\u002Fspan>&gt;\u003Cspan class=\"hljs-number\">0\u003C\u002Fspan>?\u003Cspan class=\"hljs-string\">&quot;&quot;\u003C\u002Fspan>==e.\u003Cspan class=\"hljs-property\">json\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">template_set\u003C\u002Fspan>?\u003Cspan class=\"hljs-string\">&quot;DEFAULT&quot;\u003C\u002Fspan>:e.\u003Cspan class=\"hljs-property\">json\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">template_set\u003C\u002Fspan>:n.\u003Cspan class=\"hljs-property\">template_set\u003C\u002Fspan>,i=\u003Cspan class=\"hljs-number\">0\u003C\u002Fspan>;i&lt;settings.\u003Cspan class=\"hljs-property\">sets\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">length\u003C\u002Fspan>;i++)settings.\u003Cspan class=\"hljs-property\">sets\u003C\u002Fspan>[i].\u003Cspan class=\"hljs-property\">template_set\u003C\u002Fspan>==r&amp;&amp;(a=r);a&amp;&amp;(\u003Cspan class=\"hljs-title function_\">t\u003C\u002Fspan>(\u003Cspan class=\"hljs-string\">&quot;[data-fc-template-set].&quot;\u003C\u002Fspan>+settings.\u003Cspan class=\"hljs-property\">active_class\u003C\u002Fspan>).\u003Cspan class=\"hljs-title function_\">removeClass\u003C\u002Fspan>(settings.\u003Cspan class=\"hljs-property\">active_class\u003C\u002Fspan>),\u003Cspan class=\"hljs-title function_\">t\u003C\u002Fspan>(\u003Cspan class=\"hljs-string\">&#x27;[data-fc-template-set=&quot;&#x27;\u003C\u002Fspan>+a+\u003Cspan class=\"hljs-string\">&#x27;&quot;]&#x27;\u003C\u002Fspan>).\u003Cspan class=\"hljs-title function_\">addClass\u003C\u002Fspan>(settings.\u003Cspan class=\"hljs-property\">active_class\u003C\u002Fspan>))}\u003Cspan class=\"hljs-keyword\">function\u003C\u002Fspan> \u003Cspan class=\"hljs-title function_\">g\u003C\u002Fspan>(\u003Cspan class=\"hljs-params\">t\u003C\u002Fspan>){\u003Cspan class=\"hljs-keyword\">var\u003C\u002Fspan> e=[\u003Cspan class=\"hljs-string\">&quot;full&quot;\u003C\u002Fspan>,\u003Cspan class=\"hljs-string\">&quot;half&quot;\u003C\u002Fspan>,\u003Cspan class=\"hljs-string\">&quot;minimal&quot;\u003C\u002Fspan>,\u003Cspan class=\"hljs-string\">&quot;none&quot;\u003C\u002Fspan>,!\u003Cspan class=\"hljs-number\">1\u003C\u002Fspan>].\u003Cspan class=\"hljs-title function_\">indexOf\u003C\u002Fspan>(settings.\u003Cspan class=\"hljs-property\">rounding\u003C\u002Fspan>)&gt;-\u003Cspan class=\"hljs-number\">1\u003C\u002Fspan>?settings.\u003Cspan class=\"hljs-property\">rounding\u003C\u002Fspan>:o.\u003Cspan class=\"hljs-property\">rounding\u003C\u002Fspan>;\u003Cspan class=\"hljs-keyword\">if\u003C\u002Fspan>(\u003Cspan class=\"hljs-string\">&quot;full&quot;\u003C\u002Fspan>==e)\u003Cspan class=\"hljs-keyword\">return\u003C\u002Fspan> \u003Cspan class=\"hljs-title class_\">Math\u003C\u002Fspan>.\u003Cspan class=\"hljs-title function_\">ceil\u003C\u002Fspan>(t);\u003Cspan class=\"hljs-keyword\">if\u003C\u002Fspan>(\u003Cspan class=\"hljs-string\">&quot;half&quot;\u003C\u002Fspan>==e){\u003Cspan class=\"hljs-keyword\">var\u003C\u002Fspan> n=t%\u003Cspan class=\"hljs-number\">1\u003C\u002Fspan>;\u003Cspan class=\"hljs-keyword\">return\u003C\u002Fspan> \u003Cspan class=\"hljs-title class_\">Math\u003C\u002Fspan>.\u003Cspan class=\"hljs-title function_\">floor\u003C\u002Fspan>(t)+(\u003Cspan class=\"hljs-number\">0\u003C\u002Fspan>==n?\u003Cspan class=\"hljs-number\">0\u003C\u002Fspan>:n&lt;=\u003Cspan class=\"hljs-number\">.5\u003C\u002Fspan>?\u003Cspan class=\"hljs-number\">.5\u003C\u002Fspan>:\u003Cspan class=\"hljs-number\">1\u003C\u002Fspan>)}\u003Cspan class=\"hljs-keyword\">return\u003C\u002Fspan>\u003Cspan class=\"hljs-string\">&quot;minimal&quot;\u003C\u002Fspan>==e?\u003Cspan class=\"hljs-title class_\">Math\u003C\u002Fspan>.\u003Cspan class=\"hljs-title function_\">ceil\u003C\u002Fspan>(\u003Cspan class=\"hljs-number\">20\u003C\u002Fspan>*t)\u002F\u003Cspan class=\"hljs-number\">20\u003C\u002Fspan>:t}\u003Cspan class=\"hljs-keyword\">function\u003C\u002Fspan> \u003Cspan class=\"hljs-title function_\">_\u003C\u002Fspan>(\u003Cspan class=\"hljs-params\">t\u003C\u002Fspan>){\u003Cspan class=\"hljs-keyword\">return\u003C\u002Fspan>\u003Cspan class=\"hljs-string\">&quot;function&quot;\u003C\u002Fspan>==\u003Cspan class=\"hljs-keyword\">typeof\u003C\u002Fspan> settings.\u003Cspan class=\"hljs-property\">adjust_price_display\u003C\u002Fspan>&amp;&amp;(adjusted_price=settings.\u003Cspan class=\"hljs-title function_\">adjust_price_display\u003C\u002Fspan>(t),\u003Cspan class=\"hljs-keyword\">void\u003C\u002Fspan> \u003Cspan class=\"hljs-number\">0\u003C\u002Fspan>!==adjusted_price)?\u003Cspan class=\"hljs-built_in\">parseFloat\u003C\u002Fspan>(adjusted_price):t}\u003Cspan class=\"hljs-keyword\">function\u003C\u002Fspan> \u003Cspan class=\"hljs-title function_\">y\u003C\u002Fspan>(\u003Cspan class=\"hljs-params\">\u003C\u002Fspan>){\u003Cspan class=\"hljs-variable constant_\">ADJUST\u003C\u002Fspan>={},\u003Cspan class=\"hljs-title function_\">t\u003C\u002Fspan>(\u003Cspan class=\"hljs-string\">&quot;input,select&quot;\u003C\u002Fspan>).\u003Cspan class=\"hljs-title function_\">off\u003C\u002Fspan>(\u003Cspan class=\"hljs-string\">&quot;change.foxy-dynamic-price&quot;\u003C\u002Fspan>),\u003Cspan class=\"hljs-title function_\">t\u003C\u002Fspan>(\u003Cspan class=\"hljs-string\">&#x27;form[action*=&quot;&#x27;\u003C\u002Fspan>+\u003Cspan class=\"hljs-title function_\">D\u003C\u002Fspan>()+\u003Cspan class=\"hljs-string\">&#x27;&quot;]&#x27;\u003C\u002Fspan>).\u003Cspan class=\"hljs-title function_\">each\u003C\u002Fspan>((\u003Cspan class=\"hljs-keyword\">function\u003C\u002Fspan>(\u003Cspan class=\"hljs-params\">\u003C\u002Fspan>){\u003Cspan class=\"hljs-keyword\">var\u003C\u002Fspan> e=\u003Cspan class=\"hljs-title function_\">t\u003C\u002Fspan>(\u003Cspan class=\"hljs-variable language_\">this\u003C\u002Fspan>),n=\u003Cspan class=\"hljs-string\">&quot;&quot;\u003C\u002Fspan>,a={\u003Cspan class=\"hljs-attr\">products\u003C\u002Fspan>:{}};\u003Cspan class=\"hljs-title function_\">t\u003C\u002Fspan>(\u003Cspan class=\"hljs-variable language_\">this\u003C\u002Fspan>).\u003Cspan class=\"hljs-title function_\">find\u003C\u002Fspan>(\u003Cspan class=\"hljs-string\">&quot;[name=&#x27;name&#x27;],[name^=&#x27;name||&#x27;],[name$=&#x27;:name&#x27;],[name*=&#x27;:name||&#x27;]&quot;\u003C\u002Fspan>).\u003Cspan class=\"hljs-title function_\">each\u003C\u002Fspan>((\u003Cspan class=\"hljs-keyword\">function\u003C\u002Fspan>(\u003Cspan class=\"hljs-params\">\u003C\u002Fspan>){\u003Cspan class=\"hljs-keyword\">var\u003C\u002Fspan> t=\u003Cspan class=\"hljs-title function_\">b\u003C\u002Fspan>(\u003Cspan class=\"hljs-variable language_\">this\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">name\u003C\u002Fspan>),r=t?t+\u003Cspan class=\"hljs-string\">&quot;:&quot;\u003C\u002Fspan>:\u003Cspan class=\"hljs-string\">&quot;&quot;\u003C\u002Fspan>,i=\u003Cspan class=\"hljs-title function_\">S\u003C\u002Fspan>(e.\u003Cspan class=\"hljs-title function_\">find\u003C\u002Fspan>(\u003Cspan class=\"hljs-string\">&quot;[name=&#x27;&quot;\u003C\u002Fspan>+r+\u003Cspan class=\"hljs-string\">&quot;price&#x27;],[name^=&#x27;&quot;\u003C\u002Fspan>+r+\u003Cspan class=\"hljs-string\">&quot;price||&#x27;]&quot;\u003C\u002Fspan>).\u003Cspan class=\"hljs-title function_\">first\u003C\u002Fspan>().\u003Cspan class=\"hljs-title function_\">val\u003C\u002Fspan>()),s={\u003Cspan class=\"hljs-attr\">id\u003C\u002Fspan>:t,\u003Cspan class=\"hljs-attr\">code\u003C\u002Fspan>:\u003Cspan class=\"hljs-string\">&quot;&quot;\u003C\u002Fspan>,\u003Cspan class=\"hljs-attr\">base_price\u003C\u002Fspan>:i||\u003Cspan class=\"hljs-number\">0\u003C\u002Fspan>,\u003Cspan class=\"hljs-attr\">quantity\u003C\u002Fspan>:\u003Cspan class=\"hljs-number\">1\u003C\u002Fspan>,\u003Cspan class=\"hljs-attr\">attributes\u003C\u002Fspan>:{},\u003Cspan class=\"hljs-attr\">has_quantity\u003C\u002Fspan>:!\u003Cspan class=\"hljs-number\">1\u003C\u002Fspan>},o=e.\u003Cspan class=\"hljs-title function_\">find\u003C\u002Fspan>(\u003Cspan class=\"hljs-string\">&quot;[name=&#x27;&quot;\u003C\u002Fspan>+r+\u003Cspan class=\"hljs-string\">&quot;quantity&#x27;],[name^=&#x27;&quot;\u003C\u002Fspan>+r+\u003Cspan class=\"hljs-string\">&quot;quantity||&#x27;]&quot;\u003C\u002Fspan>),c=e.\u003Cspan class=\"hljs-title function_\">find\u003C\u002Fspan>(\u003Cspan class=\"hljs-string\">&quot;[name=&#x27;&quot;\u003C\u002Fspan>+r+\u003Cspan class=\"hljs-string\">&quot;code&#x27;],[name^=&#x27;&quot;\u003C\u002Fspan>+r+\u003Cspan class=\"hljs-string\">&quot;code||&#x27;]&quot;\u003C\u002Fspan>);\u003Cspan class=\"hljs-keyword\">if\u003C\u002Fspan>(c.\u003Cspan class=\"hljs-property\">length\u003C\u002Fspan>&gt;\u003Cspan class=\"hljs-number\">0\u003C\u002Fspan>&amp;&amp;(s.\u003Cspan class=\"hljs-property\">code\u003C\u002Fspan>=\u003Cspan class=\"hljs-title function_\">v\u003C\u002Fspan>(c.\u003Cspan class=\"hljs-title function_\">first\u003C\u002Fspan>().\u003Cspan class=\"hljs-title function_\">val\u003C\u002Fspan>()),\u003Cspan class=\"hljs-string\">&quot;&quot;\u003C\u002Fspan>===n&amp;&amp;(n=s.\u003Cspan class=\"hljs-property\">code\u003C\u002Fspan>)),o.\u003Cspan class=\"hljs-property\">length\u003C\u002Fspan>&gt;\u003Cspan class=\"hljs-number\">0\u003C\u002Fspan>){\u003Cspan class=\"hljs-keyword\">var\u003C\u002Fspan> u=\u003Cspan class=\"hljs-number\">0\u003C\u002Fspan>,f=\u003Cspan class=\"hljs-title function_\">j\u003C\u002Fspan>(o);[\u003Cspan class=\"hljs-string\">&quot;select&quot;\u003C\u002Fspan>,\u003Cspan class=\"hljs-string\">&quot;text&quot;\u003C\u002Fspan>,\u003Cspan class=\"hljs-string\">&quot;hidden&quot;\u003C\u002Fspan>].\u003Cspan class=\"hljs-title function_\">indexOf\u003C\u002Fspan>(f)&gt;-\u003Cspan class=\"hljs-number\">1\u003C\u002Fspan>?(s.\u003Cspan class=\"hljs-property\">has_quantity\u003C\u002Fspan>=!\u003Cspan class=\"hljs-number\">0\u003C\u002Fspan>,u=\u003Cspan class=\"hljs-built_in\">parseFloat\u003C\u002Fspan>(\u003Cspan class=\"hljs-title function_\">v\u003C\u002Fspan>(o.\u003Cspan class=\"hljs-title function_\">val\u003C\u002Fspan>()))):[\u003Cspan class=\"hljs-string\">&quot;radio&quot;\u003C\u002Fspan>,\u003Cspan class=\"hljs-string\">&quot;checkbox&quot;\u003C\u002Fspan>].\u003Cspan class=\"hljs-title function_\">indexOf\u003C\u002Fspan>(f)&gt;-\u003Cspan class=\"hljs-number\">1\u003C\u002Fspan>&amp;&amp;(s.\u003Cspan class=\"hljs-property\">has_quantity\u003C\u002Fspan>=!\u003Cspan class=\"hljs-number\">0\u003C\u002Fspan>,\u003Cspan class=\"hljs-number\">1\u003C\u002Fspan>==o.\u003Cspan class=\"hljs-title function_\">filter\u003C\u002Fspan>(\u003Cspan class=\"hljs-string\">&quot;:checked&quot;\u003C\u002Fspan>).\u003Cspan class=\"hljs-property\">length\u003C\u002Fspan>&amp;&amp;(u=\u003Cspan class=\"hljs-built_in\">parseFloat\u003C\u002Fspan>(\u003Cspan class=\"hljs-title function_\">v\u003C\u002Fspan>(o.\u003Cspan class=\"hljs-title function_\">filter\u003C\u002Fspan>(\u003Cspan class=\"hljs-string\">&quot;:checked&quot;\u003C\u002Fspan>).\u003Cspan class=\"hljs-title function_\">val\u003C\u002Fspan>())))),\u003Cspan class=\"hljs-built_in\">isNaN\u003C\u002Fspan>(u)&amp;&amp;(u=\u003Cspan class=\"hljs-number\">0\u003C\u002Fspan>),s.\u003Cspan class=\"hljs-property\">quantity\u003C\u002Fspan>=u}a.\u003Cspan class=\"hljs-property\">products\u003C\u002Fspan>[t]=s}));e.\u003Cspan class=\"hljs-title function_\">attr\u003C\u002Fspan>(\u003Cspan class=\"hljs-string\">&quot;data-fc-form-code&quot;\u003C\u002Fspan>)&amp;&amp;(n=e.\u003Cspan class=\"hljs-title function_\">attr\u003C\u002Fspan>(\u003Cspan class=\"hljs-string\">&quot;data-fc-form-code&quot;\u003C\u002Fspan>)),\u003Cspan class=\"hljs-string\">&quot;&quot;\u003C\u002Fspan>!==n&amp;&amp;(\u003Cspan class=\"hljs-title function_\">t\u003C\u002Fspan>(\u003Cspan class=\"hljs-variable language_\">this\u003C\u002Fspan>).\u003Cspan class=\"hljs-title function_\">find\u003C\u002Fspan>(\u003Cspan class=\"hljs-string\">&quot;input,select&quot;\u003C\u002Fspan>).\u003Cspan class=\"hljs-title function_\">each\u003C\u002Fspan>((\u003Cspan class=\"hljs-keyword\">function\u003C\u002Fspan>(\u003Cspan class=\"hljs-params\">\u003C\u002Fspan>){\u003Cspan class=\"hljs-keyword\">var\u003C\u002Fspan> e=\u003Cspan class=\"hljs-title function_\">b\u003C\u002Fspan>(\u003Cspan class=\"hljs-variable language_\">this\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">name\u003C\u002Fspan>),i=\u003Cspan class=\"hljs-keyword\">function\u003C\u002Fspan>(\u003Cspan class=\"hljs-params\">t\u003C\u002Fspan>){\u003Cspan class=\"hljs-keyword\">return\u003C\u002Fspan> \u003Cspan class=\"hljs-title function_\">x\u003C\u002Fspan>(t)[\u003Cspan class=\"hljs-number\">2\u003C\u002Fspan>]}(\u003Cspan class=\"hljs-variable language_\">this\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">name\u003C\u002Fspan>),s=\u003Cspan class=\"hljs-title function_\">j\u003C\u002Fspan>(\u003Cspan class=\"hljs-title function_\">t\u003C\u002Fspan>(\u003Cspan class=\"hljs-variable language_\">this\u003C\u002Fspan>));\u003Cspan class=\"hljs-keyword\">if\u003C\u002Fspan>(\u003Cspan class=\"hljs-string\">&quot;quantity&quot;\u003C\u002Fspan>!=i)\u003Cspan class=\"hljs-keyword\">if\u003C\u002Fspan>(\u003Cspan class=\"hljs-string\">&quot;price&quot;\u003C\u002Fspan>!=i||\u003Cspan class=\"hljs-string\">&quot;hidden&quot;\u003C\u002Fspan>==s){\u003Cspan class=\"hljs-keyword\">if\u003C\u002Fspan>(\u003Cspan class=\"hljs-string\">&quot;SELECT&quot;\u003C\u002Fspan>==\u003Cspan class=\"hljs-variable language_\">this\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">tagName\u003C\u002Fspan>){\u003Cspan class=\"hljs-keyword\">var\u003C\u002Fspan> o=!\u003Cspan class=\"hljs-number\">1\u003C\u002Fspan>;\u003Cspan class=\"hljs-title function_\">t\u003C\u002Fspan>(\u003Cspan class=\"hljs-variable language_\">this\u003C\u002Fspan>).\u003Cspan class=\"hljs-title function_\">children\u003C\u002Fspan>(\u003Cspan class=\"hljs-string\">&quot;option&quot;\u003C\u002Fspan>).\u003Cspan class=\"hljs-title function_\">each\u003C\u002Fspan>((\u003Cspan class=\"hljs-keyword\">function\u003C\u002Fspan>(\u003Cspan class=\"hljs-params\">\u003C\u002Fspan>){\u003Cspan class=\"hljs-variable language_\">this\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">value\u003C\u002Fspan>.\u003Cspan class=\"hljs-title function_\">search\u003C\u002Fspan>(r)&gt;-\u003Cspan class=\"hljs-number\">1\u003C\u002Fspan>&amp;&amp;(o=!\u003Cspan class=\"hljs-number\">0\u003C\u002Fspan>)})),o&amp;&amp;(\u003Cspan class=\"hljs-title function_\">t\u003C\u002Fspan>(\u003Cspan class=\"hljs-variable language_\">this\u003C\u002Fspan>).\u003Cspan class=\"hljs-title function_\">data\u003C\u002Fspan>(\u003Cspan class=\"hljs-string\">&quot;fc-adjust-for&quot;\u003C\u002Fspan>,n),a.\u003Cspan class=\"hljs-property\">products\u003C\u002Fspan>[e].\u003Cspan class=\"hljs-property\">attributes\u003C\u002Fspan>[\u003Cspan class=\"hljs-title function_\">v\u003C\u002Fspan>(\u003Cspan class=\"hljs-variable language_\">this\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">name\u003C\u002Fspan>)]=\u003Cspan class=\"hljs-title function_\">v\u003C\u002Fspan>(\u003Cspan class=\"hljs-variable language_\">this\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">value\u003C\u002Fspan>),\u003Cspan class=\"hljs-title function_\">t\u003C\u002Fspan>(\u003Cspan class=\"hljs-variable language_\">this\u003C\u002Fspan>).\u003Cspan class=\"hljs-title function_\">on\u003C\u002Fspan>(\u003Cspan class=\"hljs-string\">&quot;change.foxy-dynamic-price&quot;\u003C\u002Fspan>,(\u003Cspan class=\"hljs-keyword\">function\u003C\u002Fspan>(\u003Cspan class=\"hljs-params\">\u003C\u002Fspan>){\u003Cspan class=\"hljs-variable constant_\">ADJUST\u003C\u002Fspan>[\u003Cspan class=\"hljs-title function_\">t\u003C\u002Fspan>(\u003Cspan class=\"hljs-variable language_\">this\u003C\u002Fspan>).\u003Cspan class=\"hljs-title function_\">data\u003C\u002Fspan>(\u003Cspan class=\"hljs-string\">&quot;fc-adjust-for&quot;\u003C\u002Fspan>)].\u003Cspan class=\"hljs-property\">products\u003C\u002Fspan>[e].\u003Cspan class=\"hljs-property\">attributes\u003C\u002Fspan>[\u003Cspan class=\"hljs-title function_\">v\u003C\u002Fspan>(\u003Cspan class=\"hljs-variable language_\">this\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">name\u003C\u002Fspan>)]=\u003Cspan class=\"hljs-title function_\">v\u003C\u002Fspan>(\u003Cspan class=\"hljs-variable language_\">this\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">value\u003C\u002Fspan>),\u003Cspan class=\"hljs-title function_\">w\u003C\u002Fspan>()})))}\u003Cspan class=\"hljs-keyword\">else\u003C\u002Fspan> \u003Cspan class=\"hljs-keyword\">if\u003C\u002Fspan>(\u003Cspan class=\"hljs-variable language_\">this\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">value\u003C\u002Fspan>.\u003Cspan class=\"hljs-title function_\">search\u003C\u002Fspan>(r)&gt;-\u003Cspan class=\"hljs-number\">1\u003C\u002Fspan>)\u003Cspan class=\"hljs-keyword\">switch\u003C\u002Fspan>(\u003Cspan class=\"hljs-title function_\">t\u003C\u002Fspan>(\u003Cspan class=\"hljs-variable language_\">this\u003C\u002Fspan>).\u003Cspan class=\"hljs-title function_\">data\u003C\u002Fspan>(\u003Cspan class=\"hljs-string\">&quot;fc-adjust-for&quot;\u003C\u002Fspan>,n),\u003Cspan class=\"hljs-title function_\">t\u003C\u002Fspan>(\u003Cspan class=\"hljs-variable language_\">this\u003C\u002Fspan>).\u003Cspan class=\"hljs-title function_\">attr\u003C\u002Fspan>(\u003Cspan class=\"hljs-string\">&quot;type&quot;\u003C\u002Fspan>)){\u003Cspan class=\"hljs-keyword\">case\u003C\u002Fspan>\u003Cspan class=\"hljs-string\">&quot;checkbox&quot;\u003C\u002Fspan>:\u003Cspan class=\"hljs-title function_\">t\u003C\u002Fspan>(\u003Cspan class=\"hljs-variable language_\">this\u003C\u002Fspan>).\u003Cspan class=\"hljs-title function_\">is\u003C\u002Fspan>(\u003Cspan class=\"hljs-string\">&quot;:checked&quot;\u003C\u002Fspan>)?a.\u003Cspan class=\"hljs-property\">products\u003C\u002Fspan>[e].\u003Cspan class=\"hljs-property\">attributes\u003C\u002Fspan>[\u003Cspan class=\"hljs-title function_\">v\u003C\u002Fspan>(\u003Cspan class=\"hljs-variable language_\">this\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">name\u003C\u002Fspan>)]=\u003Cspan class=\"hljs-title function_\">v\u003C\u002Fspan>(\u003Cspan class=\"hljs-variable language_\">this\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">value\u003C\u002Fspan>):a.\u003Cspan class=\"hljs-property\">products\u003C\u002Fspan>[e].\u003Cspan class=\"hljs-property\">attributes\u003C\u002Fspan>[\u003Cspan class=\"hljs-title function_\">v\u003C\u002Fspan>(\u003Cspan class=\"hljs-variable language_\">this\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">name\u003C\u002Fspan>)]=\u003Cspan class=\"hljs-string\">&quot;&quot;\u003C\u002Fspan>,\u003Cspan class=\"hljs-title function_\">t\u003C\u002Fspan>(\u003Cspan class=\"hljs-variable language_\">this\u003C\u002Fspan>).\u003Cspan class=\"hljs-title function_\">on\u003C\u002Fspan>(\u003Cspan class=\"hljs-string\">&quot;change.foxy-dynamic-price&quot;\u003C\u002Fspan>,(\u003Cspan class=\"hljs-keyword\">function\u003C\u002Fspan>(\u003Cspan class=\"hljs-params\">\u003C\u002Fspan>){\u003Cspan class=\"hljs-title function_\">t\u003C\u002Fspan>(\u003Cspan class=\"hljs-variable language_\">this\u003C\u002Fspan>).\u003Cspan class=\"hljs-title function_\">is\u003C\u002Fspan>(\u003Cspan class=\"hljs-string\">&quot;:checked&quot;\u003C\u002Fspan>)?\u003Cspan class=\"hljs-variable constant_\">ADJUST\u003C\u002Fspan>[\u003Cspan class=\"hljs-title function_\">t\u003C\u002Fspan>(\u003Cspan class=\"hljs-variable language_\">this\u003C\u002Fspan>).\u003Cspan class=\"hljs-title function_\">data\u003C\u002Fspan>(\u003Cspan class=\"hljs-string\">&quot;fc-adjust-for&quot;\u003C\u002Fspan>)].\u003Cspan class=\"hljs-property\">products\u003C\u002Fspan>[e].\u003Cspan class=\"hljs-property\">attributes\u003C\u002Fspan>[\u003Cspan class=\"hljs-title function_\">v\u003C\u002Fspan>(\u003Cspan class=\"hljs-variable language_\">this\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">name\u003C\u002Fspan>)]=\u003Cspan class=\"hljs-title function_\">v\u003C\u002Fspan>(\u003Cspan class=\"hljs-variable language_\">this\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">value\u003C\u002Fspan>):\u003Cspan class=\"hljs-variable constant_\">ADJUST\u003C\u002Fspan>[\u003Cspan class=\"hljs-title function_\">t\u003C\u002Fspan>(\u003Cspan class=\"hljs-variable language_\">this\u003C\u002Fspan>).\u003Cspan class=\"hljs-title function_\">data\u003C\u002Fspan>(\u003Cspan class=\"hljs-string\">&quot;fc-adjust-for&quot;\u003C\u002Fspan>)].\u003Cspan class=\"hljs-property\">products\u003C\u002Fspan>[e].\u003Cspan class=\"hljs-property\">attributes\u003C\u002Fspan>[\u003Cspan class=\"hljs-title function_\">v\u003C\u002Fspan>(\u003Cspan class=\"hljs-variable language_\">this\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">name\u003C\u002Fspan>)]=\u003Cspan class=\"hljs-string\">&quot;&quot;\u003C\u002Fspan>,\u003Cspan class=\"hljs-title function_\">w\u003C\u002Fspan>()}));\u003Cspan class=\"hljs-keyword\">break\u003C\u002Fspan>;\u003Cspan class=\"hljs-keyword\">case\u003C\u002Fspan>\u003Cspan class=\"hljs-string\">&quot;radio&quot;\u003C\u002Fspan>:a.\u003Cspan class=\"hljs-property\">products\u003C\u002Fspan>[e].\u003Cspan class=\"hljs-property\">attributes\u003C\u002Fspan>.\u003Cspan class=\"hljs-title function_\">hasOwnProperty\u003C\u002Fspan>(\u003Cspan class=\"hljs-title function_\">v\u003C\u002Fspan>(\u003Cspan class=\"hljs-variable language_\">this\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">name\u003C\u002Fspan>))||(a.\u003Cspan class=\"hljs-property\">products\u003C\u002Fspan>[e].\u003Cspan class=\"hljs-property\">attributes\u003C\u002Fspan>[\u003Cspan class=\"hljs-title function_\">v\u003C\u002Fspan>(\u003Cspan class=\"hljs-variable language_\">this\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">name\u003C\u002Fspan>)]=\u003Cspan class=\"hljs-string\">&quot;&quot;\u003C\u002Fspan>),\u003Cspan class=\"hljs-title function_\">t\u003C\u002Fspan>(\u003Cspan class=\"hljs-variable language_\">this\u003C\u002Fspan>).\u003Cspan class=\"hljs-title function_\">is\u003C\u002Fspan>(\u003Cspan class=\"hljs-string\">&quot;:checked&quot;\u003C\u002Fspan>)&amp;&amp;(a.\u003Cspan class=\"hljs-property\">products\u003C\u002Fspan>[e].\u003Cspan class=\"hljs-property\">attributes\u003C\u002Fspan>[\u003Cspan class=\"hljs-title function_\">v\u003C\u002Fspan>(\u003Cspan class=\"hljs-variable language_\">this\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">name\u003C\u002Fspan>)]=\u003Cspan class=\"hljs-title function_\">v\u003C\u002Fspan>(\u003Cspan class=\"hljs-variable language_\">this\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">value\u003C\u002Fspan>)),\u003Cspan class=\"hljs-title function_\">t\u003C\u002Fspan>(\u003Cspan class=\"hljs-string\">&quot;[name=&#x27;&quot;\u003C\u002Fspan>+\u003Cspan class=\"hljs-variable language_\">this\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">name\u003C\u002Fspan>+\u003Cspan class=\"hljs-string\">&quot;&#x27;]&quot;\u003C\u002Fspan>).\u003Cspan class=\"hljs-title function_\">data\u003C\u002Fspan>(\u003Cspan class=\"hljs-string\">&quot;fc-adjust-for&quot;\u003C\u002Fspan>,n).\u003Cspan class=\"hljs-title function_\">on\u003C\u002Fspan>(\u003Cspan class=\"hljs-string\">&quot;change.foxy-dynamic-price&quot;\u003C\u002Fspan>,(\u003Cspan class=\"hljs-keyword\">function\u003C\u002Fspan>(\u003Cspan class=\"hljs-params\">\u003C\u002Fspan>){\u003Cspan class=\"hljs-variable constant_\">ADJUST\u003C\u002Fspan>[\u003Cspan class=\"hljs-title function_\">t\u003C\u002Fspan>(\u003Cspan class=\"hljs-variable language_\">this\u003C\u002Fspan>).\u003Cspan class=\"hljs-title function_\">data\u003C\u002Fspan>(\u003Cspan class=\"hljs-string\">&quot;fc-adjust-for&quot;\u003C\u002Fspan>)].\u003Cspan class=\"hljs-property\">products\u003C\u002Fspan>[e].\u003Cspan class=\"hljs-property\">attributes\u003C\u002Fspan>[\u003Cspan class=\"hljs-title function_\">v\u003C\u002Fspan>(\u003Cspan class=\"hljs-variable language_\">this\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">name\u003C\u002Fspan>)]=\u003Cspan class=\"hljs-title function_\">v\u003C\u002Fspan>(\u003Cspan class=\"hljs-variable language_\">this\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">value\u003C\u002Fspan>),\u003Cspan class=\"hljs-title function_\">w\u003C\u002Fspan>()}))}}\u003Cspan class=\"hljs-keyword\">else\u003C\u002Fspan> \u003Cspan class=\"hljs-title function_\">t\u003C\u002Fspan>(\u003Cspan class=\"hljs-variable language_\">this\u003C\u002Fspan>).\u003Cspan class=\"hljs-title function_\">data\u003C\u002Fspan>(\u003Cspan class=\"hljs-string\">&quot;fc-adjust-for&quot;\u003C\u002Fspan>,n).\u003Cspan class=\"hljs-title function_\">on\u003C\u002Fspan>(\u003Cspan class=\"hljs-string\">&quot;change.foxy-dynamic-price&quot;\u003C\u002Fspan>,(\u003Cspan class=\"hljs-keyword\">function\u003C\u002Fspan>(\u003Cspan class=\"hljs-params\">\u003C\u002Fspan>){\u003Cspan class=\"hljs-keyword\">var\u003C\u002Fspan> n=\u003Cspan class=\"hljs-number\">0\u003C\u002Fspan>;([\u003Cspan class=\"hljs-string\">&quot;select&quot;\u003C\u002Fspan>,\u003Cspan class=\"hljs-string\">&quot;text&quot;\u003C\u002Fspan>].\u003Cspan class=\"hljs-title function_\">indexOf\u003C\u002Fspan>(s)&gt;-\u003Cspan class=\"hljs-number\">1\u003C\u002Fspan>||[\u003Cspan class=\"hljs-string\">&quot;radio&quot;\u003C\u002Fspan>,\u003Cspan class=\"hljs-string\">&quot;checkbox&quot;\u003C\u002Fspan>].\u003Cspan class=\"hljs-title function_\">indexOf\u003C\u002Fspan>(s)&gt;-\u003Cspan class=\"hljs-number\">1\u003C\u002Fspan>&amp;&amp;\u003Cspan class=\"hljs-title function_\">t\u003C\u002Fspan>(\u003Cspan class=\"hljs-variable language_\">this\u003C\u002Fspan>).\u003Cspan class=\"hljs-title function_\">is\u003C\u002Fspan>(\u003Cspan class=\"hljs-string\">&quot;:checked&quot;\u003C\u002Fspan>))&amp;&amp;(n=\u003Cspan class=\"hljs-built_in\">parseFloat\u003C\u002Fspan>(\u003Cspan class=\"hljs-title function_\">v\u003C\u002Fspan>(\u003Cspan class=\"hljs-variable language_\">this\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">value\u003C\u002Fspan>))),\u003Cspan class=\"hljs-built_in\">isNaN\u003C\u002Fspan>(n)&amp;&amp;(n=\u003Cspan class=\"hljs-number\">0\u003C\u002Fspan>),\u003Cspan class=\"hljs-variable constant_\">ADJUST\u003C\u002Fspan>[\u003Cspan class=\"hljs-title function_\">t\u003C\u002Fspan>(\u003Cspan class=\"hljs-variable language_\">this\u003C\u002Fspan>).\u003Cspan class=\"hljs-title function_\">data\u003C\u002Fspan>(\u003Cspan class=\"hljs-string\">&quot;fc-adjust-for&quot;\u003C\u002Fspan>)].\u003Cspan class=\"hljs-property\">products\u003C\u002Fspan>[e].\u003Cspan class=\"hljs-property\">base_price\u003C\u002Fspan>=n,\u003Cspan class=\"hljs-title function_\">w\u003C\u002Fspan>()}));\u003Cspan class=\"hljs-keyword\">else\u003C\u002Fspan> \u003Cspan class=\"hljs-title function_\">t\u003C\u002Fspan>(\u003Cspan class=\"hljs-variable language_\">this\u003C\u002Fspan>).\u003Cspan class=\"hljs-title function_\">data\u003C\u002Fspan>(\u003Cspan class=\"hljs-string\">&quot;fc-adjust-for&quot;\u003C\u002Fspan>,n).\u003Cspan class=\"hljs-title function_\">on\u003C\u002Fspan>(\u003Cspan class=\"hljs-string\">&quot;change.foxy-dynamic-price&quot;\u003C\u002Fspan>,(\u003Cspan class=\"hljs-keyword\">function\u003C\u002Fspan>(\u003Cspan class=\"hljs-params\">\u003C\u002Fspan>){\u003Cspan class=\"hljs-keyword\">var\u003C\u002Fspan> n=\u003Cspan class=\"hljs-number\">0\u003C\u002Fspan>;([\u003Cspan class=\"hljs-string\">&quot;select&quot;\u003C\u002Fspan>,\u003Cspan class=\"hljs-string\">&quot;text&quot;\u003C\u002Fspan>].\u003Cspan class=\"hljs-title function_\">indexOf\u003C\u002Fspan>(s)&gt;-\u003Cspan class=\"hljs-number\">1\u003C\u002Fspan>||[\u003Cspan class=\"hljs-string\">&quot;radio&quot;\u003C\u002Fspan>,\u003Cspan class=\"hljs-string\">&quot;checkbox&quot;\u003C\u002Fspan>].\u003Cspan class=\"hljs-title function_\">indexOf\u003C\u002Fspan>(s)&gt;-\u003Cspan class=\"hljs-number\">1\u003C\u002Fspan>&amp;&amp;\u003Cspan class=\"hljs-title function_\">t\u003C\u002Fspan>(\u003Cspan class=\"hljs-variable language_\">this\u003C\u002Fspan>).\u003Cspan class=\"hljs-title function_\">is\u003C\u002Fspan>(\u003Cspan class=\"hljs-string\">&quot;:checked&quot;\u003C\u002Fspan>))&amp;&amp;(n=\u003Cspan class=\"hljs-built_in\">parseFloat\u003C\u002Fspan>(\u003Cspan class=\"hljs-title function_\">v\u003C\u002Fspan>(\u003Cspan class=\"hljs-variable language_\">this\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">value\u003C\u002Fspan>))),\u003Cspan class=\"hljs-built_in\">isNaN\u003C\u002Fspan>(n)&amp;&amp;(n=\u003Cspan class=\"hljs-number\">0\u003C\u002Fspan>),\u003Cspan class=\"hljs-variable constant_\">ADJUST\u003C\u002Fspan>[\u003Cspan class=\"hljs-title function_\">t\u003C\u002Fspan>(\u003Cspan class=\"hljs-variable language_\">this\u003C\u002Fspan>).\u003Cspan class=\"hljs-title function_\">data\u003C\u002Fspan>(\u003Cspan class=\"hljs-string\">&quot;fc-adjust-for&quot;\u003C\u002Fspan>)].\u003Cspan class=\"hljs-property\">products\u003C\u002Fspan>[e].\u003Cspan class=\"hljs-property\">quantity\u003C\u002Fspan>=n,\u003Cspan class=\"hljs-title function_\">w\u003C\u002Fspan>()}))})),\u003Cspan class=\"hljs-variable constant_\">ADJUST\u003C\u002Fspan>[n]=a)})),n.\u003Cspan class=\"hljs-property\">_ADJUST\u003C\u002Fspan>=\u003Cspan class=\"hljs-variable constant_\">ADJUST\u003C\u002Fspan>,\u003Cspan class=\"hljs-title function_\">w\u003C\u002Fspan>()}\u003Cspan class=\"hljs-keyword\">function\u003C\u002Fspan> \u003Cspan class=\"hljs-title function_\">v\u003C\u002Fspan>(\u003Cspan class=\"hljs-params\">t\u003C\u002Fspan>){\u003Cspan class=\"hljs-keyword\">return\u003C\u002Fspan> t.\u003Cspan class=\"hljs-title function_\">replace\u003C\u002Fspan>(\u003Cspan class=\"hljs-regexp\">\u002F\\|\\|[\\d\\w]+(?:\\|\\|open)?$\u002F\u003C\u002Fspan>,\u003Cspan class=\"hljs-string\">&quot;&quot;\u003C\u002Fspan>)}\u003Cspan class=\"hljs-keyword\">function\u003C\u002Fspan> \u003Cspan class=\"hljs-title function_\">x\u003C\u002Fspan>(\u003Cspan class=\"hljs-params\">t\u003C\u002Fspan>){\u003Cspan class=\"hljs-keyword\">return\u003C\u002Fspan>(t=\u003Cspan class=\"hljs-title function_\">v\u003C\u002Fspan>(t)).\u003Cspan class=\"hljs-title function_\">match\u003C\u002Fspan>(\u003Cspan class=\"hljs-regexp\">\u002F(?:(\\d+):)?(.*)\u002F\u003C\u002Fspan>)}\u003Cspan class=\"hljs-keyword\">function\u003C\u002Fspan> \u003Cspan class=\"hljs-title function_\">b\u003C\u002Fspan>(\u003Cspan class=\"hljs-params\">t\u003C\u002Fspan>){\u003Cspan class=\"hljs-keyword\">var\u003C\u002Fspan> e=\u003Cspan class=\"hljs-title function_\">x\u003C\u002Fspan>(t);\u003Cspan class=\"hljs-keyword\">return\u003C\u002Fspan> i.\u003Cspan class=\"hljs-title function_\">test\u003C\u002Fspan>(\u003Cspan class=\"hljs-variable language_\">this\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">name\u003C\u002Fspan>)&amp;&amp;(prefix=\u003Cspan class=\"hljs-built_in\">parseInt\u003C\u002Fspan>(\u003Cspan class=\"hljs-variable language_\">this\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">name\u003C\u002Fspan>.\u003Cspan class=\"hljs-title function_\">match\u003C\u002Fspan>(i)[\u003Cspan class=\"hljs-number\">0\u003C\u002Fspan>])),\u003Cspan class=\"hljs-keyword\">void\u003C\u002Fspan> \u003Cspan class=\"hljs-number\">0\u003C\u002Fspan>===e[\u003Cspan class=\"hljs-number\">1\u003C\u002Fspan>]?\u003Cspan class=\"hljs-number\">0\u003C\u002Fspan>:\u003Cspan class=\"hljs-built_in\">parseInt\u003C\u002Fspan>(e[\u003Cspan class=\"hljs-number\">1\u003C\u002Fspan>])}\u003Cspan class=\"hljs-keyword\">function\u003C\u002Fspan> \u003Cspan class=\"hljs-title function_\">j\u003C\u002Fspan>(\u003Cspan class=\"hljs-params\">t\u003C\u002Fspan>){\u003Cspan class=\"hljs-keyword\">if\u003C\u002Fspan>(\u003Cspan class=\"hljs-string\">&quot;SELECT&quot;\u003C\u002Fspan>==t[\u003Cspan class=\"hljs-number\">0\u003C\u002Fspan>].\u003Cspan class=\"hljs-property\">tagName\u003C\u002Fspan>)\u003Cspan class=\"hljs-keyword\">return\u003C\u002Fspan>\u003Cspan class=\"hljs-string\">&quot;select&quot;\u003C\u002Fspan>;\u003Cspan class=\"hljs-keyword\">if\u003C\u002Fspan>(\u003Cspan class=\"hljs-string\">&quot;INPUT&quot;\u003C\u002Fspan>==t[\u003Cspan class=\"hljs-number\">0\u003C\u002Fspan>].\u003Cspan class=\"hljs-property\">tagName\u003C\u002Fspan>)\u003Cspan class=\"hljs-keyword\">switch\u003C\u002Fspan>(t.\u003Cspan class=\"hljs-title function_\">attr\u003C\u002Fspan>(\u003Cspan class=\"hljs-string\">&quot;type&quot;\u003C\u002Fspan>).\u003Cspan class=\"hljs-title function_\">toLowerCase\u003C\u002Fspan>()){\u003Cspan class=\"hljs-keyword\">case\u003C\u002Fspan>\u003Cspan class=\"hljs-string\">&quot;text&quot;\u003C\u002Fspan>:\u003Cspan class=\"hljs-keyword\">case\u003C\u002Fspan>\u003Cspan class=\"hljs-string\">&quot;number&quot;\u003C\u002Fspan>:\u003Cspan class=\"hljs-keyword\">case\u003C\u002Fspan>\u003Cspan class=\"hljs-string\">&quot;tel&quot;\u003C\u002Fspan>:\u003Cspan class=\"hljs-keyword\">return\u003C\u002Fspan>\u003Cspan class=\"hljs-string\">&quot;text&quot;\u003C\u002Fspan>;\u003Cspan class=\"hljs-attr\">default\u003C\u002Fspan>:\u003Cspan class=\"hljs-keyword\">return\u003C\u002Fspan> t.\u003Cspan class=\"hljs-title function_\">attr\u003C\u002Fspan>(\u003Cspan class=\"hljs-string\">&quot;type&quot;\u003C\u002Fspan>).\u003Cspan class=\"hljs-title function_\">toLowerCase\u003C\u002Fspan>()}}\u003Cspan class=\"hljs-keyword\">function\u003C\u002Fspan> \u003Cspan class=\"hljs-title function_\">w\u003C\u002Fspan>(\u003Cspan class=\"hljs-params\">\u003C\u002Fspan>){\u003Cspan class=\"hljs-keyword\">for\u003C\u002Fspan>(f \u003Cspan class=\"hljs-keyword\">in\u003C\u002Fspan> \u003Cspan class=\"hljs-variable constant_\">ADJUST\u003C\u002Fspan>){\u003Cspan class=\"hljs-keyword\">var\u003C\u002Fspan> n=\u003Cspan class=\"hljs-number\">0\u003C\u002Fspan>,i=\u003Cspan class=\"hljs-number\">0\u003C\u002Fspan>;\u003Cspan class=\"hljs-keyword\">for\u003C\u002Fspan>(p \u003Cspan class=\"hljs-keyword\">in\u003C\u002Fspan> \u003Cspan class=\"hljs-variable constant_\">ADJUST\u003C\u002Fspan>[f].\u003Cspan class=\"hljs-property\">products\u003C\u002Fspan>){\u003Cspan class=\"hljs-keyword\">var\u003C\u002Fspan> s=\u003Cspan class=\"hljs-variable constant_\">ADJUST\u003C\u002Fspan>[f].\u003Cspan class=\"hljs-property\">products\u003C\u002Fspan>[p].\u003Cspan class=\"hljs-property\">base_price\u003C\u002Fspan>,o=\u003Cspan class=\"hljs-number\">0\u003C\u002Fspan>;\u003Cspan class=\"hljs-keyword\">for\u003C\u002Fspan>(a \u003Cspan class=\"hljs-keyword\">in\u003C\u002Fspan> \u003Cspan class=\"hljs-variable constant_\">ADJUST\u003C\u002Fspan>[f].\u003Cspan class=\"hljs-property\">products\u003C\u002Fspan>[p].\u003Cspan class=\"hljs-property\">attributes\u003C\u002Fspan>){\u003Cspan class=\"hljs-keyword\">var\u003C\u002Fspan> c=\u003Cspan class=\"hljs-variable constant_\">ADJUST\u003C\u002Fspan>[f].\u003Cspan class=\"hljs-property\">products\u003C\u002Fspan>[p].\u003Cspan class=\"hljs-property\">attributes\u003C\u002Fspan>[a].\u003Cspan class=\"hljs-title function_\">match\u003C\u002Fspan>(r);\u003Cspan class=\"hljs-keyword\">if\u003C\u002Fspan>(c)\u003Cspan class=\"hljs-keyword\">switch\u003C\u002Fspan>(c[\u003Cspan class=\"hljs-number\">2\u003C\u002Fspan>]){\u003Cspan class=\"hljs-keyword\">case\u003C\u002Fspan>\u003Cspan class=\"hljs-string\">&quot;:&quot;\u003C\u002Fspan>:s=\u003Cspan class=\"hljs-built_in\">parseFloat\u003C\u002Fspan>(c[\u003Cspan class=\"hljs-number\">3\u003C\u002Fspan>]);\u003Cspan class=\"hljs-keyword\">break\u003C\u002Fspan>;\u003Cspan class=\"hljs-keyword\">case\u003C\u002Fspan>\u003Cspan class=\"hljs-string\">&quot;+&quot;\u003C\u002Fspan>:o+=\u003Cspan class=\"hljs-built_in\">parseFloat\u003C\u002Fspan>(c[\u003Cspan class=\"hljs-number\">3\u003C\u002Fspan>]);\u003Cspan class=\"hljs-keyword\">break\u003C\u002Fspan>;\u003Cspan class=\"hljs-keyword\">case\u003C\u002Fspan>\u003Cspan class=\"hljs-string\">&quot;-&quot;\u003C\u002Fspan>:o-=\u003Cspan class=\"hljs-built_in\">parseFloat\u003C\u002Fspan>(c[\u003Cspan class=\"hljs-number\">3\u003C\u002Fspan>])}}s+=o,n+=s*=\u003Cspan class=\"hljs-variable constant_\">ADJUST\u003C\u002Fspan>[f].\u003Cspan class=\"hljs-property\">products\u003C\u002Fspan>[p].\u003Cspan class=\"hljs-property\">quantity\u003C\u002Fspan>,i+=\u003Cspan class=\"hljs-variable constant_\">ADJUST\u003C\u002Fspan>[f].\u003Cspan class=\"hljs-property\">products\u003C\u002Fspan>[p].\u003Cspan class=\"hljs-property\">quantity\u003C\u002Fspan>}\u003Cspan class=\"hljs-string\">&quot;function&quot;\u003C\u002Fspan>==\u003Cspan class=\"hljs-keyword\">typeof\u003C\u002Fspan> fcFormatPrice&amp;&amp;(n=\u003Cspan class=\"hljs-title function_\">fcFormatPrice\u003C\u002Fspan>(n,f)),\u003Cspan class=\"hljs-string\">&quot;function&quot;\u003C\u002Fspan>==\u003Cspan class=\"hljs-keyword\">typeof\u003C\u002Fspan> fcFormatQuantity&amp;&amp;(i=\u003Cspan class=\"hljs-title function_\">fcFormatQuantity\u003C\u002Fspan>(i,f));\u003Cspan class=\"hljs-keyword\">var\u003C\u002Fspan> u=\u003Cspan class=\"hljs-title function_\">F\u003C\u002Fspan>(),l=e.\u003Cspan class=\"hljs-property\">util\u003C\u002Fspan>.\u003Cspan class=\"hljs-title function_\">money_format\u003C\u002Fspan>(u.\u003Cspan class=\"hljs-property\">currency_format\u003C\u002Fspan>,\u003Cspan class=\"hljs-title function_\">_\u003C\u002Fspan>(n)).\u003Cspan class=\"hljs-title function_\">trim\u003C\u002Fspan>();\u003Cspan class=\"hljs-title function_\">t\u003C\u002Fspan>(\u003Cspan class=\"hljs-string\">&quot;.&quot;\u003C\u002Fspan>+f+\u003Cspan class=\"hljs-string\">&quot;_total, .&quot;\u003C\u002Fspan>+f+\u003Cspan class=\"hljs-string\">&quot;-total&quot;\u003C\u002Fspan>).\u003Cspan class=\"hljs-title function_\">html\u003C\u002Fspan>(l),\u003Cspan class=\"hljs-title function_\">t\u003C\u002Fspan>(\u003Cspan class=\"hljs-string\">&quot;.&quot;\u003C\u002Fspan>+f+\u003Cspan class=\"hljs-string\">&quot;_total_quantity, .&quot;\u003C\u002Fspan>+f+\u003Cspan class=\"hljs-string\">&quot;-total-quantity&quot;\u003C\u002Fspan>).\u003Cspan class=\"hljs-title function_\">html\u003C\u002Fspan>(i)}}\u003Cspan class=\"hljs-keyword\">function\u003C\u002Fspan> \u003Cspan class=\"hljs-title function_\">D\u003C\u002Fspan>(\u003Cspan class=\"hljs-params\">\u003C\u002Fspan>){\u003Cspan class=\"hljs-keyword\">var\u003C\u002Fspan> t=\u003Cspan class=\"hljs-title function_\">F\u003C\u002Fspan>();\u003Cspan class=\"hljs-keyword\">return\u003C\u002Fspan> e.\u003Cspan class=\"hljs-property\">json\u003C\u002Fspan>.\u003Cspan class=\"hljs-title function_\">hasOwnProperty\u003C\u002Fspan>(\u003Cspan class=\"hljs-string\">&quot;config&quot;\u003C\u002Fspan>)?e.\u003Cspan class=\"hljs-property\">json\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">config\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">store_domain\u003C\u002Fspan>:t?t.\u003Cspan class=\"hljs-property\">store_domain\u003C\u002Fspan>:\u003Cspan class=\"hljs-string\">&quot;.foxycart.com&quot;\u003C\u002Fspan>}\u003Cspan class=\"hljs-keyword\">function\u003C\u002Fspan> \u003Cspan class=\"hljs-title function_\">S\u003C\u002Fspan>(\u003Cspan class=\"hljs-params\">t,e\u003C\u002Fspan>){\u003Cspan class=\"hljs-keyword\">try\u003C\u002Fspan>{\u003Cspan class=\"hljs-keyword\">var\u003C\u002Fspan> n={};\u003Cspan class=\"hljs-keyword\">return\u003C\u002Fspan> e&amp;&amp;(n.\u003Cspan class=\"hljs-property\">decimalSeparator\u003C\u002Fspan>=e),numberCurrencyFormat.\u003Cspan class=\"hljs-title function_\">unformat\u003C\u002Fspan>(t,n)}\u003Cspan class=\"hljs-keyword\">catch\u003C\u002Fspan>(t){\u003Cspan class=\"hljs-keyword\">return\u003C\u002Fspan>!\u003Cspan class=\"hljs-number\">1\u003C\u002Fspan>}}\u003Cspan class=\"hljs-keyword\">function\u003C\u002Fspan> \u003Cspan class=\"hljs-title function_\">O\u003C\u002Fspan>(\u003Cspan class=\"hljs-params\">t\u003C\u002Fspan>){\u003Cspan class=\"hljs-keyword\">var\u003C\u002Fspan> n=\u003Cspan class=\"hljs-title function_\">F\u003C\u002Fspan>(),a=\u003Cspan class=\"hljs-title class_\">Object\u003C\u002Fspan>.\u003Cspan class=\"hljs-title function_\">assign\u003C\u002Fspan>({},n);n&amp;&amp;\u003Cspan class=\"hljs-string\">&quot;&quot;\u003C\u002Fspan>==e.\u003Cspan class=\"hljs-property\">json\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">template_set\u003C\u002Fspan>&amp;&amp;\u003Cspan class=\"hljs-keyword\">void\u003C\u002Fspan> \u003Cspan class=\"hljs-number\">0\u003C\u002Fspan>!==t||\u003Cspan class=\"hljs-title class_\">Object\u003C\u002Fspan>.\u003Cspan class=\"hljs-title function_\">assign\u003C\u002Fspan>(a,{\u003Cspan class=\"hljs-attr\">fcsid\u003C\u002Fspan>:e.\u003Cspan class=\"hljs-property\">json\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">session_id\u003C\u002Fspan>,\u003Cspan class=\"hljs-attr\">store_domain\u003C\u002Fspan>:e.\u003Cspan class=\"hljs-property\">json\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">config\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">store_domain\u003C\u002Fspan>,\u003Cspan class=\"hljs-attr\">template_set\u003C\u002Fspan>:\u003Cspan class=\"hljs-string\">&quot;&quot;\u003C\u002Fspan>==e.\u003Cspan class=\"hljs-property\">json\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">template_set\u003C\u002Fspan>?\u003Cspan class=\"hljs-string\">&quot;DEFAULT&quot;\u003C\u002Fspan>:e.\u003Cspan class=\"hljs-property\">json\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">template_set\u003C\u002Fspan>,\u003Cspan class=\"hljs-attr\">locale\u003C\u002Fspan>:e.\u003Cspan class=\"hljs-property\">json\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">locale_info\u003C\u002Fspan>,\u003Cspan class=\"hljs-attr\">currency_format\u003C\u002Fspan>:e.\u003Cspan class=\"hljs-property\">json\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">config\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">currency_format\u003C\u002Fspan>}),\u003Cspan class=\"hljs-string\">&quot;object&quot;\u003C\u002Fspan>==\u003Cspan class=\"hljs-keyword\">typeof\u003C\u002Fspan> t&amp;&amp;\u003Cspan class=\"hljs-title class_\">Object\u003C\u002Fspan>.\u003Cspan class=\"hljs-title function_\">assign\u003C\u002Fspan>(a,{\u003Cspan class=\"hljs-attr\">rates\u003C\u002Fspan>:t}),\u003Cspan class=\"hljs-variable language_\">localStorage\u003C\u002Fspan>.\u003Cspan class=\"hljs-title function_\">setItem\u003C\u002Fspan>(\u003Cspan class=\"hljs-string\">&quot;fc_currency_config&quot;\u003C\u002Fspan>,\u003Cspan class=\"hljs-title class_\">JSON\u003C\u002Fspan>.\u003Cspan class=\"hljs-title function_\">stringify\u003C\u002Fspan>(a))}\u003Cspan class=\"hljs-keyword\">function\u003C\u002Fspan> \u003Cspan class=\"hljs-title function_\">F\u003C\u002Fspan>(\u003Cspan class=\"hljs-params\">\u003C\u002Fspan>){\u003Cspan class=\"hljs-keyword\">var\u003C\u002Fspan> t=\u003Cspan class=\"hljs-title class_\">JSON\u003C\u002Fspan>.\u003Cspan class=\"hljs-title function_\">parse\u003C\u002Fspan>(\u003Cspan class=\"hljs-variable language_\">localStorage\u003C\u002Fspan>.\u003Cspan class=\"hljs-title function_\">getItem\u003C\u002Fspan>(\u003Cspan class=\"hljs-string\">&quot;fc_currency_config&quot;\u003C\u002Fspan>));\u003Cspan class=\"hljs-keyword\">return\u003C\u002Fspan>!(\u003Cspan class=\"hljs-literal\">null\u003C\u002Fspan>===t||e.\u003Cspan class=\"hljs-title function_\">hasOwnProperty\u003C\u002Fspan>(\u003Cspan class=\"hljs-string\">&quot;json&quot;\u003C\u002Fspan>)&amp;&amp;e.\u003Cspan class=\"hljs-property\">json\u003C\u002Fspan>.\u003Cspan class=\"hljs-title function_\">hasOwnProperty\u003C\u002Fspan>(\u003Cspan class=\"hljs-string\">&quot;session_id&quot;\u003C\u002Fspan>)&amp;&amp;t.\u003Cspan class=\"hljs-property\">fcsid\u003C\u002Fspan>!==e.\u003Cspan class=\"hljs-property\">json\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">session_id\u003C\u002Fspan>)&amp;&amp;t}e.\u003Cspan class=\"hljs-title function_\">hasOwnProperty\u003C\u002Fspan>(\u003Cspan class=\"hljs-string\">&quot;util&quot;\u003C\u002Fspan>)||(e.\u003Cspan class=\"hljs-property\">util\u003C\u002Fspan>={},e.\u003Cspan class=\"hljs-property\">util\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">money_format\u003C\u002Fspan>=\u003Cspan class=\"hljs-keyword\">function\u003C\u002Fspan>(\u003Cspan class=\"hljs-params\">t,n\u003C\u002Fspan>){\u003Cspan class=\"hljs-keyword\">if\u003C\u002Fspan>(\u003Cspan class=\"hljs-string\">&quot;number&quot;\u003C\u002Fspan>!=\u003Cspan class=\"hljs-keyword\">typeof\u003C\u002Fspan> n)\u003Cspan class=\"hljs-keyword\">return\u003C\u002Fspan> \u003Cspan class=\"hljs-literal\">null\u003C\u002Fspan>;\u003Cspan class=\"hljs-keyword\">var\u003C\u002Fspan> a=e.\u003Cspan class=\"hljs-property\">json\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">locale_info\u003C\u002Fspan>;\u003Cspan class=\"hljs-keyword\">return\u003C\u002Fspan> t.\u003Cspan class=\"hljs-title function_\">replace\u003C\u002Fspan>(\u003Cspan class=\"hljs-regexp\">\u002F%((=.|[+^(!-])*?)(\\d*?)(#(\\d+))?(\\.(\\d+))?([in%])\u002Fg\u003C\u002Fspan>,(\u003Cspan class=\"hljs-keyword\">function\u003C\u002Fspan>(\u003Cspan class=\"hljs-params\">t,r,i,s,o,c,u,f,l\u003C\u002Fspan>){\u003Cspan class=\"hljs-keyword\">if\u003C\u002Fspan>(t=u=\u003Cspan class=\"hljs-string\">&quot;&quot;\u003C\u002Fspan>,\u003Cspan class=\"hljs-string\">&quot;%&quot;\u003C\u002Fspan>===l)\u003Cspan class=\"hljs-keyword\">return\u003C\u002Fspan>\u003Cspan class=\"hljs-string\">&quot;%&quot;\u003C\u002Fspan>;u=r&amp;&amp;\u003Cspan class=\"hljs-regexp\">\u002F=.\u002F\u003C\u002Fspan>.\u003Cspan class=\"hljs-title function_\">test\u003C\u002Fspan>(r)?r.\u003Cspan class=\"hljs-title function_\">match\u003C\u002Fspan>(\u003Cspan class=\"hljs-regexp\">\u002F=(.)\u002F\u003C\u002Fspan>)[\u003Cspan class=\"hljs-number\">1\u003C\u002Fspan>]:\u003Cspan class=\"hljs-string\">&quot; &quot;\u003C\u002Fspan>,o=!r||-\u003Cspan class=\"hljs-number\">1\u003C\u002Fspan>===r.\u003Cspan class=\"hljs-title function_\">indexOf\u003C\u002Fspan>(\u003Cspan class=\"hljs-string\">&quot;!&quot;\u003C\u002Fspan>),s=\u003Cspan class=\"hljs-built_in\">parseInt\u003C\u002Fspan>(s,\u003Cspan class=\"hljs-number\">10\u003C\u002Fspan>)||\u003Cspan class=\"hljs-number\">0\u003C\u002Fspan>,(i=\u003Cspan class=\"hljs-number\">0\u003C\u002Fspan>&gt;n)&amp;&amp;(n=-n),f=\u003Cspan class=\"hljs-string\">&quot;&quot;\u003C\u002Fspan>===f||\u003Cspan class=\"hljs-keyword\">void\u003C\u002Fspan> \u003Cspan class=\"hljs-number\">0\u003C\u002Fspan>===f?\u003Cspan class=\"hljs-string\">&quot;i&quot;\u003C\u002Fspan>===l?a.\u003Cspan class=\"hljs-property\">int_frac_digits\u003C\u002Fspan>:a.\u003Cspan class=\"hljs-property\">frac_digits\u003C\u002Fspan>:\u003Cspan class=\"hljs-built_in\">parseInt\u003C\u002Fspan>(f,\u003Cspan class=\"hljs-number\">10\u003C\u002Fspan>);\u003Cspan class=\"hljs-keyword\">var\u003C\u002Fspan> d=(n=(n=e.\u003Cspan class=\"hljs-property\">util\u003C\u002Fspan>.\u003Cspan class=\"hljs-title function_\">round\u003C\u002Fspan>(n,f)).\u003Cspan class=\"hljs-title function_\">toFixed\u003C\u002Fspan>(f)).\u003Cspan class=\"hljs-title function_\">indexOf\u003C\u002Fspan>(\u003Cspan class=\"hljs-string\">&quot;.&quot;\u003C\u002Fspan>);f=-\u003Cspan class=\"hljs-number\">1\u003C\u002Fspan>!==d?n.\u003Cspan class=\"hljs-title function_\">slice\u003C\u002Fspan>(\u003Cspan class=\"hljs-number\">0\u003C\u002Fspan>,d):n,d=-\u003Cspan class=\"hljs-number\">1\u003C\u002Fspan>!==d?n.\u003Cspan class=\"hljs-title function_\">slice\u003C\u002Fspan>(d+\u003Cspan class=\"hljs-number\">1\u003C\u002Fspan>):\u003Cspan class=\"hljs-string\">&quot;&quot;\u003C\u002Fspan>;\u003Cspan class=\"hljs-keyword\">var\u003C\u002Fspan> p=\u003Cspan class=\"hljs-keyword\">function\u003C\u002Fspan>(\u003Cspan class=\"hljs-params\">t,e,n\u003C\u002Fspan>){\u003Cspan class=\"hljs-keyword\">return\u003C\u002Fspan>(t=t.\u003Cspan class=\"hljs-title function_\">split\u003C\u002Fspan>(\u003Cspan class=\"hljs-string\">&quot;&quot;\u003C\u002Fspan>)).\u003Cspan class=\"hljs-title function_\">splice\u003C\u002Fspan>(e,\u003Cspan class=\"hljs-number\">0\u003C\u002Fspan>,n),t.\u003Cspan class=\"hljs-title function_\">join\u003C\u002Fspan>(\u003Cspan class=\"hljs-string\">&quot;&quot;\u003C\u002Fspan>)},h=f.\u003Cspan class=\"hljs-property\">length\u003C\u002Fspan>,m=h&lt;(c=\u003Cspan class=\"hljs-built_in\">parseInt\u003C\u002Fspan>(c,\u003Cspan class=\"hljs-number\">10\u003C\u002Fspan>));\u003Cspan class=\"hljs-keyword\">if\u003C\u002Fspan>(m){\u003Cspan class=\"hljs-keyword\">var\u003C\u002Fspan> g=c-h;f=\u003Cspan class=\"hljs-title class_\">Array\u003C\u002Fspan>(g+\u003Cspan class=\"hljs-number\">1\u003C\u002Fspan>).\u003Cspan class=\"hljs-title function_\">join\u003C\u002Fspan>(u)+f}\u003Cspan class=\"hljs-keyword\">if\u003C\u002Fspan>(-\u003Cspan class=\"hljs-number\">1\u003C\u002Fspan>===r.\u003Cspan class=\"hljs-title function_\">indexOf\u003C\u002Fspan>(\u003Cspan class=\"hljs-string\">&quot;^&quot;\u003C\u002Fspan>)){\u003Cspan class=\"hljs-keyword\">if\u003C\u002Fspan>(c=a.\u003Cspan class=\"hljs-property\">mon_thousands_sep\u003C\u002Fspan>,(h=a.\u003Cspan class=\"hljs-property\">mon_grouping\u003C\u002Fspan>)[\u003Cspan class=\"hljs-number\">0\u003C\u002Fspan>]&lt;f.\u003Cspan class=\"hljs-property\">length\u003C\u002Fspan>)\u003Cspan class=\"hljs-keyword\">for\u003C\u002Fspan>(\u003Cspan class=\"hljs-keyword\">var\u003C\u002Fspan> _=\u003Cspan class=\"hljs-number\">0\u003C\u002Fspan>,y=f.\u003Cspan class=\"hljs-property\">length\u003C\u002Fspan>;_&lt;h.\u003Cspan class=\"hljs-property\">length\u003C\u002Fspan>&amp;&amp;!(\u003Cspan class=\"hljs-number\">0\u003C\u002Fspan>&gt;=(y-=h[_]));_++)m&amp;&amp;y&lt;g&amp;&amp;(c=u),f=\u003Cspan class=\"hljs-title function_\">p\u003C\u002Fspan>(f,y,c);\u003Cspan class=\"hljs-keyword\">if\u003C\u002Fspan>(\u003Cspan class=\"hljs-number\">0\u003C\u002Fspan>&lt;h[_-\u003Cspan class=\"hljs-number\">1\u003C\u002Fspan>])\u003Cspan class=\"hljs-keyword\">for\u003C\u002Fspan>(;y&gt;h[_-\u003Cspan class=\"hljs-number\">1\u003C\u002Fspan>];)y-=h[_-\u003Cspan class=\"hljs-number\">1\u003C\u002Fspan>],m&amp;&amp;y&lt;g&amp;&amp;(c=u),f=\u003Cspan class=\"hljs-title function_\">p\u003C\u002Fspan>(f,y,c)}\u003Cspan class=\"hljs-keyword\">if\u003C\u002Fspan>(u=d?f+a.\u003Cspan class=\"hljs-property\">mon_decimal_point\u003C\u002Fspan>+\u003Cspan class=\"hljs-attr\">d\u003C\u002Fspan>:f,g=\u003Cspan class=\"hljs-string\">&quot;&quot;\u003C\u002Fspan>,o&amp;&amp;(g=\u003Cspan class=\"hljs-string\">&quot;i&quot;\u003C\u002Fspan>===l?a.\u003Cspan class=\"hljs-property\">int_curr_symbol\u003C\u002Fspan>:a.\u003Cspan class=\"hljs-property\">currency_symbol\u003C\u002Fspan>),l=i?a.\u003Cspan class=\"hljs-property\">n_sign_posn\u003C\u002Fspan>:a.\u003Cspan class=\"hljs-property\">p_sign_posn\u003C\u002Fspan>,_=i?a.\u003Cspan class=\"hljs-property\">n_sep_by_space\u003C\u002Fspan>:a.\u003Cspan class=\"hljs-property\">p_sep_by_space\u003C\u002Fspan>,y=i?a.\u003Cspan class=\"hljs-property\">n_cs_precedes\u003C\u002Fspan>:a.\u003Cspan class=\"hljs-property\">p_cs_precedes\u003C\u002Fspan>,-\u003Cspan class=\"hljs-number\">1\u003C\u002Fspan>!==r.\u003Cspan class=\"hljs-title function_\">indexOf\u003C\u002Fspan>(\u003Cspan class=\"hljs-string\">&quot;(&quot;\u003C\u002Fspan>))t=(y?g+(\u003Cspan class=\"hljs-number\">1\u003C\u002Fspan>===_?\u003Cspan class=\"hljs-string\">&quot; &quot;\u003C\u002Fspan>:\u003Cspan class=\"hljs-string\">&quot;&quot;\u003C\u002Fspan>):\u003Cspan class=\"hljs-string\">&quot;&quot;\u003C\u002Fspan>)+u+(y?\u003Cspan class=\"hljs-string\">&quot;&quot;\u003C\u002Fspan>:(\u003Cspan class=\"hljs-number\">1\u003C\u002Fspan>===_?\u003Cspan class=\"hljs-string\">&quot; &quot;\u003C\u002Fspan>:\u003Cspan class=\"hljs-string\">&quot;&quot;\u003C\u002Fspan>)+g),t=i?\u003Cspan class=\"hljs-string\">&quot;(&quot;\u003C\u002Fspan>+t+\u003Cspan class=\"hljs-string\">&quot;)&quot;\u003C\u002Fspan>:\u003Cspan class=\"hljs-string\">&quot; &quot;\u003C\u002Fspan>+t+\u003Cspan class=\"hljs-string\">&quot; &quot;\u003C\u002Fspan>;\u003Cspan class=\"hljs-keyword\">else\u003C\u002Fspan> \u003Cspan class=\"hljs-keyword\">switch\u003C\u002Fspan>(c=a.\u003Cspan class=\"hljs-property\">positive_sign\u003C\u002Fspan>,o=a.\u003Cspan class=\"hljs-property\">negative_sign\u003C\u002Fspan>,f=i?\u003Cspan class=\"hljs-attr\">o\u003C\u002Fspan>:c,d=\u003Cspan class=\"hljs-string\">&quot;&quot;\u003C\u002Fspan>,l&amp;&amp;(d=\u003Cspan class=\"hljs-title class_\">Array\u003C\u002Fspan>((i?\u003Cspan class=\"hljs-attr\">c\u003C\u002Fspan>:o).\u003Cspan class=\"hljs-property\">length\u003C\u002Fspan>-f.\u003Cspan class=\"hljs-property\">length\u003C\u002Fspan>+\u003Cspan class=\"hljs-number\">1\u003C\u002Fspan>).\u003Cspan class=\"hljs-title function_\">join\u003C\u002Fspan>(\u003Cspan class=\"hljs-string\">&quot; &quot;\u003C\u002Fspan>)),l){\u003Cspan class=\"hljs-keyword\">case\u003C\u002Fspan> \u003Cspan class=\"hljs-number\">0\u003C\u002Fspan>:t=\u003Cspan class=\"hljs-string\">&quot;(&quot;\u003C\u002Fspan>+(y?g+(\u003Cspan class=\"hljs-number\">1\u003C\u002Fspan>===_?\u003Cspan class=\"hljs-string\">&quot; &quot;\u003C\u002Fspan>:\u003Cspan class=\"hljs-string\">&quot;&quot;\u003C\u002Fspan>)+\u003Cspan class=\"hljs-attr\">u\u003C\u002Fspan>:u+(\u003Cspan class=\"hljs-number\">1\u003C\u002Fspan>===_?\u003Cspan class=\"hljs-string\">&quot; &quot;\u003C\u002Fspan>:\u003Cspan class=\"hljs-string\">&quot;&quot;\u003C\u002Fspan>)+g)+\u003Cspan class=\"hljs-string\">&quot;)&quot;\u003C\u002Fspan>;\u003Cspan class=\"hljs-keyword\">break\u003C\u002Fspan>;\u003Cspan class=\"hljs-keyword\">case\u003C\u002Fspan> \u003Cspan class=\"hljs-number\">1\u003C\u002Fspan>:t=d+f+(\u003Cspan class=\"hljs-number\">2\u003C\u002Fspan>===_?\u003Cspan class=\"hljs-string\">&quot; &quot;\u003C\u002Fspan>:\u003Cspan class=\"hljs-string\">&quot;&quot;\u003C\u002Fspan>)+(y?g+(\u003Cspan class=\"hljs-number\">1\u003C\u002Fspan>===_?\u003Cspan class=\"hljs-string\">&quot; &quot;\u003C\u002Fspan>:\u003Cspan class=\"hljs-string\">&quot;&quot;\u003C\u002Fspan>)+\u003Cspan class=\"hljs-attr\">u\u003C\u002Fspan>:u+(\u003Cspan class=\"hljs-number\">1\u003C\u002Fspan>===_?\u003Cspan class=\"hljs-string\">&quot; &quot;\u003C\u002Fspan>:\u003Cspan class=\"hljs-string\">&quot;&quot;\u003C\u002Fspan>)+g);\u003Cspan class=\"hljs-keyword\">break\u003C\u002Fspan>;\u003Cspan class=\"hljs-keyword\">case\u003C\u002Fspan> \u003Cspan class=\"hljs-number\">2\u003C\u002Fspan>:t=(y?g+(\u003Cspan class=\"hljs-number\">1\u003C\u002Fspan>===_?\u003Cspan class=\"hljs-string\">&quot; &quot;\u003C\u002Fspan>:\u003Cspan class=\"hljs-string\">&quot;&quot;\u003C\u002Fspan>)+\u003Cspan class=\"hljs-attr\">u\u003C\u002Fspan>:u+(\u003Cspan class=\"hljs-number\">1\u003C\u002Fspan>===_?\u003Cspan class=\"hljs-string\">&quot; &quot;\u003C\u002Fspan>:\u003Cspan class=\"hljs-string\">&quot;&quot;\u003C\u002Fspan>)+g)+(\u003Cspan class=\"hljs-number\">2\u003C\u002Fspan>===_?\u003Cspan class=\"hljs-string\">&quot; &quot;\u003C\u002Fspan>:\u003Cspan class=\"hljs-string\">&quot;&quot;\u003C\u002Fspan>)+f+d;\u003Cspan class=\"hljs-keyword\">break\u003C\u002Fspan>;\u003Cspan class=\"hljs-keyword\">case\u003C\u002Fspan> \u003Cspan class=\"hljs-number\">3\u003C\u002Fspan>:t=y?d+f+(\u003Cspan class=\"hljs-number\">2\u003C\u002Fspan>===_?\u003Cspan class=\"hljs-string\">&quot; &quot;\u003C\u002Fspan>:\u003Cspan class=\"hljs-string\">&quot;&quot;\u003C\u002Fspan>)+g+(\u003Cspan class=\"hljs-number\">1\u003C\u002Fspan>===_?\u003Cspan class=\"hljs-string\">&quot; &quot;\u003C\u002Fspan>:\u003Cspan class=\"hljs-string\">&quot;&quot;\u003C\u002Fspan>)+\u003Cspan class=\"hljs-attr\">u\u003C\u002Fspan>:u+(\u003Cspan class=\"hljs-number\">1\u003C\u002Fspan>===_?\u003Cspan class=\"hljs-string\">&quot; &quot;\u003C\u002Fspan>:\u003Cspan class=\"hljs-string\">&quot;&quot;\u003C\u002Fspan>)+f+d+(\u003Cspan class=\"hljs-number\">2\u003C\u002Fspan>===_?\u003Cspan class=\"hljs-string\">&quot; &quot;\u003C\u002Fspan>:\u003Cspan class=\"hljs-string\">&quot;&quot;\u003C\u002Fspan>)+g;\u003Cspan class=\"hljs-keyword\">break\u003C\u002Fspan>;\u003Cspan class=\"hljs-keyword\">case\u003C\u002Fspan> \u003Cspan class=\"hljs-number\">4\u003C\u002Fspan>:t=y?g+(\u003Cspan class=\"hljs-number\">2\u003C\u002Fspan>===_?\u003Cspan class=\"hljs-string\">&quot; &quot;\u003C\u002Fspan>:\u003Cspan class=\"hljs-string\">&quot;&quot;\u003C\u002Fspan>)+d+f+(\u003Cspan class=\"hljs-number\">1\u003C\u002Fspan>===_?\u003Cspan class=\"hljs-string\">&quot; &quot;\u003C\u002Fspan>:\u003Cspan class=\"hljs-string\">&quot;&quot;\u003C\u002Fspan>)+\u003Cspan class=\"hljs-attr\">u\u003C\u002Fspan>:u+(\u003Cspan class=\"hljs-number\">1\u003C\u002Fspan>===_?\u003Cspan class=\"hljs-string\">&quot; &quot;\u003C\u002Fspan>:\u003Cspan class=\"hljs-string\">&quot;&quot;\u003C\u002Fspan>)+g+(\u003Cspan class=\"hljs-number\">2\u003C\u002Fspan>===_?\u003Cspan class=\"hljs-string\">&quot; &quot;\u003C\u002Fspan>:\u003Cspan class=\"hljs-string\">&quot;&quot;\u003C\u002Fspan>)+f+d}\u003Cspan class=\"hljs-keyword\">return\u003C\u002Fspan> \u003Cspan class=\"hljs-number\">0\u003C\u002Fspan>&lt;(s-=t.\u003Cspan class=\"hljs-property\">length\u003C\u002Fspan>)&amp;&amp;(s=\u003Cspan class=\"hljs-title class_\">Array\u003C\u002Fspan>(s+\u003Cspan class=\"hljs-number\">1\u003C\u002Fspan>).\u003Cspan class=\"hljs-title function_\">join\u003C\u002Fspan>(\u003Cspan class=\"hljs-string\">&quot; &quot;\u003C\u002Fspan>),t=-\u003Cspan class=\"hljs-number\">1\u003C\u002Fspan>!==r.\u003Cspan class=\"hljs-title function_\">indexOf\u003C\u002Fspan>(\u003Cspan class=\"hljs-string\">&quot;-&quot;\u003C\u002Fspan>)?t+\u003Cspan class=\"hljs-attr\">s\u003C\u002Fspan>:s+t),t}))},e.\u003Cspan class=\"hljs-property\">util\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">round\u003C\u002Fspan>=\u003Cspan class=\"hljs-keyword\">function\u003C\u002Fspan>(\u003Cspan class=\"hljs-params\">t,e\u003C\u002Fspan>){\u003Cspan class=\"hljs-keyword\">var\u003C\u002Fspan> n=\u003Cspan class=\"hljs-title class_\">Math\u003C\u002Fspan>.\u003Cspan class=\"hljs-title function_\">pow\u003C\u002Fspan>(\u003Cspan class=\"hljs-number\">10\u003C\u002Fspan>,e);\u003Cspan class=\"hljs-keyword\">return\u003C\u002Fspan> \u003Cspan class=\"hljs-number\">5\u003C\u002Fspan>&lt;=\u003Cspan class=\"hljs-number\">10\u003C\u002Fspan>*t*n%\u003Cspan class=\"hljs-number\">10\u003C\u002Fspan>&amp;&amp;(t+=\u003Cspan class=\"hljs-number\">1\u003C\u002Fspan>\u002F(\u003Cspan class=\"hljs-number\">10\u003C\u002Fspan>*n)),\u003Cspan class=\"hljs-title class_\">Math\u003C\u002Fspan>.\u003Cspan class=\"hljs-title function_\">round\u003C\u002Fspan>(t*n)\u002Fn}),n.\u003Cspan class=\"hljs-property\">update\u003C\u002Fspan>=\u003Cspan class=\"hljs-keyword\">function\u003C\u002Fspan>(\u003Cspan class=\"hljs-params\">\u003C\u002Fspan>){settings=e.\u003Cspan class=\"hljs-title function_\">hasOwnProperty\u003C\u002Fspan>(\u003Cspan class=\"hljs-string\">&quot;currency_config&quot;\u003C\u002Fspan>)?\u003Cspan class=\"hljs-title class_\">Object\u003C\u002Fspan>.\u003Cspan class=\"hljs-title function_\">assign\u003C\u002Fspan>({},o,e.\u003Cspan class=\"hljs-property\">currency_config\u003C\u002Fspan>):\u003Cspan class=\"hljs-title class_\">Object\u003C\u002Fspan>.\u003Cspan class=\"hljs-title function_\">assign\u003C\u002Fspan>({},o),s=e.\u003Cspan class=\"hljs-title function_\">hasOwnProperty\u003C\u002Fspan>(\u003Cspan class=\"hljs-string\">&quot;session&quot;\u003C\u002Fspan>)&amp;&amp;!\u003Cspan class=\"hljs-number\">0\u003C\u002Fspan>===e.\u003Cspan class=\"hljs-property\">session\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">initialized\u003C\u002Fspan>;\u003Cspan class=\"hljs-keyword\">var\u003C\u002Fspan> t=\u003Cspan class=\"hljs-title function_\">F\u003C\u002Fspan>();!t||e.\u003Cspan class=\"hljs-title function_\">hasOwnProperty\u003C\u002Fspan>(\u003Cspan class=\"hljs-string\">&quot;json&quot;\u003C\u002Fspan>)&amp;&amp;\u003Cspan class=\"hljs-number\">0\u003C\u002Fspan>!=e.\u003Cspan class=\"hljs-property\">json\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">item_count\u003C\u002Fspan>||(e.\u003Cspan class=\"hljs-title function_\">hasOwnProperty\u003C\u002Fspan>(\u003Cspan class=\"hljs-string\">&quot;json&quot;\u003C\u002Fspan>)||(e.\u003Cspan class=\"hljs-property\">json\u003C\u002Fspan>={}),e.\u003Cspan class=\"hljs-property\">json\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">currency_format\u003C\u002Fspan>=t.\u003Cspan class=\"hljs-property\">currency_format\u003C\u002Fspan>,e.\u003Cspan class=\"hljs-property\">json\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">locale_info\u003C\u002Fspan>=t.\u003Cspan class=\"hljs-property\">locale\u003C\u002Fspan>,e.\u003Cspan class=\"hljs-property\">json\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">item_count\u003C\u002Fspan>=\u003Cspan class=\"hljs-number\">0\u003C\u002Fspan>),(t&amp;&amp;!s||s)&amp;&amp;(settings.\u003Cspan class=\"hljs-property\">sets\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">length\u003C\u002Fspan>&gt;\u003Cspan class=\"hljs-number\">1\u003C\u002Fspan>?s?\u003Cspan class=\"hljs-title function_\">c\u003C\u002Fspan>():(\u003Cspan class=\"hljs-title function_\">m\u003C\u002Fspan>(),\u003Cspan class=\"hljs-title function_\">u\u003C\u002Fspan>(!\u003Cspan class=\"hljs-number\">0\u003C\u002Fspan>)):(t||\u003Cspan class=\"hljs-title function_\">O\u003C\u002Fspan>(),\u003Cspan class=\"hljs-title function_\">y\u003C\u002Fspan>()))};\u003Cspan class=\"hljs-keyword\">var\u003C\u002Fspan> A=\u003Cspan class=\"hljs-string\">&quot;function&quot;\u003C\u002Fspan>==\u003Cspan class=\"hljs-keyword\">typeof\u003C\u002Fspan> e.\u003Cspan class=\"hljs-property\">onLoad\u003C\u002Fspan>?e.\u003Cspan class=\"hljs-property\">onLoad\u003C\u002Fspan>:\u003Cspan class=\"hljs-keyword\">function\u003C\u002Fspan>(\u003Cspan class=\"hljs-params\">\u003C\u002Fspan>){};e.\u003Cspan class=\"hljs-property\">onLoad\u003C\u002Fspan>=\u003Cspan class=\"hljs-keyword\">function\u003C\u002Fspan>(\u003Cspan class=\"hljs-params\">\u003C\u002Fspan>){e.\u003Cspan class=\"hljs-property\">client\u003C\u002Fspan>.\u003Cspan class=\"hljs-title function_\">on\u003C\u002Fspan>(\u003Cspan class=\"hljs-string\">&quot;ready.done&quot;\u003C\u002Fspan>,n.\u003Cspan class=\"hljs-property\">update\u003C\u002Fspan>),\u003Cspan class=\"hljs-title function_\">A\u003C\u002Fspan>()},\u003Cspan class=\"hljs-title function_\">t\u003C\u002Fspan>((\u003Cspan class=\"hljs-keyword\">function\u003C\u002Fspan>(\u003Cspan class=\"hljs-params\">\u003C\u002Fspan>){n.\u003Cspan class=\"hljs-title function_\">update\u003C\u002Fspan>(),\u003Cspan class=\"hljs-title function_\">t\u003C\u002Fspan>(\u003Cspan class=\"hljs-string\">&quot;body&quot;\u003C\u002Fspan>).\u003Cspan class=\"hljs-title function_\">on\u003C\u002Fspan>(\u003Cspan class=\"hljs-string\">&quot;click&quot;\u003C\u002Fspan>,\u003Cspan class=\"hljs-string\">&quot;[data-fc-template-set]&quot;\u003C\u002Fspan>,(\u003Cspan class=\"hljs-keyword\">function\u003C\u002Fspan>(\u003Cspan class=\"hljs-params\">e\u003C\u002Fspan>){\u003Cspan class=\"hljs-keyword\">var\u003C\u002Fspan> n=\u003Cspan class=\"hljs-keyword\">function\u003C\u002Fspan>(\u003Cspan class=\"hljs-params\">t\u003C\u002Fspan>){\u003Cspan class=\"hljs-keyword\">for\u003C\u002Fspan>(\u003Cspan class=\"hljs-keyword\">var\u003C\u002Fspan> e=!\u003Cspan class=\"hljs-number\">1\u003C\u002Fspan>,n=\u003Cspan class=\"hljs-number\">0\u003C\u002Fspan>;n&lt;settings.\u003Cspan class=\"hljs-property\">sets\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">length\u003C\u002Fspan>;n++)settings.\u003Cspan class=\"hljs-property\">sets\u003C\u002Fspan>[n].\u003Cspan class=\"hljs-property\">template_set\u003C\u002Fspan>==t&amp;&amp;(e=settings.\u003Cspan class=\"hljs-property\">sets\u003C\u002Fspan>[n]);\u003Cspan class=\"hljs-keyword\">return\u003C\u002Fspan> e}(\u003Cspan class=\"hljs-title function_\">t\u003C\u002Fspan>(\u003Cspan class=\"hljs-variable language_\">this\u003C\u002Fspan>).\u003Cspan class=\"hljs-title function_\">attr\u003C\u002Fspan>(\u003Cspan class=\"hljs-string\">&quot;data-fc-template-set&quot;\u003C\u002Fspan>));n&amp;&amp;(e.\u003Cspan class=\"hljs-title function_\">preventDefault\u003C\u002Fspan>(),s&amp;&amp;\u003Cspan class=\"hljs-title function_\">h\u003C\u002Fspan>(n.\u003Cspan class=\"hljs-property\">template_set\u003C\u002Fspan>))}))})),e.\u003Cspan class=\"hljs-property\">currency\u003C\u002Fspan>=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>\u003C\u002Fpre>\u003C\u002Fdiv>\u003C\u002Fdiv>\u003C\u002Fsection>\u003Csection id=\"step-2-set-up-forms\" data-title=\"Step 2: Set up forms\" data-title-node=\"H2\">\u003Chr class=\"my-8\" style=\"margin-left: -48px; margin-right: -40vw\">\u003Ch2 data-anchor-id=\"step-2-set-up-forms\">Step 2: Set up forms\u003C\u002Fh2>\u003Cp>For the dynamic product total calculation to work, you need to set up your product add to cart forms as follows:\u003C\u002Fp>\u003C\u002Fsection>\u003Csection id=\"product-code\" data-title=\"Product Code\" data-title-node=\"H3\">\u003Ch3 data-anchor-id=\"product-code\">Product Code\u003C\u002Fh3>\u003Cp>Every Foxy based product that you want to dynamically calculate the total for needs to have a unique product code set like this:\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>\u003Cspan class=\"hljs-tag\">&lt;\u003Cspan class=\"hljs-name\">input\u003C\u002Fspan> \u003Cspan class=\"hljs-attr\">type\u003C\u002Fspan>=\u003Cspan class=\"hljs-string\">&quot;hidden&quot;\u003C\u002Fspan> \u003Cspan class=\"hljs-attr\">name\u003C\u002Fspan>=\u003Cspan class=\"hljs-string\">&quot;code&quot;\u003C\u002Fspan> \u003Cspan class=\"hljs-attr\">value\u003C\u002Fspan>=\u003Cspan class=\"hljs-string\">&quot;mycode&quot;\u003C\u002Fspan> \u002F&gt;\u003C\u002Fspan>\u003C\u002Fpre>\u003C\u002Fdiv>\u003C\u002Fdiv>\u003Cp>If you have multiple products within a single form, the code from the first product in your form will be used as the code for the form. If you&#039;re not able to know what product code is first, or you just want to set a specific code to use for the price modifier without relying on the product&#039;s code, you can also add a data attribute to your form like this:\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>\u003Cspan class=\"hljs-tag\">&lt;\u003Cspan class=\"hljs-name\">form\u003C\u002Fspan> \u003Cspan class=\"hljs-attr\">...\u003C\u002Fspan> \u003Cspan class=\"hljs-attr\">data-fc-form-code\u003C\u002Fspan>=\u003Cspan class=\"hljs-string\">&quot;mycode&quot;\u003C\u002Fspan>&gt;\u003C\u002Fspan>\u003C\u002Fpre>\u003C\u002Fdiv>\u003C\u002Fdiv>\u003C\u002Fsection>\u003Csection id=\"total-price-element\" data-title=\"Total Price Element\" data-title-node=\"H3\">\u003Ch3 data-anchor-id=\"total-price-element\">Total Price Element\u003C\u002Fh3>\u003Cp>Next, set an element for where the total product cost is shown and updated, by combining the code from above and \u003Ccode class=\"badge bg-soft-danger text-danger\">-total\u003C\u002Fcode> as its class, like this:\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>\u003Cspan class=\"hljs-tag\">&lt;\u003Cspan class=\"hljs-name\">h4\u003C\u002Fspan> \u003Cspan class=\"hljs-attr\">class\u003C\u002Fspan>=\u003Cspan class=\"hljs-string\">&quot;mycode-total&quot;\u003C\u002Fspan>&gt;\u003C\u002Fspan>$20.00\u003Cspan class=\"hljs-tag\">&lt;\u002F\u003Cspan class=\"hljs-name\">h4\u003C\u002Fspan>&gt;\u003C\u002Fspan>\u003C\u002Fpre>\u003C\u002Fdiv>\u003C\u002Fdiv>\u003Cp>If you&#039;d like to show the total quantity, you can also do that using an element with a class that is a combination of the code and \u003Ccode class=\"badge bg-soft-danger text-danger\">-total-quantity\u003C\u002Fcode> as its class, like this:\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>\u003Cspan class=\"hljs-tag\">&lt;\u003Cspan class=\"hljs-name\">p\u003C\u002Fspan> \u003Cspan class=\"hljs-attr\">class\u003C\u002Fspan>=\u003Cspan class=\"hljs-string\">&quot;mycode-total-quantity&quot;\u003C\u002Fspan>&gt;\u003C\u002Fspan>0\u003Cspan class=\"hljs-tag\">&lt;\u002F\u003Cspan class=\"hljs-name\">p\u003C\u002Fspan>&gt;\u003C\u002Fspan>\u003C\u002Fpre>\u003C\u002Fdiv>\u003C\u002Fdiv>\u003Cp>You can also use classes with underscores instead if needed, such as \u003Ccode class=\"badge bg-soft-danger text-danger\">mycode_total\u003C\u002Fcode> and \u003Ccode class=\"badge bg-soft-danger text-danger\">mycode_total_quantity\u003C\u002Fcode>.\u003C\u002Fp>\u003C\u002Fsection>\u003Csection id=\"product-price-element\" data-title=\"Product Price Element\" data-title-node=\"H3\">\u003Ch3 data-anchor-id=\"product-price-element\">Product Price Element\u003C\u002Fh3>\u003Cp>As with a normal Foxy product form, the \u003Ccode class=\"badge bg-soft-danger text-danger\">name\u003C\u002Fcode> and \u003Ccode class=\"badge bg-soft-danger text-danger\">price\u003C\u002Fcode> inputs are required. The snippet will use the \u003Ccode class=\"badge bg-soft-danger text-danger\">price\u003C\u002Fcode> inputs in the form to determine the base prices for the products present.\u003C\u002Fp>\u003Cp>If you wanted to specify a different currency for that product than your store&#039;s default currency as the starting base price, you can append the currency code to the price (like \u003Ccode class=\"badge bg-soft-danger text-danger\">29.95eur\u003C\u002Fcode> for €29,95). It will use that currency as the base currency for all products within that form, so ensure that if you take this approach, all prices (including product option modifiers) are in that currency.\u003C\u002Fp>\u003C\u002Fsection>\u003Csection id=\"step-3-configuration-for-currency-conversion\" data-title=\"Step 3: Configuration for currency conversion\" data-title-node=\"H2\">\u003Chr class=\"my-8\" style=\"margin-left: -48px; margin-right: -40vw\">\u003Ch2 data-anchor-id=\"step-3-configuration-for-currency-conversion\">Step 3: Configuration for currency conversion\u003C\u002Fh2>\u003Cp>By default, the snippet will just handle calculating the dynamic product price. It can also support dynamically converting your product prices to different currencies, as well as automatically assigning a currency based on the location of a customer.\u003C\u002Fp>\u003Cblockquote>\u003Cp>\u003Cstrong>Note:\u003C\u002Fstrong> The dynamic currency conversion feature relies on your store having multiple template sets configured. If you haven&#039;t set up multiple template sets on your Foxy store yet, you can see information on creating those here.\u003C\u002Fp>\u003C\u002Fblockquote>\u003Cp>If you&#039;d like to also enable multiple currencies for your product prices, the snippet includes a number of options for configuring this functionality. The configuration is applied with javascript through an object variable of \u003Ccode class=\"badge bg-soft-danger text-danger\">FC.currency_config\u003C\u002Fcode>. These are the different configuration options available:\u003C\u002Fp>\u003Cul>\u003Cli>\u003Cp>\u003Ccode class=\"badge bg-soft-danger text-danger\">base\u003C\u002Fcode> \u003Cstrong>Accepts:\u003C\u002Fstrong> String, 3 character currency code \u003Cstrong>Description:\u003C\u002Fstrong> Set to the currency that your product prices are in by default. Required for dynamic currency conversion.\u003C\u002Fp>\u003C\u002Fli>\u003Cli>\u003Cp>\u003Ccode class=\"badge bg-soft-danger text-danger\">sets\u003C\u002Fcode> \u003Cstrong>Accepts:\u003C\u002Fstrong> Array of different currencies available for your store \u003Cstrong>Description:\u003C\u002Fstrong> This array will contain the details for each template set configured on \u003Cstrong>Settings &gt; Templates\u003C\u002Fstrong> that you want to use on your store. Each object in the array includes three variables, \u003Ccode class=\"badge bg-soft-danger text-danger\">currency\u003C\u002Fcode>, \u003Ccode class=\"badge bg-soft-danger text-danger\">template_set\u003C\u002Fcode> and \u003Ccode class=\"badge bg-soft-danger text-danger\">countries\u003C\u002Fcode>. Required when using dynamic currency conversion.\u003C\u002Fp>\u003C\u002Fli>\u003Cli>\u003Cp>\u003Ccode class=\"badge bg-soft-danger text-danger\">sets.currency\u003C\u002Fcode> \u003Cstrong>Accepts:\u003C\u002Fstrong> String, 3 character currency code \u003Cstrong>Description:\u003C\u002Fstrong> Set to the currency that this particular template set uses. Required when including \u003Ccode class=\"badge bg-soft-danger text-danger\">sets\u003C\u002Fcode>.\u003C\u002Fp>\u003C\u002Fli>\u003Cli>\u003Cp>\u003Ccode class=\"badge bg-soft-danger text-danger\">sets.template_set\u003C\u002Fcode> \u003Cstrong>Accepts:\u003C\u002Fstrong> String, Template set code \u003Cstrong>Description:\u003C\u002Fstrong> Set to the code of the template set, as set on \u003Cstrong>Settings &gt; Templates\u003C\u002Fstrong>. Required when including \u003Ccode class=\"badge bg-soft-danger text-danger\">sets\u003C\u002Fcode>.\u003C\u002Fp>\u003C\u002Fli>\u003Cli>\u003Cp>\u003Ccode class=\"badge bg-soft-danger text-danger\">sets.countries\u003C\u002Fcode> \u003Cstrong>Accepts:\u003C\u002Fstrong> Array of 2 character country codes \u003Cstrong>Description:\u003C\u002Fstrong> A list of countries that will automatically be set to this template set on initial page load. If a customer visits that doesn&#039;t match any country in a set, then it will switch to the \u003Ccode class=\"badge bg-soft-danger text-danger\">DEFAULT\u003C\u002Fcode> template set. If not set, this template set will not be set automatically, but could be selected manually.\u003C\u002Fp>\u003C\u002Fli>\u003Cli>\u003Cp>\u003Ccode class=\"badge bg-soft-danger text-danger\">max_rate_cache\u003C\u002Fcode> \u003Cstrong>Accepts:\u003C\u002Fstrong> Number \u003Cstrong>Description:\u003C\u002Fstrong> The number of hours that the rates should be cached before being refreshed. Defaults to 12 hours.\u003C\u002Fp>\u003C\u002Fli>\u003Cli>\u003Cp>\u003Ccode class=\"badge bg-soft-danger text-danger\">rounding\u003C\u002Fcode> \u003Cstrong>Accepts:\u003C\u002Fstrong> \u003Ccode class=\"badge bg-soft-danger text-danger\">full\u003C\u002Fcode>, \u003Ccode class=\"badge bg-soft-danger text-danger\">half\u003C\u002Fcode>, \u003Ccode class=\"badge bg-soft-danger text-danger\">minimal\u003C\u002Fcode>, \u003Ccode class=\"badge bg-soft-danger text-danger\">none\u003C\u002Fcode> \u003Cstrong>Description:\u003C\u002Fstrong> Configure how the prices should be rounded when being converted. \u003Ccode class=\"badge bg-soft-danger text-danger\">full\u003C\u002Fcode> will round up to the nearest whole number, \u003Ccode class=\"badge bg-soft-danger text-danger\">half\u003C\u002Fcode> will round up to the nearest \u003Ccode class=\"badge bg-soft-danger text-danger\">.50\u003C\u002Fcode>, \u003Ccode class=\"badge bg-soft-danger text-danger\">minimal\u003C\u002Fcode> will round up to the nearest \u003Ccode class=\"badge bg-soft-danger text-danger\">0.05\u003C\u002Fcode> and \u003Ccode class=\"badge bg-soft-danger text-danger\">none\u003C\u002Fcode> will not round at all. Default is \u003Ccode class=\"badge bg-soft-danger text-danger\">minimal\u003C\u002Fcode>\u003C\u002Fp>\u003C\u002Fli>\u003Cli>\u003Cp>\u003Ccode class=\"badge bg-soft-danger text-danger\">active_class\u003C\u002Fcode> \u003Cstrong>Accepts:\u003C\u002Fstrong> String \u003Cstrong>Description:\u003C\u002Fstrong> Customise what class is added to the template set selectors for the current active template set. Default is \u003Ccode class=\"badge bg-soft-danger text-danger\">active\u003C\u002Fcode>\u003C\u002Fp>\u003C\u002Fli>\u003Cli>\u003Cp>\u003Ccode class=\"badge bg-soft-danger text-danger\">use_openexchangerates\u003C\u002Fcode> \u003Cstrong>Accepts:\u003C\u002Fstrong> String \u003Cstrong>Description:\u003C\u002Fstrong> Set to the API key for your OpenExchangeRates account if you would prefer to use it instead of the default \u003Ca href=\"https:\u002F\u002Ffloatrates.com\" target=\"_blank\" rel=\"noopener noreferrer\" class=\"\">https:\u002F\u002Ffloatrates.com\u003C\u002Fa> source for currency rates.\u003C\u002Fp>\u003C\u002Fli>\u003Cli>\u003Cp>\u003Ccode class=\"badge bg-soft-danger text-danger\">adjust_price_display\u003C\u002Fcode> \u003Cstrong>Accepts:\u003C\u002Fstrong> Function \u003Cstrong>Description:\u003C\u002Fstrong> Create a function to modify only the price displayed on the page, for example to make a tax exclusive price in your add to cart to be displayed as tax inclusive to the customer. The function is passed a single argument for the price to be modified, and the function must return the modified price as well.\u003C\u002Fp>\u003C\u002Fli>\u003C\u002Ful>\u003Cblockquote>\u003Cp>\u003Cstrong>Tip:\u003C\u002Fstrong> All of the configuration options are optional, but to offer dynamic currency conversion \u003Ccode class=\"badge bg-soft-danger text-danger\">base\u003C\u002Fcode> and \u003Ccode class=\"badge bg-soft-danger text-danger\">sets\u003C\u002Fcode> are required.\u003C\u002Fp>\u003C\u002Fblockquote>\u003Cp>As an example, assume you had four template sets on your store. The store&#039;s DEFAULT template set is configured for USD, as are the product prices on the website by default, but there are also template sets for CAD, as well as Euro in both French and German languages. Your configuration could look like this, included above the snippet from step 1:\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>\u003Cspan class=\"hljs-tag\">&lt;\u003Cspan class=\"hljs-name\">script\u003C\u002Fspan>&gt;\u003C\u002Fspan>\u003Cspan class=\"language-javascript\">\n\u003Cspan class=\"hljs-keyword\">var\u003C\u002Fspan> \u003Cspan class=\"hljs-variable constant_\">FC\u003C\u002Fspan> = \u003Cspan class=\"hljs-variable constant_\">FC\u003C\u002Fspan> || {};\n\u003Cspan class=\"hljs-variable constant_\">FC\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">currency_config\u003C\u002Fspan> = {\n    \u003Cspan class=\"hljs-string\">&#x27;base&#x27;\u003C\u002Fspan>: \u003Cspan class=\"hljs-string\">&#x27;USD&#x27;\u003C\u002Fspan>,\n    \u003Cspan class=\"hljs-string\">&#x27;sets&#x27;\u003C\u002Fspan>: [\n        {\n            \u003Cspan class=\"hljs-string\">&#x27;currency&#x27;\u003C\u002Fspan>: \u003Cspan class=\"hljs-string\">&#x27;USD&#x27;\u003C\u002Fspan>,\n            \u003Cspan class=\"hljs-string\">&#x27;template_set&#x27;\u003C\u002Fspan>: \u003Cspan class=\"hljs-string\">&#x27;DEFAULT&#x27;\u003C\u002Fspan>,\n            \u003Cspan class=\"hljs-string\">&#x27;countries&#x27;\u003C\u002Fspan>: [\u003Cspan class=\"hljs-string\">&#x27;US&#x27;\u003C\u002Fspan>]\n        },\n        {\n            \u003Cspan class=\"hljs-string\">&#x27;currency&#x27;\u003C\u002Fspan>: \u003Cspan class=\"hljs-string\">&#x27;CAD&#x27;\u003C\u002Fspan>,\n            \u003Cspan class=\"hljs-string\">&#x27;template_set&#x27;\u003C\u002Fspan>: \u003Cspan class=\"hljs-string\">&#x27;Canada&#x27;\u003C\u002Fspan>,\n            \u003Cspan class=\"hljs-string\">&#x27;countries&#x27;\u003C\u002Fspan>: [\u003Cspan class=\"hljs-string\">&#x27;CA&#x27;\u003C\u002Fspan>]\n        },\n        {\n            \u003Cspan class=\"hljs-string\">&#x27;currency&#x27;\u003C\u002Fspan>: \u003Cspan class=\"hljs-string\">&#x27;EUR&#x27;\u003C\u002Fspan>,\n            \u003Cspan class=\"hljs-string\">&#x27;template_set&#x27;\u003C\u002Fspan>: \u003Cspan class=\"hljs-string\">&#x27;Germany&#x27;\u003C\u002Fspan>,\n            \u003Cspan class=\"hljs-string\">&#x27;countries&#x27;\u003C\u002Fspan>: [\u003Cspan class=\"hljs-string\">&#x27;DE&#x27;\u003C\u002Fspan>, \u003Cspan class=\"hljs-string\">&#x27;BE&#x27;\u003C\u002Fspan>]\n        },\n        {\n            \u003Cspan class=\"hljs-string\">&#x27;currency&#x27;\u003C\u002Fspan>: \u003Cspan class=\"hljs-string\">&#x27;EUR&#x27;\u003C\u002Fspan>,\n            \u003Cspan class=\"hljs-string\">&#x27;template_set&#x27;\u003C\u002Fspan>: \u003Cspan class=\"hljs-string\">&#x27;France&#x27;\u003C\u002Fspan>,\n            \u003Cspan class=\"hljs-string\">&#x27;countries&#x27;\u003C\u002Fspan>: [\u003Cspan class=\"hljs-string\">&#x27;FR&#x27;\u003C\u002Fspan>]\n        },\n    ]\n};\n\u003C\u002Fspan>\u003Cspan class=\"hljs-tag\">&lt;\u002F\u003Cspan class=\"hljs-name\">script\u003C\u002Fspan>&gt;\u003C\u002Fspan>\u003C\u002Fpre>\u003C\u002Fdiv>\u003C\u002Fdiv>\u003Cp>If a customer from Germany or Belgium visits your website, it will automatically apply the template set from your store with a code of \u003Ccode class=\"badge bg-soft-danger text-danger\">Germany\u003C\u002Fcode>, and then convert the prices to all be in Euro. If someone visits from Canada, then it will update to the \u003Ccode class=\"badge bg-soft-danger text-danger\">Canada\u003C\u002Fcode> template set, and change the prices to Canadian dollars.\u003C\u002Fp>\u003Cp>If curreny conversion is enabled for the snippet, then any \u003Ccode class=\"badge bg-soft-danger text-danger\">price\u003C\u002Fcode> and \u003Ccode class=\"badge bg-soft-danger text-danger\">p\u003C\u002Fcode> product option modifiers will be dynamically converted to the current currency of the cart, rounding as specified by the \u003Ccode class=\"badge bg-soft-danger text-danger\">rounding\u003C\u002Fcode> configuration option.\u003C\u002Fp>\u003Cp>Here is an example with all configuration options for the snippet:\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>\u003Cspan class=\"hljs-tag\">&lt;\u003Cspan class=\"hljs-name\">script\u003C\u002Fspan>&gt;\u003C\u002Fspan>\u003Cspan class=\"language-javascript\">\n\u003Cspan class=\"hljs-keyword\">var\u003C\u002Fspan> \u003Cspan class=\"hljs-variable constant_\">FC\u003C\u002Fspan> = \u003Cspan class=\"hljs-variable constant_\">FC\u003C\u002Fspan> || {};\n\u003Cspan class=\"hljs-variable constant_\">FC\u003C\u002Fspan>.\u003Cspan class=\"hljs-property\">currency_config\u003C\u002Fspan> = {\n    \u003Cspan class=\"hljs-string\">&#x27;base&#x27;\u003C\u002Fspan>: \u003Cspan class=\"hljs-string\">&#x27;USD&#x27;\u003C\u002Fspan>,\n    \u003Cspan class=\"hljs-string\">&#x27;sets&#x27;\u003C\u002Fspan>: [\n        {\n            \u003Cspan class=\"hljs-string\">&#x27;currency&#x27;\u003C\u002Fspan>: \u003Cspan class=\"hljs-string\">&#x27;USD&#x27;\u003C\u002Fspan>,\n            \u003Cspan class=\"hljs-string\">&#x27;template_set&#x27;\u003C\u002Fspan>: \u003Cspan class=\"hljs-string\">&#x27;DEFAULT&#x27;\u003C\u002Fspan>,\n            \u003Cspan class=\"hljs-string\">&#x27;countries&#x27;\u003C\u002Fspan>: [\u003Cspan class=\"hljs-string\">&#x27;US&#x27;\u003C\u002Fspan>]\n        },\n        {\n            \u003Cspan class=\"hljs-string\">&#x27;currency&#x27;\u003C\u002Fspan>: \u003Cspan class=\"hljs-string\">&#x27;CAD&#x27;\u003C\u002Fspan>,\n            \u003Cspan class=\"hljs-string\">&#x27;template_set&#x27;\u003C\u002Fspan>: \u003Cspan class=\"hljs-string\">&#x27;Canada&#x27;\u003C\u002Fspan>,\n            \u003Cspan class=\"hljs-string\">&#x27;countries&#x27;\u003C\u002Fspan>: [\u003Cspan class=\"hljs-string\">&#x27;CA&#x27;\u003C\u002Fspan>]\n        }\n    ],\n    \u003Cspan class=\"hljs-string\">&#x27;max_rate_cache&#x27;\u003C\u002Fspan>: \u003Cspan class=\"hljs-number\">12\u003C\u002Fspan>,\n    \u003Cspan class=\"hljs-string\">&#x27;rounding&#x27;\u003C\u002Fspan>: \u003Cspan class=\"hljs-string\">&#x27;half&#x27;\u003C\u002Fspan>,\n    \u003Cspan class=\"hljs-string\">&#x27;active_class&#x27;\u003C\u002Fspan>: \u003Cspan class=\"hljs-string\">&#x27;currency-option-active&#x27;\u003C\u002Fspan>,\n    \u003Cspan class=\"hljs-string\">&#x27;use_openexchangerates&#x27;\u003C\u002Fspan>: \u003Cspan class=\"hljs-string\">&#x27;abc123abc123abc123&#x27;\u003C\u002Fspan>,\n    \u003Cspan class=\"hljs-string\">&#x27;adjust_price_display&#x27;\u003C\u002Fspan>: \u003Cspan class=\"hljs-keyword\">function\u003C\u002Fspan>(\u003Cspan class=\"hljs-params\">price\u003C\u002Fspan>) { \u003Cspan class=\"hljs-keyword\">return\u003C\u002Fspan> price * \u003Cspan class=\"hljs-number\">1.25\u003C\u002Fspan>; }\n};\n\u003C\u002Fspan>\u003Cspan class=\"hljs-tag\">&lt;\u002F\u003Cspan class=\"hljs-name\">script\u003C\u002Fspan>&gt;\u003C\u002Fspan>\u003C\u002Fpre>\u003C\u002Fdiv>\u003C\u002Fdiv>\u003Cblockquote>\u003Cp>\u003Cstrong>Important:\u003C\u002Fstrong> \u003Cstrong>Note:\u003C\u002Fstrong> The above is simply an example of what it looks like with all attributes for the configuration option. You will not want to copy this to use directly in your set up, but rather review each configuration option and only add them if you actually need them.\u003C\u002Fp>\u003C\u002Fblockquote>\u003Cblockquote>\u003Cp>\u003Cstrong>Note:\u003C\u002Fstrong> By default this snippet will pull the currency conversion rates from \u003Ca href=\"https:\u002F\u002Ffloatrates.com\" target=\"_blank\" rel=\"noopener noreferrer\" class=\"\">floatrates.com\u003C\u002Fa>. It does also support \u003Ca href=\"https:\u002F\u002Fopenexchangerates.org\u002F\" target=\"_blank\" rel=\"noopener noreferrer\" class=\"\">Open Exchange Rates\u003C\u002Fa> (which is also what we use for our own default currency conversion in the cart), but you&#039;ll need to create your own account and specify your API key using the \u003Ccode class=\"badge bg-soft-danger text-danger\">use_openexchangerates\u003C\u002Fcode> configuration option.\u003C\u002Fp>\u003C\u002Fblockquote>\u003C\u002Fsection>\u003Csection id=\"step-4-set-up-a-currency-switcher\" data-title=\"Step 4: Set up a currency switcher\" data-title-node=\"H2\">\u003Chr class=\"my-8\" style=\"margin-left: -48px; margin-right: -40vw\">\u003Ch2 data-anchor-id=\"step-4-set-up-a-currency-switcher\">Step 4: Set up a currency switcher\u003C\u002Fh2>\u003Cp>Although the snippet will automatically set a customers template set based on their location, you&#039;ll probably also want to allow customers to switch template sets on the fly, or perhaps have a modal window that displays to allow them to select an option.\u003C\u002Fp>\u003Cp>You can set up your currency switcher however you want - it just requires a data attribute of \u003Ccode class=\"badge bg-soft-danger text-danger\">data-fc-template-set\u003C\u002Fcode> be added to each link that designates what currency set it is for from your configuration from step 3.\u003C\u002Fp>\u003Cp>For example, to have a link use the German Euro template set from the earlier example, you would add a data attribute of \u003Ccode class=\"badge bg-soft-danger text-danger\">data-fc-template-set=&quot;Germany&quot;\u003C\u002Fcode> to the link element.\u003C\u002Fp>\u003Cp>Here&#039;s an example of what the currency switcher could look like:\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>\u003Cspan class=\"hljs-tag\">&lt;\u003Cspan class=\"hljs-name\">p\u003C\u002Fspan>&gt;\u003C\u002Fspan>Select a locale: \u003Cspan class=\"hljs-tag\">&lt;\u003Cspan class=\"hljs-name\">a\u003C\u002Fspan> \u003Cspan class=\"hljs-attr\">data-fc-template-set\u003C\u002Fspan>=\u003Cspan class=\"hljs-string\">&quot;DEFAULT&quot;\u003C\u002Fspan> \u003Cspan class=\"hljs-attr\">href\u003C\u002Fspan>=\u003Cspan class=\"hljs-string\">&quot;#&quot;\u003C\u002Fspan>&gt;\u003C\u002Fspan>USD\u003Cspan class=\"hljs-tag\">&lt;\u002F\u003Cspan class=\"hljs-name\">a\u003C\u002Fspan>&gt;\u003C\u002Fspan> |  \u003Cspan class=\"hljs-tag\">&lt;\u003Cspan class=\"hljs-name\">a\u003C\u002Fspan> \u003Cspan class=\"hljs-attr\">data-fc-template-set\u003C\u002Fspan>=\u003Cspan class=\"hljs-string\">&quot;Canada&quot;\u003C\u002Fspan> \u003Cspan class=\"hljs-attr\">href\u003C\u002Fspan>=\u003Cspan class=\"hljs-string\">&quot;#&quot;\u003C\u002Fspan>&gt;\u003C\u002Fspan>CAD\u003Cspan class=\"hljs-tag\">&lt;\u002F\u003Cspan class=\"hljs-name\">a\u003C\u002Fspan>&gt;\u003C\u002Fspan> | \u003Cspan class=\"hljs-tag\">&lt;\u003Cspan class=\"hljs-name\">a\u003C\u002Fspan> \u003Cspan class=\"hljs-attr\">data-fc-template-set\u003C\u002Fspan>=\u003Cspan class=\"hljs-string\">&quot;Germany&quot;\u003C\u002Fspan> \u003Cspan class=\"hljs-attr\">href\u003C\u002Fspan>=\u003Cspan class=\"hljs-string\">&quot;#&quot;\u003C\u002Fspan>&gt;\u003C\u002Fspan>EUR (DE)\u003Cspan class=\"hljs-tag\">&lt;\u002F\u003Cspan class=\"hljs-name\">a\u003C\u002Fspan>&gt;\u003C\u002Fspan> | \u003Cspan class=\"hljs-tag\">&lt;\u003Cspan class=\"hljs-name\">a\u003C\u002Fspan> \u003Cspan class=\"hljs-attr\">data-fc-template-set\u003C\u002Fspan>=\u003Cspan class=\"hljs-string\">&quot;France&quot;\u003C\u002Fspan> \u003Cspan class=\"hljs-attr\">href\u003C\u002Fspan>=\u003Cspan class=\"hljs-string\">&quot;#&quot;\u003C\u002Fspan>&gt;\u003C\u002Fspan>EUR (FR)\u003Cspan class=\"hljs-tag\">&lt;\u002F\u003Cspan class=\"hljs-name\">a\u003C\u002Fspan>&gt;\u003C\u002Fspan>\u003Cspan class=\"hljs-tag\">&lt;\u002F\u003Cspan class=\"hljs-name\">p\u003C\u002Fspan>&gt;\u003C\u002Fspan>\u003C\u002Fpre>\u003C\u002Fdiv>\u003C\u002Fdiv>\u003Cp>The \u003Ccode class=\"badge bg-soft-danger text-danger\">data-fc-template-set\u003C\u002Fcode> value needs to match the \u003Ccode class=\"badge bg-soft-danger text-danger\">template_set\u003C\u002Fcode> from the \u003Ccode class=\"badge bg-soft-danger text-danger\">FC.currency_config.sets\u003C\u002Fcode> configuration option.\u003C\u002Fp>\u003Cp>For styling - note that whichever template set is active will have a class added. By default the added class will be \u003Ccode class=\"badge bg-soft-danger text-danger\">active\u003C\u002Fcode>, but you can customise that using the \u003Ccode class=\"badge bg-soft-danger text-danger\">active_class\u003C\u002Fcode> configuration option.\u003C\u002Fp>\u003C\u002Fsection>\u003Csection id=\"step-5-allowing-currency-conversion-for-other-prices\" data-title=\"Step 5: Allowing currency conversion for other prices\" data-title-node=\"H2\">\u003Chr class=\"my-8\" style=\"margin-left: -48px; margin-right: -40vw\">\u003Ch2 data-anchor-id=\"step-5-allowing-currency-conversion-for-other-prices\">Step 5: Allowing currency conversion for other prices\u003C\u002Fh2>\u003Cp>You may also have some prices listed on your site outside of your add to cart forms. For example, on a category listing page. To have these prices be converted to the currency of the cart, you just need to add a class to the element of \u003Ccode class=\"badge bg-soft-danger text-danger\">.fc-currency-price\u003C\u002Fcode>, and the snippet will take care of the rest. For example:\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>\u003Cspan class=\"hljs-tag\">&lt;\u003Cspan class=\"hljs-name\">h4\u003C\u002Fspan> \u003Cspan class=\"hljs-attr\">class\u003C\u002Fspan>=\u003Cspan class=\"hljs-string\">&quot;fc-currency-price&quot;\u003C\u002Fspan>&gt;\u003C\u002Fspan>$15.99\u003Cspan class=\"hljs-tag\">&lt;\u002F\u003Cspan class=\"hljs-name\">h4\u003C\u002Fspan>&gt;\u003C\u002Fspan>\u003C\u002Fpre>\u003C\u002Fdiv>\u003C\u002Fdiv>\u003C\u002Fsection>\u003Csection id=\"that039s-it\" data-title=\"That&#039;s it!\" data-title-node=\"H2\">\u003Chr class=\"my-8\" style=\"margin-left: -48px; margin-right: -40vw\">\u003Ch2 data-anchor-id=\"that039s-it\">That&#039;s it!\u003C\u002Fh2>\u003Cp>That should be it. Give your site a test and confirm that everything is working as you expect it to.\u003C\u002Fp>\u003C\u002Fsection>\u003Csection id=\"advanced-dynamically-triggering-recalculation\" data-title=\"Advanced: Dynamically triggering recalculation\" data-title-node=\"H2\">\u003Chr class=\"my-8\" style=\"margin-left: -48px; margin-right: -40vw\">\u003Ch2 data-anchor-id=\"advanced-dynamically-triggering-recalculation\">Advanced: Dynamically triggering recalculation\u003C\u002Fh2>\u003Cp>If for whatever reason you need to trigger the dynamic price calculations to be recreated - for example if you dynamically add in a new input that includes a price modifier, you can execute this function in your 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.currency.update();\u003C\u002Fpre>\u003C\u002Fdiv>\u003C\u002Fdiv>\u003C\u002Fsection>\u003Csection id=\"notes-and-limitations\" data-title=\"Notes and Limitations\" data-title-node=\"H2\">\u003Chr class=\"my-8\" style=\"margin-left: -48px; margin-right: -40vw\">\u003Ch2 data-anchor-id=\"notes-and-limitations\">Notes and Limitations\u003C\u002Fh2>\u003Cul>\u003Cli>\u003Cp>On the first time this snippet is run, it is run \u003Cstrong>after\u003C\u002Fstrong> the Foxy javascript has been initialized. As such - there may be a small time while the page is loading before the dynamic total is calculated. The snippet then uses your browser&#039;s \u003Ccode class=\"badge bg-soft-danger text-danger\">localStorage\u003C\u002Fcode> to store key information to execute on page load for subsequent pages to minimise any delay on converting.\u003C\u002Fp>\u003C\u002Fli>\u003Cli>\u003Cp>Currently only product \u003Ccode class=\"badge bg-soft-danger text-danger\">price\u003C\u002Fcode> inputs and price product option modifiers are converted. Product level discounts are not currently converted.\u003C\u002Fp>\u003C\u002Fli>\u003Cli>\u003Cp>Product links are also not currently converted.\u003C\u002Fp>\u003C\u002Fli>\u003C\u002Ful>\u003C\u002Fsection>",[1193,1196,1198,1201,1203,1205,1207,1209,1211,1213,1215],{"id":1194,"title":381,"level":1195},"step-1-include-snippet","H2",{"id":1197,"title":429,"level":1195},"step-2-set-up-forms",{"id":1199,"title":440,"level":1200},"product-code","H3",{"id":1202,"title":465,"level":1200},"total-price-element",{"id":1204,"title":518,"level":1200},"product-price-element",{"id":1206,"title":555,"level":1195},"step-3-configuration-for-currency-conversion",{"id":1208,"title":1015,"level":1195},"step-4-set-up-a-currency-switcher",{"id":1210,"title":1091,"level":1195},"step-5-allowing-currency-conversion-for-other-prices",{"id":1212,"title":1112,"level":1195},"that039s-it",{"id":1214,"title":1122,"level":1195},"advanced-dynamically-triggering-recalculation",{"id":1216,"title":1137,"level":1195},"notes-and-limitations",[1218],{"type":1219,"content":1220},"html","\u003Cp>For stores looking to support multiple different currencies, it&#039;s important to be able to show product prices in those different currencies. This helps customers to be able to know exactly what they&#039;ll be paying - rather than needing to do those calculations themselves.\u003C\u002Fp>\u003Cp>Not all website builders and CMS&#039;s support setting multiple prices for a single product though, so you can be limited to just a single currency that you can display your prices in.\u003C\u002Fp>\u003Cp>The following snippet will allow you to add the following functionality to your website:\u003C\u002Fp>\u003Cul>\u003Cli>\u003Cp>Dynamically set the template set for the cart on initial page load, based on the location of the customer, which will set the locale, language and currency of the cart.\u003C\u002Fp>\u003C\u002Fli>\u003Cli>\u003Cp>Convert the prices and price modifiers in all product add to cart forms to the cart currency\u003C\u002Fp>\u003C\u002Fli>\u003Cli>\u003Cp>Convert all prices displayed to customers to the cart currency\u003C\u002Fp>\u003C\u002Fli>\u003Cli>\u003Cp>Display a dynamic product total, taking into consideration a change in quantity or product options that include a price modifier.\u003C\u002Fp>\u003C\u002Fli>\u003C\u002Ful>\u003Ch2>Step 1: Include snippet\u003C\u002Fh2>\u003Cp>Paste the following code before the closing \u003Ccode class=\"badge bg-soft-danger text-danger\">&lt;\u002Fbody&gt;\u003C\u002Fcode> tag of any page that you want to add this functionality to. It can also be included in an existing javascript file on your page if you prefer. This snippet relies on the \u003Ccode class=\"badge bg-soft-danger text-danger\">loader.js\u003C\u002Fcode> file also being included on your page.\u003C\u002Fp>\u003Cblockquote>\u003Cp>\u003Cstrong>Tip:\u003C\u002Fstrong> This is \u003Cstrong>not\u003C\u002Fstrong> required on the cart, checkout or receipt pages, so it should not be placed in those templates or in your store&#039;s admin settings. Just on your own website.\u003C\u002Fp>\u003C\u002Fblockquote>\u003Cpre>\u003Ccode>&lt;script&gt;\n\u002F* Foxy Dynamic Product Prices and Currency Conversion v0.8, https:\u002F\u002Ffoxy.io *\u002F\n!function(t,e){var n=function(t){return new i(t)};n.version=&quot;0.1.3&quot;;var a=t.fxSetup||{rates:{},base:&quot;&quot;};n.rates=a.rates,n.base=a.base,n.settings={from:a.from||n.base,to:a.to||n.base};var r=n.convert=function(t,e){if(&quot;object&quot;==typeof t&amp;&amp;t.length){for(var a=0;a&lt;t.length;a++)t[a]=r(t[a],e);return t}(e=e||{}).from||(e.from=n.settings.from),e.to||(e.to=n.settings.to);a=e.to;var i=e.from,s=n.rates;if(s[n.base]=1,!s[a]||!s[i])throw&quot;fx error&quot;;return t*(a=i===n.base?s[a]:a===n.base?1\u002Fs[i]:s[a]*(1\u002Fs[i]))},i=function(t){&quot;string&quot;==typeof t?(this._v=parseFloat(t.replace(\u002F[^0-9-.]\u002Fg,&quot;&quot;)),this._fx=t.replace(\u002F([^A-Za-z])\u002Fg,&quot;&quot;)):this._v=t};(a=n.prototype=i.prototype).convert=function(){var t=Array.prototype.slice.call(arguments);return t.unshift(this._v),r.apply(n,t)},a.from=function(t){return(t=n(r(this._v,{from:t,to:n.base})))._fx=n.base,t},a.to=function(t){return r(this._v,{from:this._fx?this._fx:n.settings.from,to:t})},&quot;undefined&quot;!=typeof exports?(&quot;undefined&quot;!=typeof module&amp;&amp;module.exports&amp;&amp;(exports=module.exports=n),exports.fx=fx):&quot;function&quot;==typeof define&amp;&amp;define.amd?define([],(function(){return n})):(n.noConflict=function(e){return function(){return t.fx=e,n.noConflict=undefined,n}}(t.fx),t.fx=n)}(this),function(t){&quot;object&quot;==typeof exports&amp;&amp;&quot;undefined&quot;!=typeof module?module.exports=t():&quot;function&quot;==typeof define&amp;&amp;define.amd?define([],t):(&quot;undefined&quot;!=typeof window?window:&quot;undefined&quot;!=typeof global?global:&quot;undefined&quot;!=typeof self?self:this).numberCurrencyFormat=t()}((function(){return function t(e,n,a){function r(s,o){if(!n[s]){if(!e[s]){var c=&quot;function&quot;==typeof require&amp;&amp;require;if(!o&amp;&amp;c)return c(s,!0);if(i)return i(s,!0);var u=new Error(&quot;Cannot find module &#039;&quot;+s+&quot;&#039;&quot;);throw u.code=&quot;MODULE_NOT_FOUND&quot;,u}var f=n[s]={exports:{}};e[s][0].call(f.exports,(function(t){return r(e[s][1][t]||t)}),f,f.exports,t,e,n,a)}return n[s].exports}for(var i=&quot;function&quot;==typeof require&amp;&amp;require,s=0;s&lt;a.length;s++)r(a[s]);return r}({1:[function(t,e,n){&quot;use strict&quot;;const a=&quot;LEFT&quot;,r=&quot;ALWAYS&quot;,i=&quot;NEVER&quot;,s=&quot;IF_NEEDED&quot;,o=&quot;AS_IS&quot;,c={currency:&quot;&quot;,showDecimals:r,thousandSeparator:&quot;,&quot;,decimalSeparator:&quot;.&quot;,currencyPosition:&quot;RIGHT&quot;,decimalsDigits:2,spacing:!0,arithmeticalRounding:!1};function u(t,e){return void 0!==t?t:e}function f(t){return t?{currency:t.currency||c.currency,thousandSeparator:u(t.thousandSeparator,c.thousandSeparator),decimalSeparator:u(t.decimalSeparator,c.decimalSeparator),showDecimals:t.showDecimals||c.showDecimals,decimalsDigits:u(t.decimalsDigits,c.decimalsDigits),currencyPosition:t.currencyPosition||c.currencyPosition,spacing:u(t.spacing,c.spacing),arithmeticalRounding:u(t.arithmeticalRounding,c.arithmeticalRounding)}:c}function l(t){return\u002F^[\\.,]$\u002F.test(t)}e.exports={format:function(t,e){const n=f(e),c=n.showDecimals===o?t.toString():parseFloat((n.arithmeticalRounding?function(t,e){return+(Math.round(t+&quot;e+&quot;+e)+&quot;e-&quot;+e)}(t,n.decimalsDigits):+t).toString()).toFixed(n.showDecimals===i?0:n.decimalsDigits);if(isNaN(c))return t;const u=c.split(&quot;.&quot;),l=u[0],d=u[1]||&quot;&quot;,p=n.showDecimals===r||n.showDecimals===s&amp;&amp;+d&gt;0||n.showDecimals===o&amp;&amp;d.length&gt;0?n.decimalSeparator+d:&quot;&quot;,h=(m=l,g=n.thousandSeparator,m.split(&quot;&quot;).reduce((function(t,e,n){return t+e+(n&lt;m.length-1&amp;&amp;(m.length-n-1)%3==0&amp;&amp;&quot;-&quot;!==e?g:&quot;&quot;)}),&quot;&quot;)+p);var m,g;if(n.currency){const t=n.spacing?&quot; &quot;:&quot;&quot;;return n.currencyPosition===a?n.currency+t+h:h+t+n.currency}return h},unformat:function(t,e){const n=f(e),a=e&amp;&amp;e.decimalSeparator,r=t.replace(\u002F\\s\u002Fg,&quot;&quot;).match(\u002F[0-9]+|[^0-9]+\u002Fgi).map((function(t,e){return{value:t,isNumber:\u002F[0-9]+\u002F.test(t),index:e}})),i=r.filter((function(t){return t.isNumber})),s=r.filter((function(t){return!t.isNumber})),o=i[0],c=i[i.length-1],u=o.value&gt;0?o:i.length&gt;1&amp;&amp;i[1].value&gt;0?i[1]:void 0;if(!u)return 0;const d=u.index&gt;0?r[u.index-1]:void 0,p=d&amp;&amp;1===s.length&amp;&amp;l(d.value),h=c.index-1,m=h&gt;=0&amp;&amp;r[h],g=s.filter((function(t){return t.index&gt;o.index&amp;&amp;t.index&lt;h})).map((function(t){return t.value})),_=g.length&gt;0&amp;&amp;g.indexOf(m.value)&lt;0,y=m&amp;&amp;m.value===a,v=c.value.length===n.decimalsDigits&amp;&amp;m&amp;&amp;l(m.value),x=(a?y:v||y||p||_)?c.value.length:0,b=d&amp;&amp;d.value,j=b&amp;&amp;&quot;-&quot;===b[b.length-1],w=i.map((function(t){return t.value})).join(&quot;&quot;);return parseFloat(w\u002FMath.pow(10,x))*(j?-1:1)}}},{}]},{},[1])(1)}));var FC=FC||{};!function(t,e){var n={version:.8},r=\u002F([{\\|])p([+\\-:])([\\d\\.]+)(?:\\D{3})?([\\|}])\u002F,i=\u002F^(\\d+):\u002F,s=!1,o={base:&quot;USD&quot;,sets:[],max_rate_cache:12,rounding:&quot;minimal&quot;,convert_display_only:!1,active_class:&quot;active&quot;,use_openexchangerates:!1,adjust_price_display:null};function c(){for(var t=e.json.shipping_address.country,n=&quot;&quot;==e.json.template_set?&quot;DEFAULT&quot;:e.json.template_set,a=&quot;DEFAULT&quot;,r=0;r&lt;settings.sets.length;r++)settings.sets[r].hasOwnProperty(&quot;countries&quot;)&amp;&amp;settings.sets[r].countries.indexOf(t)&gt;-1&amp;&amp;(a=settings.sets[r].template_set);F()||(O(),a==n)?(m(),u()):h(a)}function u(n){var a=settings.sets.map((function(t,e){return t.currency})).filter((function(t,e,n){return n.indexOf(t)===e})),r=(n=void 0!==n&amp;&amp;n,F());r.hasOwnProperty(&quot;rates&quot;)&amp;&amp;(Date.now()-r.rates.timestamp)\u002F60&lt;36e4*parseFloat(settings.max_rate_cache)&amp;&amp;(n||r.fcsid==e.json.session_id)?(fx.rates=r.rates.rates,fx.base=r.rates.base,d()):n||(settings.use_openexchangerates?t.getJSON(&quot;https:\u002F\u002Fopenexchangerates.org\u002Fapi\u002Flatest.json?app_id=&quot;+settings.use_openexchangerates+&quot;&amp;prettyprint=false&amp;symbols=&quot;+a.join(&quot;,&quot;),(function(t){l(t.rates,t.base),d()})):t.getJSON(&quot;https:\u002F\u002Fwww.floatrates.com\u002Fdaily\u002F&quot;+settings.base+&quot;.json&quot;,(function(t){for(var e={},n=0;n&lt;a.length;n++)(t.hasOwnProperty(a[n].toLowerCase())||a[n]==settings.base)&amp;&amp;(e[a[n]]=a[n]==settings.base?1:t[a[n].toLowerCase()].rate);l(e,settings.base),d()})))}function l(t,e){fx.rates=t,fx.base=e,O({rates:t,base:e,timestamp:Date.now()})}function d(){var n=F();if(!n)return console.log(&quot;FC.currency: Unable to find locale information&quot;),!1;var a=D(),i=e.json.item_count&gt;0?e.json.locale_info.int_curr_symbol.trim():n.locale.int_curr_symbol.trim(),s=e.json.item_count&gt;0?e.json.locale_info.mon_decimal_point:n.locale.mon_decimal_point;t(&quot;.fc-currency-price&quot;).each((function(){var a,r=settings.base;t(this).data(&quot;fc-currency&quot;)&amp;&amp;(r=t(this).data(&quot;fc-currency&quot;),a=s);var o=S(t(this).html(),a),c=o;r!=i&amp;&amp;(c=g(c=fx.convert(o,{from:r,to:i}))),t(this).html(e.util.money_format(n.currency_format,_(c)).trim()).data(&quot;fc-currency&quot;,i).show()})),t(&#039;form[action*=&quot;&#039;+a+&#039;&quot;]&#039;).each((function(){var e=t(this).find(&#039;[name=&quot;price&quot;], [name$=&quot;:price&quot;]&#039;);if(0==e.length)return!1;var n=settings.base;if(t(this).data(&quot;fc-currency&quot;))n=t(this).data(&quot;fc-currency&quot;);else{var a=\u002F([\\d\\.]+)([A-Z]{3})$\u002Fi,s=e.first().val().replace(&quot; &quot;,&quot;&quot;);s.match(a);a.test(s)&amp;&amp;(n=a.exec(s)[2].toUpperCase())}n!=i&amp;&amp;(t(this).find(&quot;[value*=&#039;{p&#039;], [value*=&#039;|p&#039;]&quot;).each((function(){var t=this.value.match(r);if(t){var e=fx.convert(parseFloat(t[3]),{from:n,to:i});e=g(e),settings.convert_display_only||(this.value=this.value.replace(r,&quot;$1p$2&quot;+e.toFixed(2)+i.toLowerCase()+&quot;$4&quot;))}})),e.each((function(){var t=S(this.value),e=fx.convert(t,{from:n,to:i});e=g(e),settings.convert_display_only||(this.value=e.toFixed(2)+i.toLowerCase())})),t(this).data(&quot;fc-currency&quot;,i)),y()}))}function h(t){e.client.request(&quot;https:\u002F\u002F&quot;+e.json.config.store_domain+&quot;\u002Fcart?template_set=&quot;+t).done((function(){O(),c()}))}function m(){for(var n=F(),a=!1,r=e.json.item_count&gt;0?&quot;&quot;==e.json.template_set?&quot;DEFAULT&quot;:e.json.template_set:n.template_set,i=0;i&lt;settings.sets.length;i++)settings.sets[i].template_set==r&amp;&amp;(a=r);a&amp;&amp;(t(&quot;[data-fc-template-set].&quot;+settings.active_class).removeClass(settings.active_class),t(&#039;[data-fc-template-set=&quot;&#039;+a+&#039;&quot;]&#039;).addClass(settings.active_class))}function g(t){var e=[&quot;full&quot;,&quot;half&quot;,&quot;minimal&quot;,&quot;none&quot;,!1].indexOf(settings.rounding)&gt;-1?settings.rounding:o.rounding;if(&quot;full&quot;==e)return Math.ceil(t);if(&quot;half&quot;==e){var n=t%1;return Math.floor(t)+(0==n?0:n&lt;=.5?.5:1)}return&quot;minimal&quot;==e?Math.ceil(20*t)\u002F20:t}function _(t){return&quot;function&quot;==typeof settings.adjust_price_display&amp;&amp;(adjusted_price=settings.adjust_price_display(t),void 0!==adjusted_price)?parseFloat(adjusted_price):t}function y(){ADJUST={},t(&quot;input,select&quot;).off(&quot;change.foxy-dynamic-price&quot;),t(&#039;form[action*=&quot;&#039;+D()+&#039;&quot;]&#039;).each((function(){var e=t(this),n=&quot;&quot;,a={products:{}};t(this).find(&quot;[name=&#039;name&#039;],[name^=&#039;name||&#039;],[name$=&#039;:name&#039;],[name*=&#039;:name||&#039;]&quot;).each((function(){var t=b(this.name),r=t?t+&quot;:&quot;:&quot;&quot;,i=S(e.find(&quot;[name=&#039;&quot;+r+&quot;price&#039;],[name^=&#039;&quot;+r+&quot;price||&#039;]&quot;).first().val()),s={id:t,code:&quot;&quot;,base_price:i||0,quantity:1,attributes:{},has_quantity:!1},o=e.find(&quot;[name=&#039;&quot;+r+&quot;quantity&#039;],[name^=&#039;&quot;+r+&quot;quantity||&#039;]&quot;),c=e.find(&quot;[name=&#039;&quot;+r+&quot;code&#039;],[name^=&#039;&quot;+r+&quot;code||&#039;]&quot;);if(c.length&gt;0&amp;&amp;(s.code=v(c.first().val()),&quot;&quot;===n&amp;&amp;(n=s.code)),o.length&gt;0){var u=0,f=j(o);[&quot;select&quot;,&quot;text&quot;,&quot;hidden&quot;].indexOf(f)&gt;-1?(s.has_quantity=!0,u=parseFloat(v(o.val()))):[&quot;radio&quot;,&quot;checkbox&quot;].indexOf(f)&gt;-1&amp;&amp;(s.has_quantity=!0,1==o.filter(&quot;:checked&quot;).length&amp;&amp;(u=parseFloat(v(o.filter(&quot;:checked&quot;).val())))),isNaN(u)&amp;&amp;(u=0),s.quantity=u}a.products[t]=s}));e.attr(&quot;data-fc-form-code&quot;)&amp;&amp;(n=e.attr(&quot;data-fc-form-code&quot;)),&quot;&quot;!==n&amp;&amp;(t(this).find(&quot;input,select&quot;).each((function(){var e=b(this.name),i=function(t){return x(t)[2]}(this.name),s=j(t(this));if(&quot;quantity&quot;!=i)if(&quot;price&quot;!=i||&quot;hidden&quot;==s){if(&quot;SELECT&quot;==this.tagName){var o=!1;t(this).children(&quot;option&quot;).each((function(){this.value.search(r)&gt;-1&amp;&amp;(o=!0)})),o&amp;&amp;(t(this).data(&quot;fc-adjust-for&quot;,n),a.products[e].attributes[v(this.name)]=v(this.value),t(this).on(&quot;change.foxy-dynamic-price&quot;,(function(){ADJUST[t(this).data(&quot;fc-adjust-for&quot;)].products[e].attributes[v(this.name)]=v(this.value),w()})))}else if(this.value.search(r)&gt;-1)switch(t(this).data(&quot;fc-adjust-for&quot;,n),t(this).attr(&quot;type&quot;)){case&quot;checkbox&quot;:t(this).is(&quot;:checked&quot;)?a.products[e].attributes[v(this.name)]=v(this.value):a.products[e].attributes[v(this.name)]=&quot;&quot;,t(this).on(&quot;change.foxy-dynamic-price&quot;,(function(){t(this).is(&quot;:checked&quot;)?ADJUST[t(this).data(&quot;fc-adjust-for&quot;)].products[e].attributes[v(this.name)]=v(this.value):ADJUST[t(this).data(&quot;fc-adjust-for&quot;)].products[e].attributes[v(this.name)]=&quot;&quot;,w()}));break;case&quot;radio&quot;:a.products[e].attributes.hasOwnProperty(v(this.name))||(a.products[e].attributes[v(this.name)]=&quot;&quot;),t(this).is(&quot;:checked&quot;)&amp;&amp;(a.products[e].attributes[v(this.name)]=v(this.value)),t(&quot;[name=&#039;&quot;+this.name+&quot;&#039;]&quot;).data(&quot;fc-adjust-for&quot;,n).on(&quot;change.foxy-dynamic-price&quot;,(function(){ADJUST[t(this).data(&quot;fc-adjust-for&quot;)].products[e].attributes[v(this.name)]=v(this.value),w()}))}}else t(this).data(&quot;fc-adjust-for&quot;,n).on(&quot;change.foxy-dynamic-price&quot;,(function(){var n=0;([&quot;select&quot;,&quot;text&quot;].indexOf(s)&gt;-1||[&quot;radio&quot;,&quot;checkbox&quot;].indexOf(s)&gt;-1&amp;&amp;t(this).is(&quot;:checked&quot;))&amp;&amp;(n=parseFloat(v(this.value))),isNaN(n)&amp;&amp;(n=0),ADJUST[t(this).data(&quot;fc-adjust-for&quot;)].products[e].base_price=n,w()}));else t(this).data(&quot;fc-adjust-for&quot;,n).on(&quot;change.foxy-dynamic-price&quot;,(function(){var n=0;([&quot;select&quot;,&quot;text&quot;].indexOf(s)&gt;-1||[&quot;radio&quot;,&quot;checkbox&quot;].indexOf(s)&gt;-1&amp;&amp;t(this).is(&quot;:checked&quot;))&amp;&amp;(n=parseFloat(v(this.value))),isNaN(n)&amp;&amp;(n=0),ADJUST[t(this).data(&quot;fc-adjust-for&quot;)].products[e].quantity=n,w()}))})),ADJUST[n]=a)})),n._ADJUST=ADJUST,w()}function v(t){return t.replace(\u002F\\|\\|[\\d\\w]+(?:\\|\\|open)?$\u002F,&quot;&quot;)}function x(t){return(t=v(t)).match(\u002F(?:(\\d+):)?(.*)\u002F)}function b(t){var e=x(t);return i.test(this.name)&amp;&amp;(prefix=parseInt(this.name.match(i)[0])),void 0===e[1]?0:parseInt(e[1])}function j(t){if(&quot;SELECT&quot;==t[0].tagName)return&quot;select&quot;;if(&quot;INPUT&quot;==t[0].tagName)switch(t.attr(&quot;type&quot;).toLowerCase()){case&quot;text&quot;:case&quot;number&quot;:case&quot;tel&quot;:return&quot;text&quot;;default:return t.attr(&quot;type&quot;).toLowerCase()}}function w(){for(f in ADJUST){var n=0,i=0;for(p in ADJUST[f].products){var s=ADJUST[f].products[p].base_price,o=0;for(a in ADJUST[f].products[p].attributes){var c=ADJUST[f].products[p].attributes[a].match(r);if(c)switch(c[2]){case&quot;:&quot;:s=parseFloat(c[3]);break;case&quot;+&quot;:o+=parseFloat(c[3]);break;case&quot;-&quot;:o-=parseFloat(c[3])}}s+=o,n+=s*=ADJUST[f].products[p].quantity,i+=ADJUST[f].products[p].quantity}&quot;function&quot;==typeof fcFormatPrice&amp;&amp;(n=fcFormatPrice(n,f)),&quot;function&quot;==typeof fcFormatQuantity&amp;&amp;(i=fcFormatQuantity(i,f));var u=F(),l=e.util.money_format(u.currency_format,_(n)).trim();t(&quot;.&quot;+f+&quot;_total, .&quot;+f+&quot;-total&quot;).html(l),t(&quot;.&quot;+f+&quot;_total_quantity, .&quot;+f+&quot;-total-quantity&quot;).html(i)}}function D(){var t=F();return e.json.hasOwnProperty(&quot;config&quot;)?e.json.config.store_domain:t?t.store_domain:&quot;.foxycart.com&quot;}function S(t,e){try{var n={};return e&amp;&amp;(n.decimalSeparator=e),numberCurrencyFormat.unformat(t,n)}catch(t){return!1}}function O(t){var n=F(),a=Object.assign({},n);n&amp;&amp;&quot;&quot;==e.json.template_set&amp;&amp;void 0!==t||Object.assign(a,{fcsid:e.json.session_id,store_domain:e.json.config.store_domain,template_set:&quot;&quot;==e.json.template_set?&quot;DEFAULT&quot;:e.json.template_set,locale:e.json.locale_info,currency_format:e.json.config.currency_format}),&quot;object&quot;==typeof t&amp;&amp;Object.assign(a,{rates:t}),localStorage.setItem(&quot;fc_currency_config&quot;,JSON.stringify(a))}function F(){var t=JSON.parse(localStorage.getItem(&quot;fc_currency_config&quot;));return!(null===t||e.hasOwnProperty(&quot;json&quot;)&amp;&amp;e.json.hasOwnProperty(&quot;session_id&quot;)&amp;&amp;t.fcsid!==e.json.session_id)&amp;&amp;t}e.hasOwnProperty(&quot;util&quot;)||(e.util={},e.util.money_format=function(t,n){if(&quot;number&quot;!=typeof n)return null;var a=e.json.locale_info;return t.replace(\u002F%((=.|[+^(!-])*?)(\\d*?)(#(\\d+))?(\\.(\\d+))?([in%])\u002Fg,(function(t,r,i,s,o,c,u,f,l){if(t=u=&quot;&quot;,&quot;%&quot;===l)return&quot;%&quot;;u=r&amp;&amp;\u002F=.\u002F.test(r)?r.match(\u002F=(.)\u002F)[1]:&quot; &quot;,o=!r||-1===r.indexOf(&quot;!&quot;),s=parseInt(s,10)||0,(i=0&gt;n)&amp;&amp;(n=-n),f=&quot;&quot;===f||void 0===f?&quot;i&quot;===l?a.int_frac_digits:a.frac_digits:parseInt(f,10);var d=(n=(n=e.util.round(n,f)).toFixed(f)).indexOf(&quot;.&quot;);f=-1!==d?n.slice(0,d):n,d=-1!==d?n.slice(d+1):&quot;&quot;;var p=function(t,e,n){return(t=t.split(&quot;&quot;)).splice(e,0,n),t.join(&quot;&quot;)},h=f.length,m=h&lt;(c=parseInt(c,10));if(m){var g=c-h;f=Array(g+1).join(u)+f}if(-1===r.indexOf(&quot;^&quot;)){if(c=a.mon_thousands_sep,(h=a.mon_grouping)[0]&lt;f.length)for(var _=0,y=f.length;_&lt;h.length&amp;&amp;!(0&gt;=(y-=h[_]));_++)m&amp;&amp;y&lt;g&amp;&amp;(c=u),f=p(f,y,c);if(0&lt;h[_-1])for(;y&gt;h[_-1];)y-=h[_-1],m&amp;&amp;y&lt;g&amp;&amp;(c=u),f=p(f,y,c)}if(u=d?f+a.mon_decimal_point+d:f,g=&quot;&quot;,o&amp;&amp;(g=&quot;i&quot;===l?a.int_curr_symbol:a.currency_symbol),l=i?a.n_sign_posn:a.p_sign_posn,_=i?a.n_sep_by_space:a.p_sep_by_space,y=i?a.n_cs_precedes:a.p_cs_precedes,-1!==r.indexOf(&quot;(&quot;))t=(y?g+(1===_?&quot; &quot;:&quot;&quot;):&quot;&quot;)+u+(y?&quot;&quot;:(1===_?&quot; &quot;:&quot;&quot;)+g),t=i?&quot;(&quot;+t+&quot;)&quot;:&quot; &quot;+t+&quot; &quot;;else switch(c=a.positive_sign,o=a.negative_sign,f=i?o:c,d=&quot;&quot;,l&amp;&amp;(d=Array((i?c:o).length-f.length+1).join(&quot; &quot;)),l){case 0:t=&quot;(&quot;+(y?g+(1===_?&quot; &quot;:&quot;&quot;)+u:u+(1===_?&quot; &quot;:&quot;&quot;)+g)+&quot;)&quot;;break;case 1:t=d+f+(2===_?&quot; &quot;:&quot;&quot;)+(y?g+(1===_?&quot; &quot;:&quot;&quot;)+u:u+(1===_?&quot; &quot;:&quot;&quot;)+g);break;case 2:t=(y?g+(1===_?&quot; &quot;:&quot;&quot;)+u:u+(1===_?&quot; &quot;:&quot;&quot;)+g)+(2===_?&quot; &quot;:&quot;&quot;)+f+d;break;case 3:t=y?d+f+(2===_?&quot; &quot;:&quot;&quot;)+g+(1===_?&quot; &quot;:&quot;&quot;)+u:u+(1===_?&quot; &quot;:&quot;&quot;)+f+d+(2===_?&quot; &quot;:&quot;&quot;)+g;break;case 4:t=y?g+(2===_?&quot; &quot;:&quot;&quot;)+d+f+(1===_?&quot; &quot;:&quot;&quot;)+u:u+(1===_?&quot; &quot;:&quot;&quot;)+g+(2===_?&quot; &quot;:&quot;&quot;)+f+d}return 0&lt;(s-=t.length)&amp;&amp;(s=Array(s+1).join(&quot; &quot;),t=-1!==r.indexOf(&quot;-&quot;)?t+s:s+t),t}))},e.util.round=function(t,e){var n=Math.pow(10,e);return 5&lt;=10*t*n%10&amp;&amp;(t+=1\u002F(10*n)),Math.round(t*n)\u002Fn}),n.update=function(){settings=e.hasOwnProperty(&quot;currency_config&quot;)?Object.assign({},o,e.currency_config):Object.assign({},o),s=e.hasOwnProperty(&quot;session&quot;)&amp;&amp;!0===e.session.initialized;var t=F();!t||e.hasOwnProperty(&quot;json&quot;)&amp;&amp;0!=e.json.item_count||(e.hasOwnProperty(&quot;json&quot;)||(e.json={}),e.json.currency_format=t.currency_format,e.json.locale_info=t.locale,e.json.item_count=0),(t&amp;&amp;!s||s)&amp;&amp;(settings.sets.length&gt;1?s?c():(m(),u(!0)):(t||O(),y()))};var A=&quot;function&quot;==typeof e.onLoad?e.onLoad:function(){};e.onLoad=function(){e.client.on(&quot;ready.done&quot;,n.update),A()},t((function(){n.update(),t(&quot;body&quot;).on(&quot;click&quot;,&quot;[data-fc-template-set]&quot;,(function(e){var n=function(t){for(var e=!1,n=0;n&lt;settings.sets.length;n++)settings.sets[n].template_set==t&amp;&amp;(e=settings.sets[n]);return e}(t(this).attr(&quot;data-fc-template-set&quot;));n&amp;&amp;(e.preventDefault(),s&amp;&amp;h(n.template_set))}))})),e.currency=n}(jQuery,FC);\n&lt;\u002Fscript&gt;\u003C\u002Fcode>\u003C\u002Fpre>\u003Ch2>Step 2: Set up forms\u003C\u002Fh2>\u003Cp>For the dynamic product total calculation to work, you need to set up your product add to cart forms as follows:\u003C\u002Fp>\u003Ch3>Product Code\u003C\u002Fh3>\u003Cp>Every Foxy based product that you want to dynamically calculate the total for needs to have a unique product code set like this:\u003C\u002Fp>\u003Cpre>\u003Ccode>&lt;input type=&quot;hidden&quot; name=&quot;code&quot; value=&quot;mycode&quot; \u002F&gt;\u003C\u002Fcode>\u003C\u002Fpre>\u003Cp>If you have multiple products within a single form, the code from the first product in your form will be used as the code for the form. If you&#039;re not able to know what product code is first, or you just want to set a specific code to use for the price modifier without relying on the product&#039;s code, you can also add a data attribute to your form like this:\u003C\u002Fp>\u003Cpre>\u003Ccode>&lt;form ... data-fc-form-code=&quot;mycode&quot;&gt;\u003C\u002Fcode>\u003C\u002Fpre>\u003Ch3>Total Price Element\u003C\u002Fh3>\u003Cp>Next, set an element for where the total product cost is shown and updated, by combining the code from above and \u003Ccode class=\"badge bg-soft-danger text-danger\">-total\u003C\u002Fcode> as its class, like this:\u003C\u002Fp>\u003Cpre>\u003Ccode>&lt;h4 class=&quot;mycode-total&quot;&gt;$20.00&lt;\u002Fh4&gt;\u003C\u002Fcode>\u003C\u002Fpre>\u003Cp>If you&#039;d like to show the total quantity, you can also do that using an element with a class that is a combination of the code and \u003Ccode class=\"badge bg-soft-danger text-danger\">-total-quantity\u003C\u002Fcode> as its class, like this:\u003C\u002Fp>\u003Cpre>\u003Ccode>&lt;p class=&quot;mycode-total-quantity&quot;&gt;0&lt;\u002Fp&gt;\u003C\u002Fcode>\u003C\u002Fpre>\u003Cp>You can also use classes with underscores instead if needed, such as \u003Ccode class=\"badge bg-soft-danger text-danger\">mycode_total\u003C\u002Fcode> and \u003Ccode class=\"badge bg-soft-danger text-danger\">mycode_total_quantity\u003C\u002Fcode>.\u003C\u002Fp>\u003Ch3>Product Price Element\u003C\u002Fh3>\u003Cp>As with a normal Foxy product form, the \u003Ccode class=\"badge bg-soft-danger text-danger\">name\u003C\u002Fcode> and \u003Ccode class=\"badge bg-soft-danger text-danger\">price\u003C\u002Fcode> inputs are required. The snippet will use the \u003Ccode class=\"badge bg-soft-danger text-danger\">price\u003C\u002Fcode> inputs in the form to determine the base prices for the products present.\u003C\u002Fp>\u003Cp>If you wanted to specify a different currency for that product than your store&#039;s default currency as the starting base price, you can append the currency code to the price (like \u003Ccode class=\"badge bg-soft-danger text-danger\">29.95eur\u003C\u002Fcode> for €29,95). It will use that currency as the base currency for all products within that form, so ensure that if you take this approach, all prices (including product option modifiers) are in that currency.\u003C\u002Fp>\u003Ch2>Step 3: Configuration for currency conversion\u003C\u002Fh2>\u003Cp>By default, the snippet will just handle calculating the dynamic product price. It can also support dynamically converting your product prices to different currencies, as well as automatically assigning a currency based on the location of a customer.\u003C\u002Fp>\u003Cblockquote>\u003Cp>\u003Cstrong>Note:\u003C\u002Fstrong> The dynamic currency conversion feature relies on your store having multiple template sets configured. If you haven&#039;t set up multiple template sets on your Foxy store yet, you can see information on creating those here.\u003C\u002Fp>\u003C\u002Fblockquote>\u003Cp>If you&#039;d like to also enable multiple currencies for your product prices, the snippet includes a number of options for configuring this functionality. The configuration is applied with javascript through an object variable of \u003Ccode class=\"badge bg-soft-danger text-danger\">FC.currency_config\u003C\u002Fcode>. These are the different configuration options available:\u003C\u002Fp>\u003Cul>\u003Cli>\u003Cp>\u003Ccode class=\"badge bg-soft-danger text-danger\">base\u003C\u002Fcode> \u003Cstrong>Accepts:\u003C\u002Fstrong> String, 3 character currency code \u003Cstrong>Description:\u003C\u002Fstrong> Set to the currency that your product prices are in by default. Required for dynamic currency conversion.\u003C\u002Fp>\u003C\u002Fli>\u003Cli>\u003Cp>\u003Ccode class=\"badge bg-soft-danger text-danger\">sets\u003C\u002Fcode> \u003Cstrong>Accepts:\u003C\u002Fstrong> Array of different currencies available for your store \u003Cstrong>Description:\u003C\u002Fstrong> This array will contain the details for each template set configured on \u003Cstrong>Settings &gt; Templates\u003C\u002Fstrong> that you want to use on your store. Each object in the array includes three variables, \u003Ccode class=\"badge bg-soft-danger text-danger\">currency\u003C\u002Fcode>, \u003Ccode class=\"badge bg-soft-danger text-danger\">template_set\u003C\u002Fcode> and \u003Ccode class=\"badge bg-soft-danger text-danger\">countries\u003C\u002Fcode>. Required when using dynamic currency conversion.\u003C\u002Fp>\u003C\u002Fli>\u003Cli>\u003Cp>\u003Ccode class=\"badge bg-soft-danger text-danger\">sets.currency\u003C\u002Fcode> \u003Cstrong>Accepts:\u003C\u002Fstrong> String, 3 character currency code \u003Cstrong>Description:\u003C\u002Fstrong> Set to the currency that this particular template set uses. Required when including \u003Ccode class=\"badge bg-soft-danger text-danger\">sets\u003C\u002Fcode>.\u003C\u002Fp>\u003C\u002Fli>\u003Cli>\u003Cp>\u003Ccode class=\"badge bg-soft-danger text-danger\">sets.template_set\u003C\u002Fcode> \u003Cstrong>Accepts:\u003C\u002Fstrong> String, Template set code \u003Cstrong>Description:\u003C\u002Fstrong> Set to the code of the template set, as set on \u003Cstrong>Settings &gt; Templates\u003C\u002Fstrong>. Required when including \u003Ccode class=\"badge bg-soft-danger text-danger\">sets\u003C\u002Fcode>.\u003C\u002Fp>\u003C\u002Fli>\u003Cli>\u003Cp>\u003Ccode class=\"badge bg-soft-danger text-danger\">sets.countries\u003C\u002Fcode> \u003Cstrong>Accepts:\u003C\u002Fstrong> Array of 2 character country codes \u003Cstrong>Description:\u003C\u002Fstrong> A list of countries that will automatically be set to this template set on initial page load. If a customer visits that doesn&#039;t match any country in a set, then it will switch to the \u003Ccode class=\"badge bg-soft-danger text-danger\">DEFAULT\u003C\u002Fcode> template set. If not set, this template set will not be set automatically, but could be selected manually.\u003C\u002Fp>\u003C\u002Fli>\u003Cli>\u003Cp>\u003Ccode class=\"badge bg-soft-danger text-danger\">max_rate_cache\u003C\u002Fcode> \u003Cstrong>Accepts:\u003C\u002Fstrong> Number \u003Cstrong>Description:\u003C\u002Fstrong> The number of hours that the rates should be cached before being refreshed. Defaults to 12 hours.\u003C\u002Fp>\u003C\u002Fli>\u003Cli>\u003Cp>\u003Ccode class=\"badge bg-soft-danger text-danger\">rounding\u003C\u002Fcode> \u003Cstrong>Accepts:\u003C\u002Fstrong> \u003Ccode class=\"badge bg-soft-danger text-danger\">full\u003C\u002Fcode>, \u003Ccode class=\"badge bg-soft-danger text-danger\">half\u003C\u002Fcode>, \u003Ccode class=\"badge bg-soft-danger text-danger\">minimal\u003C\u002Fcode>, \u003Ccode class=\"badge bg-soft-danger text-danger\">none\u003C\u002Fcode> \u003Cstrong>Description:\u003C\u002Fstrong> Configure how the prices should be rounded when being converted. \u003Ccode class=\"badge bg-soft-danger text-danger\">full\u003C\u002Fcode> will round up to the nearest whole number, \u003Ccode class=\"badge bg-soft-danger text-danger\">half\u003C\u002Fcode> will round up to the nearest \u003Ccode class=\"badge bg-soft-danger text-danger\">.50\u003C\u002Fcode>, \u003Ccode class=\"badge bg-soft-danger text-danger\">minimal\u003C\u002Fcode> will round up to the nearest \u003Ccode class=\"badge bg-soft-danger text-danger\">0.05\u003C\u002Fcode> and \u003Ccode class=\"badge bg-soft-danger text-danger\">none\u003C\u002Fcode> will not round at all. Default is \u003Ccode class=\"badge bg-soft-danger text-danger\">minimal\u003C\u002Fcode>\u003C\u002Fp>\u003C\u002Fli>\u003Cli>\u003Cp>\u003Ccode class=\"badge bg-soft-danger text-danger\">active_class\u003C\u002Fcode> \u003Cstrong>Accepts:\u003C\u002Fstrong> String \u003Cstrong>Description:\u003C\u002Fstrong> Customise what class is added to the template set selectors for the current active template set. Default is \u003Ccode class=\"badge bg-soft-danger text-danger\">active\u003C\u002Fcode>\u003C\u002Fp>\u003C\u002Fli>\u003Cli>\u003Cp>\u003Ccode class=\"badge bg-soft-danger text-danger\">use_openexchangerates\u003C\u002Fcode> \u003Cstrong>Accepts:\u003C\u002Fstrong> String \u003Cstrong>Description:\u003C\u002Fstrong> Set to the API key for your OpenExchangeRates account if you would prefer to use it instead of the default \u003Ca href=\"https:\u002F\u002Ffloatrates.com\" target=\"_blank\" rel=\"noopener noreferrer\" class=\"\">https:\u002F\u002Ffloatrates.com\u003C\u002Fa> source for currency rates.\u003C\u002Fp>\u003C\u002Fli>\u003Cli>\u003Cp>\u003Ccode class=\"badge bg-soft-danger text-danger\">adjust_price_display\u003C\u002Fcode> \u003Cstrong>Accepts:\u003C\u002Fstrong> Function \u003Cstrong>Description:\u003C\u002Fstrong> Create a function to modify only the price displayed on the page, for example to make a tax exclusive price in your add to cart to be displayed as tax inclusive to the customer. The function is passed a single argument for the price to be modified, and the function must return the modified price as well.\u003C\u002Fp>\u003C\u002Fli>\u003C\u002Ful>\u003Cblockquote>\u003Cp>\u003Cstrong>Tip:\u003C\u002Fstrong> All of the configuration options are optional, but to offer dynamic currency conversion \u003Ccode class=\"badge bg-soft-danger text-danger\">base\u003C\u002Fcode> and \u003Ccode class=\"badge bg-soft-danger text-danger\">sets\u003C\u002Fcode> are required.\u003C\u002Fp>\u003C\u002Fblockquote>\u003Cp>As an example, assume you had four template sets on your store. The store&#039;s DEFAULT template set is configured for USD, as are the product prices on the website by default, but there are also template sets for CAD, as well as Euro in both French and German languages. Your configuration could look like this, included above the snippet from step 1:\u003C\u002Fp>\u003Cpre>\u003Ccode>&lt;script&gt;\nvar FC = FC || {};\nFC.currency_config = {\n    &#039;base&#039;: &#039;USD&#039;,\n    &#039;sets&#039;: [\n        {\n            &#039;currency&#039;: &#039;USD&#039;,\n            &#039;template_set&#039;: &#039;DEFAULT&#039;,\n            &#039;countries&#039;: [&#039;US&#039;]\n        },\n        {\n            &#039;currency&#039;: &#039;CAD&#039;,\n            &#039;template_set&#039;: &#039;Canada&#039;,\n            &#039;countries&#039;: [&#039;CA&#039;]\n        },\n        {\n            &#039;currency&#039;: &#039;EUR&#039;,\n            &#039;template_set&#039;: &#039;Germany&#039;,\n            &#039;countries&#039;: [&#039;DE&#039;, &#039;BE&#039;]\n        },\n        {\n            &#039;currency&#039;: &#039;EUR&#039;,\n            &#039;template_set&#039;: &#039;France&#039;,\n            &#039;countries&#039;: [&#039;FR&#039;]\n        },\n    ]\n};\n&lt;\u002Fscript&gt;\u003C\u002Fcode>\u003C\u002Fpre>\u003Cp>If a customer from Germany or Belgium visits your website, it will automatically apply the template set from your store with a code of \u003Ccode class=\"badge bg-soft-danger text-danger\">Germany\u003C\u002Fcode>, and then convert the prices to all be in Euro. If someone visits from Canada, then it will update to the \u003Ccode class=\"badge bg-soft-danger text-danger\">Canada\u003C\u002Fcode> template set, and change the prices to Canadian dollars.\u003C\u002Fp>\u003Cp>If curreny conversion is enabled for the snippet, then any \u003Ccode class=\"badge bg-soft-danger text-danger\">price\u003C\u002Fcode> and \u003Ccode class=\"badge bg-soft-danger text-danger\">p\u003C\u002Fcode> product option modifiers will be dynamically converted to the current currency of the cart, rounding as specified by the \u003Ccode class=\"badge bg-soft-danger text-danger\">rounding\u003C\u002Fcode> configuration option.\u003C\u002Fp>\u003Cp>Here is an example with all configuration options for the snippet:\u003C\u002Fp>\u003Cpre>\u003Ccode>&lt;script&gt;\nvar FC = FC || {};\nFC.currency_config = {\n    &#039;base&#039;: &#039;USD&#039;,\n    &#039;sets&#039;: [\n        {\n            &#039;currency&#039;: &#039;USD&#039;,\n            &#039;template_set&#039;: &#039;DEFAULT&#039;,\n            &#039;countries&#039;: [&#039;US&#039;]\n        },\n        {\n            &#039;currency&#039;: &#039;CAD&#039;,\n            &#039;template_set&#039;: &#039;Canada&#039;,\n            &#039;countries&#039;: [&#039;CA&#039;]\n        }\n    ],\n    &#039;max_rate_cache&#039;: 12,\n    &#039;rounding&#039;: &#039;half&#039;,\n    &#039;active_class&#039;: &#039;currency-option-active&#039;,\n    &#039;use_openexchangerates&#039;: &#039;abc123abc123abc123&#039;,\n    &#039;adjust_price_display&#039;: function(price) { return price * 1.25; }\n};\n&lt;\u002Fscript&gt;\u003C\u002Fcode>\u003C\u002Fpre>\u003Cblockquote>\u003Cp>\u003Cstrong>Important:\u003C\u002Fstrong> \u003Cstrong>Note:\u003C\u002Fstrong> The above is simply an example of what it looks like with all attributes for the configuration option. You will not want to copy this to use directly in your set up, but rather review each configuration option and only add them if you actually need them.\u003C\u002Fp>\u003C\u002Fblockquote>\u003Cblockquote>\u003Cp>\u003Cstrong>Note:\u003C\u002Fstrong> By default this snippet will pull the currency conversion rates from \u003Ca href=\"https:\u002F\u002Ffloatrates.com\" target=\"_blank\" rel=\"noopener noreferrer\" class=\"\">floatrates.com\u003C\u002Fa>. It does also support \u003Ca href=\"https:\u002F\u002Fopenexchangerates.org\u002F\" target=\"_blank\" rel=\"noopener noreferrer\" class=\"\">Open Exchange Rates\u003C\u002Fa> (which is also what we use for our own default currency conversion in the cart), but you&#039;ll need to create your own account and specify your API key using the \u003Ccode class=\"badge bg-soft-danger text-danger\">use_openexchangerates\u003C\u002Fcode> configuration option.\u003C\u002Fp>\u003C\u002Fblockquote>\u003Ch2>Step 4: Set up a currency switcher\u003C\u002Fh2>\u003Cp>Although the snippet will automatically set a customers template set based on their location, you&#039;ll probably also want to allow customers to switch template sets on the fly, or perhaps have a modal window that displays to allow them to select an option.\u003C\u002Fp>\u003Cp>You can set up your currency switcher however you want - it just requires a data attribute of \u003Ccode class=\"badge bg-soft-danger text-danger\">data-fc-template-set\u003C\u002Fcode> be added to each link that designates what currency set it is for from your configuration from step 3.\u003C\u002Fp>\u003Cp>For example, to have a link use the German Euro template set from the earlier example, you would add a data attribute of \u003Ccode class=\"badge bg-soft-danger text-danger\">data-fc-template-set=&quot;Germany&quot;\u003C\u002Fcode> to the link element.\u003C\u002Fp>\u003Cp>Here&#039;s an example of what the currency switcher could look like:\u003C\u002Fp>\u003Cpre>\u003Ccode>&lt;p&gt;Select a locale: &lt;a data-fc-template-set=&quot;DEFAULT&quot; href=&quot;#&quot;&gt;USD&lt;\u002Fa&gt; |  &lt;a data-fc-template-set=&quot;Canada&quot; href=&quot;#&quot;&gt;CAD&lt;\u002Fa&gt; | &lt;a data-fc-template-set=&quot;Germany&quot; href=&quot;#&quot;&gt;EUR (DE)&lt;\u002Fa&gt; | &lt;a data-fc-template-set=&quot;France&quot; href=&quot;#&quot;&gt;EUR (FR)&lt;\u002Fa&gt;&lt;\u002Fp&gt;\u003C\u002Fcode>\u003C\u002Fpre>\u003Cp>The \u003Ccode class=\"badge bg-soft-danger text-danger\">data-fc-template-set\u003C\u002Fcode> value needs to match the \u003Ccode class=\"badge bg-soft-danger text-danger\">template_set\u003C\u002Fcode> from the \u003Ccode class=\"badge bg-soft-danger text-danger\">FC.currency_config.sets\u003C\u002Fcode> configuration option.\u003C\u002Fp>\u003Cp>For styling - note that whichever template set is active will have a class added. By default the added class will be \u003Ccode class=\"badge bg-soft-danger text-danger\">active\u003C\u002Fcode>, but you can customise that using the \u003Ccode class=\"badge bg-soft-danger text-danger\">active_class\u003C\u002Fcode> configuration option.\u003C\u002Fp>\u003Ch2>Step 5: Allowing currency conversion for other prices\u003C\u002Fh2>\u003Cp>You may also have some prices listed on your site outside of your add to cart forms. For example, on a category listing page. To have these prices be converted to the currency of the cart, you just need to add a class to the element of \u003Ccode class=\"badge bg-soft-danger text-danger\">.fc-currency-price\u003C\u002Fcode>, and the snippet will take care of the rest. For example:\u003C\u002Fp>\u003Cpre>\u003Ccode>&lt;h4 class=&quot;fc-currency-price&quot;&gt;$15.99&lt;\u002Fh4&gt;\u003C\u002Fcode>\u003C\u002Fpre>\u003Ch2>That&#039;s it!\u003C\u002Fh2>\u003Cp>That should be it. Give your site a test and confirm that everything is working as you expect it to.\u003C\u002Fp>\u003Ch2>Advanced: Dynamically triggering recalculation\u003C\u002Fh2>\u003Cp>If for whatever reason you need to trigger the dynamic price calculations to be recreated - for example if you dynamically add in a new input that includes a price modifier, you can execute this function in your javascript:\u003C\u002Fp>\u003Cpre>\u003Ccode>FC.currency.update();\u003C\u002Fcode>\u003C\u002Fpre>\u003Ch2>Notes and Limitations\u003C\u002Fh2>\u003Cul>\u003Cli>\u003Cp>On the first time this snippet is run, it is run \u003Cstrong>after\u003C\u002Fstrong> the Foxy javascript has been initialized. As such - there may be a small time while the page is loading before the dynamic total is calculated. The snippet then uses your browser&#039;s \u003Ccode class=\"badge bg-soft-danger text-danger\">localStorage\u003C\u002Fcode> to store key information to execute on page load for subsequent pages to minimise any delay on converting.\u003C\u002Fp>\u003C\u002Fli>\u003Cli>\u003Cp>Currently only product \u003Ccode class=\"badge bg-soft-danger text-danger\">price\u003C\u002Fcode> inputs and price product option modifiers are converted. Product level discounts are not currently converted.\u003C\u002Fp>\u003C\u002Fli>\u003Cli>\u003Cp>Product links are also not currently converted.\u003C\u002Fp>\u003C\u002Fli>\u003C\u002Ful>",{"name":1222,"created_at":1223,"published_at":1224,"updated_at":1225,"id":1226,"uuid":47,"content":1227,"slug":48,"full_slug":48,"sort_by_date":59,"position":1404,"tag_list":1405,"is_startpage":24,"parent_id":59,"meta_data":59,"group_id":1406,"first_published_at":1407,"release_id":59,"lang":65,"path":59,"alternates":1408,"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":1228,"_uid":1231,"title":1232,"action":1233,"fields":1234,"method":1380,"columns":1381,"subtitle":1395,"component":48,"button_text":1401,"submit_title":1402,"submit_subtitle":1403},{"_uid":1229,"title":1222,"plugin":1230,"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",[1235,1239,1243,1351,1354,1359,1374],{"_uid":1236,"name":525,"type":332,"label":1237,"options":13,"required":33,"component":1238,"placeholder":13},"9a70b226-2036-4f90-a052-b3efa61c5896","Name","form___field",{"_uid":1240,"name":1241,"type":1241,"label":1242,"options":13,"required":33,"component":1238,"placeholder":13},"86ba35be-ff43-4a28-8633-14052a8f6622","email","Email Address",{"_uid":1244,"name":1245,"type":1246,"label":1247,"options":1248,"required":33,"component":1238,"conditions":1249,"placeholder":13},"3f827475-492c-4f97-aa1e-2386ac263b6c","topic","select","Topic","Presales, Support, Billing, Partnerships, Order Enquiry, Other",[1250,1305,1315,1322,1330,1338,1344],{"_uid":1251,"equals":1252,"fields":1253,"component":1304},"e21d97dd-e68e-4fa6-ba97-bc40f3041dde","Order Enquiry",[1254],{"_uid":1255,"body":1256,"type":1302,"title":13,"component":1303},"b64992bc-6d53-48b8-b7a0-d81e5a062e50",{"type":324,"content":1257},[1258],{"type":327,"content":1259},[1260,1262,1269,1271,1273,1274,1278,1280,1285,1293,1295,1300],{"text":1261,"type":332},"We are ",{"text":1263,"type":332,"marks":1264},"Foxy.io",[1265],{"type":867,"attrs":1266},{"href":1267,"uuid":59,"anchor":59,"custom":1268,"target":59,"linktype":31},"http:\u002F\u002FFoxy.io",{},{"text":1270,"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":1272},"hard_break",{"type":1272},{"text":1275,"type":332,"marks":1276},"NOTE:",[1277],{"type":410},{"text":1279,"type":332}," We are ",{"text":1281,"type":332,"marks":1282},"not ",[1283],{"type":1284},"italic",{"text":1286,"type":332,"marks":1287},"Foxy.in",[1288,1292],{"type":867,"attrs":1289},{"href":1290,"uuid":59,"anchor":59,"custom":1291,"target":59,"linktype":31},"http:\u002F\u002FFoxy.in",{},{"type":1284},{"text":1294,"type":332},". We are not in any way affiliated with ",{"text":1286,"type":332,"marks":1296},[1297],{"type":867,"attrs":1298},{"href":1290,"uuid":59,"anchor":59,"custom":1299,"target":59,"linktype":31},{},{"text":1301,"type":332},", and cannot help in any way with your order from that website.","danger","global___alert","form___condition",{"_uid":1306,"equals":1307,"fields":1308,"component":1304},"8765c3e1-25cf-44aa-b8ea-fc6094acf9c3","Presales",[1309],{"_uid":1310,"name":1311,"type":1312,"label":13,"options":13,"required":24,"component":1238,"conditions":1313,"placeholder":13,"default_value":1314},"cf464f8e-d643-4f6e-af29-d3abffaf7380","department_email_address","hidden",[],"hello@foxy.io",{"_uid":1316,"equals":208,"fields":1317,"component":1304},"4007b6d8-77e5-421d-bd1e-6f336dd853fb",[1318],{"_uid":1319,"name":1311,"type":1312,"label":13,"options":13,"required":24,"component":1238,"conditions":1320,"placeholder":13,"default_value":1321},"7b4c6aa5-a68c-45e0-9ce1-0a36af10c0c2",[],"help@foxy.io",{"_uid":1323,"equals":1324,"fields":1325,"component":1304},"1dbb8f11-613d-43cd-9e09-1b94f6e19219","Billing",[1326],{"_uid":1327,"name":1311,"type":1312,"label":13,"options":13,"required":24,"component":1238,"conditions":1328,"placeholder":13,"default_value":1329},"a0ac0d1b-bc4f-4a6c-a682-581d450b0b73",[],"help+billing@foxy.io",{"_uid":1331,"equals":1332,"fields":1333,"component":1304},"a0a53a50-7172-4a29-ba58-181e38874e12","Partnerships",[1334],{"_uid":1335,"name":1311,"type":1312,"label":13,"options":13,"required":24,"component":1238,"conditions":1336,"placeholder":13,"default_value":1337},"7aa011d9-f374-4aed-b5a5-929b54aaf152",[],"partners@foxy.io",{"_uid":1339,"equals":1252,"fields":1340,"component":1304},"a4cd431f-25d5-41c7-bfdc-02c908c8fb47",[1341],{"_uid":1342,"name":1311,"type":1312,"label":13,"options":13,"required":24,"component":1238,"conditions":1343,"placeholder":13,"default_value":1314},"f5d52168-d6ae-451b-94ee-2ced1cbd28ad",[],{"_uid":1345,"equals":1346,"fields":1347,"component":1304},"25aba1ed-eb41-4bbc-aa89-f7a7167ea86e","Other",[1348],{"_uid":1349,"name":1311,"type":1312,"label":13,"options":13,"required":24,"component":1238,"conditions":1350,"placeholder":13,"default_value":1314},"f40dfaef-c203-4b71-bf4e-e1b43cef192b",[],{"_uid":1352,"component":1353},"e9c53a05-f40a-4510-aaf8-bc072a235a0c","form___subject",{"_uid":1355,"name":1356,"type":1357,"label":1358,"options":13,"required":33,"component":1238,"placeholder":13},"a4c4d385-fff4-4978-99fb-b68cfea623d6","message","textarea","Message",{"_uid":1360,"name":1361,"type":1246,"label":1362,"options":1363,"required":33,"component":1238,"conditions":1364,"placeholder":13},"8a3c9f85-f438-427d-9c7a-d7b295a14b5b","existing_user","Are you an existing user?","No, Yes",[1365],{"_uid":1366,"equals":1367,"fields":1368,"component":1304},"115933d6-262a-4b59-8fa8-579c5ad73de1","Yes",[1369],{"_uid":1370,"name":1371,"type":332,"label":1372,"options":13,"required":33,"component":1238,"conditions":1373,"placeholder":13},"44b6ff23-98f0-4e95-b7f5-c23e06415c2d","subdomain","Store Subdomain",[],{"_uid":1375,"name":1376,"type":1246,"label":1377,"options":1378,"required":33,"component":1238,"conditions":1379,"placeholder":13},"922a5cef-3af2-4113-8855-36c7910e3ee3","user_type","What type of user are you?","Developer, Designer, Merchant",[],"POST",[1382],{"_uid":1383,"text":1384,"title":1393,"component":1394},"7323b90d-a93a-4bf1-baa9-20d0b7ead61b",{"type":324,"content":1385},[1386],{"type":327,"content":1387},[1388,1390,1391],{"text":1389,"type":332},"855.369.9227",{"type":1272},{"text":1392,"type":332},"9:30am-6pm Central M-F","Pre-sales, Sales, & Partnerships","contact___footer_column",{"type":324,"content":1396},[1397],{"type":327,"content":1398},[1399],{"text":1400,"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,1410],{"name":1411,"created_at":1412,"published_at":1413,"updated_at":1414,"id":1415,"uuid":1181,"content":1416,"slug":1429,"full_slug":1430,"sort_by_date":59,"position":1431,"tag_list":1432,"is_startpage":24,"parent_id":310,"meta_data":59,"group_id":1433,"first_published_at":1413,"release_id":59,"lang":65,"path":59,"alternates":1434,"default_full_slug":59,"translated_slugs":59},"Multicurrency","2026-07-17T19:03:56.599Z","2026-07-17T19:10:36.994Z","2026-07-17T19:10:37.002Z",199169788360190,{"_uid":1417,"icon":13,"name":1411,"type":1418,"pinned":24,"summary":1419,"category":13,"component":297,"blog_posts":1420,"icon_custom":1421,"case_studies":1423,"faq_sections":1424,"featured_guides":1425,"mailbox_category":13,"featured_articles":1426,"featured_blog_posts":1427,"featured_case_studies":1428},"4cd3566a-380a-4613-8ee5-2a78ec382ebb","simple","Sell in multiple currencies and convert product prices automatically.",[],{"id":59,"alt":59,"name":13,"focus":59,"title":59,"source":59,"filename":13,"copyright":59,"fieldtype":81,"meta_data":1422},{},[],[],[],[],[],[],"multicurrency","help\u002Fcategories\u002Fmulticurrency",-740,[],"faa6b6b7-a38e-488d-b22e-5bb9546ae708",[],{},1784742850108]