1/* 2* Currency Switcher Javascript 3*/ 4/* 5 * Cookie plugin 6 * 7 * Copyright (c) 2006 Klaus Hartl (stilbuero.de) 8 * Dual licensed under the MIT and GPL licenses: 9 * http://www.opensource.org/licenses/mit-license.php 10 * http://www.gnu.org/licenses/gpl.html 11 * 12 */ 13 14jQuery.cookie=function(b,j,m){if(typeof j!="undefined"){m=m||{};if(j===null){j="";m.expires=-1}var e="";if(m.expires&&(typeof m.expires=="number"||m.expires.toUTCString)){var f;if(typeof m.expires=="number"){f=new Date();f.setTime(f.getTime()+(m.expires*24*60*60*1000))}else{f=m.expires}e="; expires="+f.toUTCString()}var l=m.path?"; path="+(m.path):"";var g=m.domain?"; domain="+(m.domain):"";var a=m.secure?"; secure":"";document.cookie=[b,"=",encodeURIComponent(j),e,l,g,a].join("")}else{var d=null;if(document.cookie&&document.cookie!=""){var k=document.cookie.split(";");for(var h=0;h<k.length;h++){var c=jQuery.trim(k[h]);if(c.substring(0,b.length+1)==(b+"=")){d=decodeURIComponent(c.substring(b.length+1));break}}}return d}}; 15 16/* 17 * Currency tools 18 * 19 * Copyright (c) 2015 Caroline Schnapp ([email protected]) 20 * Licensed under the MIT license: 21 * http://www.opensource.org/licenses/mit-license.php 22 * 23 */ 24 25 26// if(typeof Currency==="undefined"){var Currency={}}Currency.cookie={configuration:{expires:365,path:"/",domain:window.location.hostname},name:"currency",write:function(a){jQuery.cookie(this.name,a,this.configuration)},read:function(){return jQuery.cookie(this.name)},destroy:function(){jQuery.cookie(this.name,null,this.configuration)}};Currency.moneyFormats={USD:{money_format:"${{amount}}",money_with_currency_format:"${{amount}} USD"},EUR:{money_format:"€{{amount}}",money_with_currency_format:"€{{amount}} EUR"},GBP:{money_format:"£{{amount}}",money_with_currency_format:"£{{amount}} GBP"},CAD:{money_format:"${{amount}}",money_with_currency_format:"${{amount}} CAD"},ALL:{money_format:"Lek {{amount}}",money_with_currency_format:"Lek {{amount}} ALL"},DZD:{money_format:"DA {{amount}}",money_with_currency_format:"DA {{amount}} DZD"},AOA:{money_format:"Kz{{amount}}",money_with_currency_format:"Kz{{amount}} AOA"},ARS:{money_format:"${{amount_with_comma_separator}}",money_with_currency_format:"${{amount_with_comma_separator}} ARS"},AMD:{money_format:"{{amount}} AMD",money_with_currency_format:"{{amount}} AMD"},AWG:{money_format:"Afl{{amount}}",money_with_currency_format:"Afl{{amount}} AWG"},AUD:{money_format:"${{amount}}",money_with_currency_format:"${{amount}} AUD"},BBD:{money_format:"${{amount}}",money_with_currency_format:"${{amount}} Bds"},AZN:{money_format:"m.{{amount}}",money_with_currency_format:"m.{{amount}} AZN"},BDT:{money_format:"Tk {{amount}}",money_with_currency_format:"Tk {{amount}} BDT"},BSD:{money_format:"BS${{amount}}",money_with_currency_format:"BS${{amount}} BSD"},BHD:{money_format:"{{amount}}0 BD",money_with_currency_format:"{{amount}}0 BHD"},BYR:{money_format:"Br {{amount}}",money_with_currency_format:"Br {{amount}} BYR"},BZD:{money_format:"BZ${{amount}}",money_with_currency_format:"BZ${{amount}} BZD"},BTN:{money_format:"Nu {{amount}}",money_with_currency_format:"Nu {{amount}} BTN"},BAM:{money_format:"KM {{amount_with_comma_separator}}",money_with_currency_format:"KM {{amount_with_comma_separator}} BAM"},BRL:{money_format:"R$ {{amount_with_comma_separator}}",money_with_currency_format:"R$ {{amount_with_comma_separator}} BRL"},BOB:{money_format:"Bs{{amount_with_comma_separator}}",money_with_currency_format:"Bs{{amount_with_comma_separator}} BOB"},BWP:{money_format:"P{{amount}}",money_with_currency_format:"P{{amount}} BWP"},BND:{money_format:"${{amount}}",money_with_currency_format:"${{amount}} BND"},BGN:{money_format:"{{amount}} лв",money_with_currency_format:"{{amount}} лв BGN"},MMK:{money_format:"K{{amount}}",money_with_currency_format:"K{{amount}} MMK"},KHR:{money_format:"KHR{{amount}}",money_with_currency_format:"KHR{{amount}}"},KYD:{money_format:"${{amount}}",money_with_currency_format:"${{amount}} KYD"},XAF:{money_format:"FCFA{{amount}}",money_with_currency_format:"FCFA{{amount}} XAF"},CLP:{money_format:"${{amount_no_decimals}}",money_with_currency_format:"${{amount_no_decimals}} CLP"},CNY:{money_format:"¥{{amount}}",money_with_currency_format:"¥{{amount}} CNY"},COP:{money_format:"${{amount_with_comma_separator}}",money_with_currency_format:"${{amount_with_comma_separator}} COP"},CRC:{money_format:"₡ {{amount_with_comma_separator}}",money_with_currency_format:"₡ {{amount_with_comma_separator}} CRC"},HRK:{money_format:"{{amount_with_comma_separator}} kn",money_with_currency_format:"{{amount_with_comma_separator}} kn HRK"},CZK:{money_format:"{{amount_with_comma_separator}} Kč",money_with_currency_format:"{{amount_with_comma_separator}} Kč"},DKK:{money_format:"{{amount_with_comma_separator}}",money_with_currency_format:"kr.{{amount_with_comma_separator}}"},DOP:{money_format:"RD$ {{amount}}",money_with_currency_format:"RD$ {{amount}}"},XCD:{money_format:"${{amount}}",money_with_currency_format:"EC${{amount}}"},EGP:{money_format:"LE {{amount}}",money_with_currency_format:"LE {{amount}} EGP"},ETB:{money_format:"Br{{amount}}",money_with_currency_format:"Br{{amount}} ETB"},XPF:{money_format:"{{amount_no_decimals_with_comma_separator}} XPF",money_with_currency_format:"{{amount_no_decimals_with_comma_separator}} XPF"},FJD:{money_format:"${{amount}}",money_with_currency_format:"FJ${{amount}}"},GMD:{money_format:"D {{amount}}",money_with_currency_format:"D {{amount}} GMD"},GHS:{money_format:"GH₵{{amount}}",money_with_currency_format:"GH₵{{amount}}"},GTQ:{money_format:"Q{{amount}}",money_with_currency_format:"{{amount}} GTQ"},GYD:{money_format:"G${{amount}}",money_with_currency_format:"${{amount}} GYD"},GEL:{money_format:"{{amount}} GEL",money_with_currency_format:"{{amount}} GEL"},HNL:{money_format:"L {{amount}}",money_with_currency_format:"L {{amount}} HNL"},HKD:{money_format:"${{amount}}",money_with_currency_format:"HK${{amount}}"},HUF:{money_format:"{{amount_no_decimals_with_comma_separator}}",money_with_currency_format:"{{amount_no_decimals_with_comma_separator}} Ft"},ISK:{money_format:"{{amount_no_decimals}} kr",money_with_currency_format:"{{amount_no_decimals}} kr ISK"},INR:{money_format:"Rs. {{amount}}",money_with_currency_format:"Rs. {{amount}}"},IDR:{money_format:"{{amount_with_comma_separator}}",money_with_currency_format:"Rp {{amount_with_comma_separator}}"},ILS:{money_format:"{{amount}} NIS",money_with_currency_format:"{{amount}} NIS"},JMD:{money_format:"${{amount}}",money_with_currency_format:"${{amount}} JMD"},JPY:{money_format:"¥{{amount_no_decimals}}",money_with_currency_format:"¥{{amount_no_decimals}} JPY"},JEP:{money_format:"£{{amount}}",money_with_currency_format:"£{{amount}} JEP"},JOD:{money_format:"{{amount}}0 JD",money_with_currency_format:"{{amount}}0 JOD"},KZT:{money_format:"{{amount}} KZT",money_with_currency_format:"{{amount}} KZT"},KES:{money_format:"KSh{{amount}}",money_with_currency_format:"KSh{{amount}}"},KWD:{money_format:"{{amount}}0 KD",money_with_currency_format:"{{amount}}0 KWD"},KGS:{money_format:"лв{{amount}}",money_with_currency_format:"лв{{amount}}"},LVL:{money_format:"Ls {{amount}}",money_with_currency_format:"Ls {{amount}} LVL"},LBP:{money_format:"L£{{amount}}",money_with_currency_format:"L£{{amount}} LBP"},LTL:{money_format:"{{amount}} Lt",money_with_currency_format:"{{amount}} Lt"},MGA:{money_format:"Ar {{amount}}",money_with_currency_format:"Ar {{amount}} MGA"},MKD:{money_format:"ден {{amount}}",money_with_currency_format:"ден {{amount}} MKD"},MOP:{money_format:"MOP${{amount}}",money_with_currency_format:"MOP${{amount}}"},MVR:{money_format:"Rf{{amount}}",money_with_currency_format:"Rf{{amount}} MRf"},MXN:{money_format:"$ {{amount}}",money_with_currency_format:"$ {{amount}} MXN"},MYR:{money_format:"RM{{amount}} MYR",money_with_currency_format:"RM{{amount}} MYR"},MUR:{money_format:"Rs {{amount}}",money_with_currency_format:"Rs {{amount}} MUR"},MDL:{money_format:"{{amount}} MDL",money_with_currency_format:"{{amount}} MDL"},MAD:{money_format:"{{amount}} dh",money_with_currency_format:"Dh {{amount}} MAD"},MNT:{money_format:"{{amount_no_decimals}} ₮",money_with_currency_format:"{{amount_no_decimals}} MNT"},MZN:{money_format:"{{amount}} Mt",money_with_currency_format:"Mt {{amount}} MZN"},NAD:{money_format:"N${{amount}}",money_with_currency_format:"N${{amount}} NAD"},NPR:{money_format:"Rs{{amount}}",money_with_currency_format:"Rs{{amount}} NPR"},ANG:{money_format:"ƒ{{amount}}",money_with_currency_format:"{{amount}} NAƒ"},NZD:{money_format:"${{amount}}",money_with_currency_format:"${{amount}} NZD"},NIO:{money_format:"C${{amount}}",money_with_currency_format:"C${{amount}} NIO"},NGN:{money_format:"₦{{amount}}",money_with_currency_format:"₦{{amount}} NGN"},NOK:{money_format:"kr {{amount_with_comma_separator}}",money_with_currency_format:"kr {{amount_with_comma_separator}} NOK"},OMR:{money_format:"{{amount_with_comma_separator}} OMR",money_with_currency_format:"{{amount_with_comma_separator}} OMR"},PKR:{money_format:"Rs.{{amount}}",money_with_currency_format:"Rs.{{amount}} PKR"},PGK:{money_format:"K {{amount}}",money_with_currency_format:"K {{amount}} PGK"},PYG:{money_format:"Gs. {{amount_no_decimals_with_comma_separator}}",money_with_currency_format:"Gs. {{amount_no_decimals_with_comma_separator}} PYG"},PEN:{money_format:"S/. {{amount}}",money_with_currency_format:"S/. {{amount}} PEN"},PHP:{money_format:"₱{{amount}}",money_with_currency_format:"₱{{amount}} PHP"},PLN:{money_format:"{{amount_with_comma_separator}} zl",money_with_currency_format:"{{amount_with_comma_separator}} zl PLN"},QAR:{money_format:"QAR {{amount_with_comma_separator}}",money_with_currency_format:"QAR {{amount_with_comma_separator}}"},RON:{money_format:"{{amount_with_comma_separator}} lei",money_with_currency_format:"{{amount_with_comma_separator}} lei RON"},RUB:{money_format:"руб{{amount_with_comma_separator}}",money_with_currency_format:"руб{{amount_with_comma_separator}} RUB"},RWF:{money_format:"{{amount_no_decimals}} RF",money_with_currency_format:"{{amount_no_decimals}} RWF"},WST:{money_format:"WS$ {{amount}}",money_with_currency_format:"WS$ {{amount}} WST"},SAR:{money_format:"{{amount}} SR",money_with_currency_format:"{{amount}} SAR"},STD:{money_format:"Db {{amount}}",money_with_currency_format:"Db {{amount}} STD"},RSD:{money_format:"{{amount}} RSD",money_with_currency_format:"{{amount}} RSD"},SCR:{money_format:"Rs {{amount}}",money_with_currency_format:"Rs {{amount}} SCR"},SGD:{money_format:"${{amount}}",money_with_currency_format:"${{amount}} SGD"},SYP:{money_format:"S£{{amount}}",money_with_currency_format:"S£{{amount}} SYP"},ZAR:{money_format:"R {{amount}}",money_with_currency_format:"R {{amount}} ZAR"},KRW:{money_format:"₩{{amount_no_decimals}}",money_with_currency_format:"₩{{amount_no_decimals}} KRW"},LKR:{money_format:"Rs {{amount}}",money_with_currency_format:"Rs {{amount}} LKR"},SEK:{money_format:"{{amount_no_decimals}} kr",money_with_currency_format:"{{amount_no_decimals}} kr SEK"},CHF:{money_format:"SFr. {{amount}}",money_with_currency_format:"SFr. {{amount}} CHF"},TWD:{money_format:"${{amount}}",money_with_currency_format:"${{amount}} TWD"},THB:{money_format:"{{amount}} ฿",money_with_currency_format:"{{amount}} ฿ THB"},TZS:{money_format:"{{amount}} TZS",money_with_currency_format:"{{amount}} TZS"},TTD:{money_format:"${{amount}}",money_with_currency_format:"${{amount}} TTD"},TND:{money_format:"{{amount}}",money_with_currency_format:"{{amount}} DT"},TRY:{money_format:"{{amount}}TL",money_with_currency_format:"{{amount}}TL"},UGX:{money_format:"Ush {{amount_no_decimals}}",money_with_currency_format:"Ush {{amount_no_decimals}} UGX"},UAH:{money_format:"â´{{amount}}",money_with_currency_format:"â´{{amount}} UAH"},AED:{money_format:"Dhs. {{amount}}",money_with_currency_format:"Dhs. {{amount}} AED"},UYU:{money_format:"${{amount_with_comma_separator}}",money_with_currency_format:"${{amount_with_comma_separator}} UYU"},VUV:{money_format:"${{amount}}",money_with_currency_format:"${{amount}}VT"},VEF:{money_format:"Bs. {{amount_with_comma_separator}}",money_with_currency_format:"Bs. {{amount_with_comma_separator}} VEF"},VND:{money_format:"{{amount_no_decimals_with_comma_separator}}₫",money_with_currency_format:"{{amount_no_decimals_with_comma_separator}} VND"},XBT:{money_format:"{{amount_no_decimals}} BTC",money_with_currency_format:"{{amount_no_decimals}} BTC"},XOF:{money_format:"CFA{{amount}}",money_with_currency_format:"CFA{{amount}} XOF"},ZMW:{money_format:"K{{amount_no_decimals_with_comma_separator}}",money_with_currency_format:"ZMW{{amount_no_decimals_with_comma_separator}}"}};Currency.formatMoney=function(b,g){if(typeof Shopify.formatMoney==="function"){return Shopify.formatMoney(b,g)}if(typeof b=="string"){b=b.replace(".","")}var f="";var e=/\{\{\s*(\w+)\s*\}\}/;var a=g||"${{amount}}";function c(h,i){return(typeof h=="undefined"?i:h)}function d(m,k,l,j){k=c(k,2);l=c(l,",");j=c(j,".");if(isNaN(m)||m==null){return 0}m=(m/100).toFixed(k);var n=m.split("."),i=n[0].replace(/(\d)(?=(\d\d\d)+(?!\d))/g,"$1"+l),h=n[1]?(j+n[1]):"";return i+h}switch(a.match(e)[1]){case"amount":f=d(b,2);break;case"amount_no_decimals":f=d(b,0);break;case"amount_with_comma_separator":f=d(b,2,".",",");break;case"amount_no_decimals_with_comma_separator":f=d(b,0,".",",");break}return a.replace(e,f)};Currency.currentCurrency="";Currency.format="money_with_currency_format";Currency.convertAll=function(c,b,a,d){jQuery(a||"span.money").each(function(){if(jQuery(this).attr("data-currency")===b){return}if(jQuery(this).attr("data-currency-"+b)){jQuery(this).html(jQuery(this).attr("data-currency-"+b))}else{var e=0;var f=Currency.moneyFormats[c][d||Currency.format]||"{{amount}}";var g=Currency.moneyFormats[b][d||Currency.format]||"{{amount}}";if(f.indexOf("amount_no_decimals")!==-1){e=Currency.convert(parseInt(j
26Query(this).html().replace(/[^0-9]/g,""),10)*100,c,b)}else{if(c==="JOD"||c=="KWD"||c=="BHD"){e=Currency.convert(parseInt(jQuery(this).html().replace(/[^0-9]/g,""),10)/10,c,b)}else{e=Currency.convert(parseInt(jQuery(this).html().replace(/[^0-9]/g,""),10),c,b)}}var h=Currency.formatMoney(e,g);jQuery(this).html(h);jQuery(this).attr("data-currency-"+b,h)}jQuery(this).attr("data-currency",b)});this.currentCurrency=b;this.cookie.write(b)}; 27 28/* 29 * Currency tools 30 * 31 * Copyright (c) 2015 Caroline Schnapp ([email protected]) 32 * Licensed under the MIT license: 33 * http://www.opensource.org/licenses/mit-license.php 34 * 35 */ 36 37if (typeof Currency === 'undefined') { 38 var Currency = {}; 39} 40 41Currency.cookie = { 42 configuration: { 43 expires: 365, 44 path: '/', 45 domain: window.location.hostname 46 }, 47 name: 'currency', 48 write: function(currency) { 49 jQuery.cookie(this.name, currency, this.configuration); 50 }, 51 read: function() { 52 return jQuery.cookie(this.name); 53 }, 54 destroy: function() { 55 jQuery.cookie(this.name, null, this.configuration); 56 } 57}; 58 59Currency.moneyFormats = { 60 "USD":{ 61 "money_format":"${{amount}}", 62 "money_with_currency_format":"${{amount}} USD" 63 }, 64 "EUR":{ 65 "money_format":"â¬{{amount_with_comma_separator}}", 66 "money_with_currency_format":"â¬{{amount_with_comma_separator}} EUR" 67 }, 68 "GBP":{ 69 "money_format":"£{{amount}}", 70 "money_with_currency_format":"£{{amount}} GBP" 71 }, 72 "CAD":{ 73 "money_format":"${{amount}}", 74 "money_with_currency_format":"${{amount}} CAD" 75 }, 76 "ALL":{ 77 "money_format":"Lek {{amount}}", 78 "money_with_currency_format":"Lek {{amount}} ALL" 79 }, 80 "DZD":{ 81 "money_format":"DA {{amount}}", 82 "money_with_currency_format":"DA {{amount}} DZD" 83 }, 84 "AOA":{ 85 "money_format":"Kz{{amount}}", 86 "money_with_currency_format":"Kz{{amount}} AOA" 87 }, 88 "ARS":{ 89 "money_format":"${{amount_with_comma_separator}}", 90 "money_with_currency_format":"${{amount_with_comma_separator}} ARS" 91 }, 92 "AMD":{ 93 "money_format":"{{amount}} AMD", 94 "money_with_currency_format":"{{amount}} AMD" 95 }, 96 "AWG":{ 97 "money_format":"Afl{{amount}}", 98 "money_with_currency_format":"Afl{{amount}} AWG" 99 }, 100 "AUD":{ 101 "money_format":"${{amount}}", 102 "money_with_currency_format":"${{amount}} AUD" 103 }, 104 "BBD":{ 105 "money_format":"${{amount}}", 106 "money_with_currency_format":"${{amount}} Bds" 107 }, 108 "AZN":{ 109 "money_format":"m.{{amount}}", 110 "money_with_currency_format":"m.{{amount}} AZN" 111 }, 112 "BDT":{ 113 "money_format":"Tk {{amount}}", 114 "money_with_currency_format":"Tk {{amount}} BDT" 115 }, 116 "BSD":{ 117 "money_format":"BS${{amount}}", 118 "money_with_currency_format":"BS${{amount}} BSD" 119 }, 120 "BHD":{ 121 "money_format":"{{amount}}0 BD", 122 "money_with_currency_format":"{{amount}}0 BHD" 123 }, 124 "BYR":{ 125 "money_format":"Br {{amount}}", 126 "money_with_currency_format":"Br {{amount}} BYR" 127 }, 128 "BZD":{ 129 "money_format":"BZ${{amount}}", 130 "money_with_currency_format":"BZ${{amount}} BZD" 131 }, 132 "BTN":{ 133 "money_format":"Nu {{amount}}", 134 "money_with_currency_format":"Nu {{amount}} BTN" 135 }, 136 "BAM":{ 137 "money_format":"KM {{amount_with_comma_separator}}", 138 "money_with_currency_format":"KM {{amount_with_comma_separator}} BAM" 139 }, 140 "BRL":{ 141 "money_format":"R$ {{amount_with_comma_separator}}", 142 "money_with_currency_format":"R$ {{amount_with_comma_separator}} BRL" 143 }, 144 "BOB":{ 145 "money_format":"Bs{{amount_with_comma_separator}}", 146 "money_with_currency_format":"Bs{{amount_with_comma_separator}} BOB" 147 }, 148 "BWP":{ 149 "money_format":"P{{amount}}", 150 "money_with_currency_format":"P{{amount}} BWP" 151 }, 152 "BND":{ 153 "money_format":"${{amount}}", 154 "money_with_currency_format":"${{amount}} BND" 155 }, 156 "BGN":{ 157 "money_format":"{{amount}} лв", 158 "money_with_currency_format":"{{amount}} лв BGN" 159 }, 160 "MMK":{ 161 "money_format":"K{{amount}}", 162 "money_with_currency_format":"K{{amount}} MMK" 163 }, 164 "KHR":{ 165 "money_format":"KHR{{amount}}", 166 "money_with_currency_format":"KHR{{amount}}" 167 }, 168 "KYD":{ 169 "money_format":"${{amount}}", 170 "money_with_currency_format":"${{amount}} KYD" 171 }, 172 "XAF":{ 173 "money_format":"FCFA{{amount}}", 174 "money_with_currency_format":"FCFA{{amount}} XAF" 175 }, 176 "CLP":{ 177 "money_format":"${{amount_no_decimals}}", 178 "money_with_currency_format":"${{amount_no_decimals}} CLP" 179 }, 180 "CNY":{ 181 "money_format":"¥{{amount}}", 182 "money_with_currency_format":"¥{{amount}} CNY" 183 }, 184 "COP":{ 185 "money_format":"${{amount_with_comma_separator}}", 186 "money_with_currency_format":"${{amount_with_comma_separator}} COP" 187 }, 188 "CRC":{ 189 "money_format":"₡ {{amount_with_comma_separator}}", 190 "money_with_currency_format":"₡ {{amount_with_comma_separator}} CRC" 191 }, 192 "HRK":{ 193 "money_format":"{{amount_with_comma_separator}} kn", 194 "money_with_currency_format":"{{amount_with_comma_separator}} kn HRK" 195 }, 196 "CZK":{ 197 "money_format":"{{amount_with_comma_separator}} Kč", 198 "money_with_currency_format":"{{amount_with_comma_separator}} Kč" 199 }, 200 "DKK":{ 201 "money_format":"{{amount_with_comma_separator}}", 202 "money_with_currency_format":"kr.{{amount_with_comma_separator}}" 203 }, 204 "DOP":{ 205 "money_format":"RD$ {{amount}}", 206 "money_with_currency_format":"RD$ {{amount}}" 207 }, 208 "XCD":{ 209 "money_format":"${{amount}}", 210 "money_with_currency_format":"EC${{amount}}" 211 }, 212 "EGP":{ 213 "money_format":"LE {{amount}}", 214 "money_with_currency_format":"LE {{amount}} EGP" 215 }, 216 "ETB":{ 217 "money_format":"Br{{amount}}", 218 "money_with_currency_format":"Br{{amount}} ETB" 219 }, 220 "XPF":{ 221 "money_format":"{{amount_no_decimals_with_comma_separator}} XPF", 222 "money_with_currency_format":"{{amount_no_decimals_with_comma_separator}} XPF" 223 }, 224 "FJD":{ 225 "money_format":"${{amount}}", 226 "money_with_currency_format":"FJ${{amount}}" 227 }, 228 "GMD":{ 229 "money_format":"D {{amount}}", 230 "money_with_currency_format":"D {{amount}} GMD" 231 }, 232 "GHS":{ 233 "money_format":"GH₵{{amount}}", 234 "money_with_currency_format":"GH₵{{amount}}" 235 }, 236 "GTQ":{ 237 "money_format":"Q{{amount}}", 238 "money_with_currency_format":"{{amount}} GTQ" 239 }, 240 "GYD":{ 241 "money_format":"G${{amount}}", 242 "money_with_currency_format":"${{amount}} GYD" 243 }, 244 "GEL":{ 245 "money_format":"{{amount}} GEL", 246 "money_with_currency_format":"{{amount}} GEL" 247 }, 248 "HNL":{ 249 "money_format":"L {{amount}}", 250 "money_with_currency_format":"L {{amount}} HNL" 251 }, 252 "HKD":{ 253 "money_format":"${{amount}}", 254 "money_with_currency_format":"HK${{amount}}" 255 }, 256 "HUF":{ 257 "money_format":"{{amount_no_decimals_with_comma_separator}}", 258 "money_with_currency_format":"{{amount_no_decimals_with_comma_separator}} Ft" 259 }, 260 "ISK":{ 261 "money_format":"{{amount_no_decimals}} kr", 262 "money_with_currency_format":"{{amount_no_decimals}} kr ISK" 263 }, 264 "INR":{ 265 "money_format":"Rs. {{amount}}", 266 "money_with_currency_format":"Rs. {{amount}}" 267 }, 268 "IDR":{ 269 "money_format":"{{amount_with_comma_separator}}", 270 "money_with_currency_format":"Rp {{amount_with_comma_separator}}" 271 }, 272 "ILS":{ 273 "money_format":"{{amount}} NIS", 274 "money_with_currency_format":"{{amount}} NIS" 275 }, 276 "JMD":{ 277 "money_format":"${{amount}}", 278 "money_with_currency_format":"${{amount}} JMD" 279 }, 280 "JPY":{ 281 "money_format":"¥{{amount_no_decimals}}", 282 "money_with_currency_format":"¥{{amount_no_decimals}} JPY" 283 }, 284 "JEP":{ 285 "money_format":"£{{amount}}", 286 "money_with_currency_format":"£{{amount}} JEP" 287 }, 288 "JOD":{ 289 "money_format":"{{amount}}0 JD", 290 "money_with_currency_format":"{{amount}}0 JOD" 291 }, 292 "KZT":{ 293 "money_format":"{{amount}} KZT", 294 "money_with_currency_format":"{{amount}} KZT" 295 }, 296 "KES":{ 297 "money_format":"KSh{{amount}}", 298 "money_with_currency_format":"KSh{{amount}}" 299 }, 300 "KWD":{ 301 "money_format":"{{amount}}0 KD", 302 "money_with_currency_format":"{{amount}}0 KWD" 303 }, 304 "KGS":{ 305 "money_format":"лв{{amount}}", 306 "money_with_currency_format":"лв{{amount}}" 307 }, 308 "LVL":{ 309 "money_format":"Ls {{amount}}", 310 "money_with_currency_format":"Ls {{amount}} LVL" 311 }, 312 "LBP":{ 313 "money_format":"L£{{amount}}", 314 "money_with_currency_format":"L£{{amount}} LBP" 315 }, 316 "LTL":{ 317 "money_format":"{{amount}} Lt", 318 "money_with_currency_format":"{{amount}} Lt" 319 }, 320 "MGA":{ 321 "money_format":"Ar {{amount}}", 322 "money_with_currency_format":"Ar {{amount}} MGA" 323 }, 324 "MKD":{ 325 "money_format":"ден {{amount}}", 326 "money_with_currency_format":"ден {{amount}} MKD" 327 }, 328 "MOP":{ 329 "money_format":"MOP${{amount}}", 330 "money_with_currency_format":"MOP${{amount}}" 331 }, 332 "MVR":{ 333 "money_format":"Rf{{amount}}", 334 "money_with_currency_format":"Rf{{amount}} MRf" 335 }, 336 "MXN":{ 337 "money_format":"$ {{amount}}", 338 "money_with_currency_format":"$ {{amount}} MXN" 339 }, 340 "MYR":{ 341 "money_format":"RM{{amount}} MYR", 342 "money_with_currency_format":"RM{{amount}} MYR" 343 }, 344 "MUR":{ 345 "money_format":"Rs {{amount}}", 346 "money_with_currency_format":"Rs {{amount}} MUR" 347 }, 348 "MDL":{ 349 "money_format":"{{amount}} MDL", 350 "money_with_currency_format":"{{amount}} MDL" 351 }, 352 "MAD":{ 353 "money_format":"{{amount}} dh", 354 "money_with_currency_format":"Dh {{amount}} MAD" 355 }, 356 "MNT":{ 357 "money_format":"{{amount_no_decimals}} ₮", 358 "money_with_currency_format":"{{amount_no_decimals}} MNT" 359 }, 360 "MZN":{ 361 "money_format":"{{amount}} Mt", 362 "money_with_currency_format":"Mt {{amount}} MZN" 363 }, 364 "NAD":{ 365 "money_format":"N${{amount}}", 366 "money_with_currency_format":"N${{amount}} NAD" 367 }, 368 "NPR":{ 369 "money_format":"Rs{{amount}}", 370 "money_with_currency_format":"Rs{{amount}} NPR" 371 }, 372 "ANG":{ 373 "money_format":"ƒ{{amount}}", 374 "money_with_currency_format":"{{amount}} NAƒ" 375 }, 376 "NZD":{ 377 "money_format":"${{amount}}", 378 "money_with_currency_format":"${{amount}} NZD" 379 }, 380 "NIO":{ 381 "money_format":"C${{amount}}", 382 "money_with_currency_format":"C${{amount}} NIO" 383 }, 384 "NGN":{ 385 "money_format":"₦{{amount}}", 386 "money_with_currency_format":"₦{{amount}} NGN" 387 }, 388 "NOK":{ 389 "money_format":"kr {{amount_with_comma_separator}}", 390 "money_with_currency_format":"kr {{amount_with_comma_separator}} NOK" 391 }, 392 "OMR":{ 393 "money_format":"{{amount_with_comma_separator}} OMR", 394 "money_with_currency_format":"{{amount_with_comma_separator}} OMR" 395 }, 396 "PKR":{ 397 "money_format":"Rs.{{amount}}", 398 "money_with_currency_format":"Rs.{{amount}} PKR" 399 }, 400 "PGK":{ 401 "money_format":"K {{amount}}", 402 "money_with_currency_format":"K {{amount}} PGK" 403 }, 404 "PYG":{ 405 "money_format":"Gs. {{amount_no_decimals_with_comma_separator}}", 406 "money_with_currency_format":"Gs. {{amount_no_decimals_with_comma_separator}} PYG" 407 }, 408 "PEN":{ 409 "money_format":"S/. {{amount}}", 410 "money_with_currency_format":"S/. {{amount}} PEN" 411 }, 412 "PHP":{ 413 "money_format":"₱{{amount}}", 414 "money_with_currency_format":"₱{{amount}} PHP" 415 }, 416 "PLN":{ 417 "money_format":"{{amount_with_comma_separator}} zl", 418 "money_with_currency_format":"{{amount_with_comma_separator}} zl PLN" 419 }, 420 "QAR":{ 421 "money_format":"QAR {{amount_with_comma_separator}}", 422 "money_with_currency_format":"QAR {{amount_with_comma_separator}}" 423 }, 424 "RON":{ 425 "money_format":"{{amount_with_comma_separator}} lei", 426 "money_with_currency_format":"{{amount_with_comma_separator}} lei RON" 427 }, 428 "RUB":{ 429 "money_format":"руб{{amount_with_comma_separator}}", 430 "money_with_currency_format":"руб{{amount_with_comma_separator}} RUB" 431 }, 432 "RWF":{ 433 "money_format":"{{amount_no_decimals}} RF", 434 "money_with_currency_format":"{{amount_no_decimals}} RWF" 435 }, 436 "WST":{ 437 "money_format":"WS$ {{amount}}", 438 "money_with_currency_format":"WS$ {{amount}} WST" 439 }, 440 "SAR":{ 441 "money_format":"{{amount}} SR", 442 "money_with_currency_format":"{{amount}} SAR" 443 }, 444 "STD":{ 445 "money_format":"Db {{amount}}", 446 "money_with_currency_format":"Db {{amount}} STD" 447 }, 448 "RSD":{ 449 "money_format":"{{amount}} RSD", 450 "money_with_currency_format":"{{amount}} RSD" 451 }, 452 "SCR":{ 453 "money_format":"Rs {{amount}}", 454 "money_with_currency_format":"Rs {{amount}} SCR" 455 }, 456 "SGD":{ 457 "money_format":"${{amount}}", 458 "money_with_currency_format":"${{amount}} SGD" 459 }, 460 "SYP":{ 461 "money_format":"S£{{amount}}", 462 "money_with_currency_format":"S£{{amount}} SYP" 463 }, 464 "ZAR":{ 465 "money_format":"R {{amount}}", 466 "money_with_currency_format":"R {{amount}} ZAR" 467 }, 468 "KRW":{ 469 "money_format":"₩{{amount_no_decimals}}", 470 "money_with_currency_format":"₩{{amount_no_decimals}} KRW" 471 }, 472 "LKR":{ 473 "money_format":"Rs {{amount}}", 474 "money_with_currency_format":"Rs {{amount}} LKR" 475 }, 476 "SEK":{ 477 "money_format":"{{amount_no_decimals}} kr", 478 "money_with_currency_format":"{{amount_no_decimals}} kr SEK" 479 }, 480 "CHF":{ 481 "money_format":"CHF {{amount}}", 482 "money_with_currency_format":"CHF {{amount}} CHF" 483 }, 484 "TWD":{ 485 "money_format":"${{amount}}", 486 "money_with_currency_format":"${{amount}} TWD" 487 }, 488 "THB":{ 489 "money_format":"{{amount}} ฿", 490 "money_with_currency_format":"{{amount}} ฿ THB" 491 }, 492 "TZS":{ 493 "money_format":"{{amount}} TZS", 494 "money_with_currency_format":"{{amount}} TZS" 495 }, 496 "TTD":{ 497 "money_format":"${{amount}}", 498 "money_with_currency_format":"${{amount}} TTD" 499 }, 500 "TND":{ 501 "money_format":"{{amount}}", 502 "money_with_currency_format":"{{amount}} DT" 503 }, 504 "TRY":{ 505 "money_format":"{{amount}}TL", 506 "money_with_currency_format":"{{amount}}TL" 507 }, 508 "UGX":{ 509 "money_format":"Ush {{amount_no_decimals}}", 510 "money_with_currency_format":"Ush {{amount_no_decimals}} UGX" 511 }, 512 "UAH":{ 513 "money_format":"â´{{amount}}", 514 "money_with_currency_format":"â´{{amount}} UAH" 515 }, 516 "AED":{ 517 "money_format":"Dhs. {{amount}}", 518 "money_with_currency_format":"Dhs. {{amount}} AED" 519 }, 520 "UYU":{ 521 "money_format":"${{amount_with_comma_separator}}", 522 "money_with_currency_format":"${{amount_with_comma_separator}} UYU" 523 }, 524 "VUV":{ 525 "money_format":"${{amount}}", 526 "money_with_currency_format":"${{amount}}VT" 527 }, 528 "VEF":{ 529 "money_format":"Bs. {{amount_with_comma_separator}}", 530 "money_with_currency_format":"Bs. {{amount_with_comma_separator}} VEF" 531 }, 532 "VND":{ 533 "money_format":"{{amount_no_decimals_with_comma_separator}}₫", 534 "money_with_currency_format":"{{amount_no_decimals_with_comma_separator}} VND" 535 }, 536 "XBT":{ 537 "money_format":"{{amount_no_decimals}} BTC", 538 "money_with_currency_format":"{{amount_no_decimals}} BTC" 539 }, 540 "XOF":{ 541 "money_format":"CFA{{amount}}", 542 "money_with_currency_format":"CFA{{amount}} XOF" 543 }, 544 "ZMW":{ 545 "money_format":"K{{amount_no_decimals_with_comma_separator}}", 546 "money_with_currency_format":"ZMW{{amount_no_decimals_with_comma_separator}}" 547 } 548}; 549 550Currency.formatMoney = function(cents, format) { 551 if (typeof Shopify.formatMoney === 'function') { 552 return Shopify.formatMoney(cents, format); 553 } 554 if (typeof cents == 'string') { cents = cents.replace('.',''); } 555 var value = ''; 556 var placeholderRegex = /\{\{\s*(\w+)\s*\}\}/; 557 var formatString = format || '${{amount}}'; 558 function defaultOption(opt, def) { 559 return (typeof opt == 'undefined' ? def : opt); 560 } 561 function formatWithDelimiters(number, precision, thousands, decimal) { 562 precision = defaultOption(precision, 2); 563 thousands = defaultOption(thousands, ','); 564 decimal = defaultOption(decimal, '.'); 565 if (isNaN(number) || number == null) { return 0; } 566 number = (number/100.0).toFixed(precision); 567 var parts = number.split('.'), 568 dollars = parts[0].replace(/(\d)(?=(\d\d\d)+(?!\d))/g, '$1' + thousands), 569 cents = parts[1] ? (decimal + parts[1]) : ''; 570 return dollars + cents; 571 } 572 switch(formatString.match(placeholderRegex)[1]) { 573 case 'amount': 574 value = formatWithDelimiters(cents, 2); 575 break; 576 case 'amount_no_decimals': 577 value = formatWithDelimiters(cents, 0); 578 break; 579 case 'amount_with_comma_separator': 580 value = formatWithDelimiters(cents, 2, '.', ','); 581 break; 582 case 'amo
582unt_no_decimals_with_comma_separator': 583 value = formatWithDelimiters(cents, 0, '.', ','); 584 break; 585 } 586 return formatString.replace(placeholderRegex, value); 587}; 588 589Currency.currentCurrency = ''; 590 591Currency.format = 'money_with_currency_format'; 592 593Currency.convertAll = function(oldCurrency, newCurrency, selector, format) { 594 jQuery(selector || 'span.money').each(function() { 595 // If the amount has already been converted, we leave it alone. 596 if (jQuery(this).attr('data-currency') === newCurrency) return; 597 // If we are converting to a currency that we have saved, we will use the saved amount. 598 if (jQuery(this).attr('data-currency-'+newCurrency)) { 599 jQuery(this).html(jQuery(this).attr('data-currency-'+newCurrency)); 600 } 601 else { 602 // Converting to Y for the first time? Let's get to it! 603 var cents = 0.0; 604 var oldFormat = Currency.moneyFormats[oldCurrency][format || Currency.format] || '{{amount}}'; 605 var newFormat = Currency.moneyFormats[newCurrency][format || Currency.format] || '{{amount}}'; 606 if (oldFormat.indexOf('amount_no_decimals') !== -1) { 607 cents = Currency.convert(parseInt(jQuery(this).html().replace(/[^0-9]/g, ''), 10)*100, oldCurrency, newCurrency); 608 } 609 else if (oldCurrency === 'JOD' || oldCurrency == 'KWD' || oldCurrency == 'BHD') { 610 cents = Currency.convert(parseInt(jQuery(this).html().replace(/[^0-9]/g, ''), 10)/10, oldCurrency, newCurrency); 611 } 612 else { 613 cents = Currency.convert(parseInt(jQuery(this).html().replace(/[^0-9]/g, ''), 10), oldCurrency, newCurrency); 614 } 615 if (theme.currency === newCurrency) { 616 cents = jQuery(this).closest('[data-original-price]').attr('data-original-price'); 617 } 618 var newFormattedAmount = Currency.formatMoney(cents, newFormat); 619 jQuery(this).html(newFormattedAmount); 620 jQuery(this).attr('data-currency-'+newCurrency, newFormattedAmount); 621 } 622 // We record the new currency locally. 623 jQuery(this).attr('data-currency', newCurrency); 624 }); 625 this.currentCurrency = newCurrency; 626 theme.newCurrency = newCurrency; 627 this.cookie.write(newCurrency); 628};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.