1/* 2 * Cookie plugin 3 * 4 * Copyright (c) 2006 Klaus Hartl (stilbuero.de) 5 * Dual licensed under the MIT and GPL licenses: 6 * http://www.opensource.org/licenses/mit-license.php 7 * http://www.gnu.org/licenses/gpl.html 8 * 9 */ 10 11jQuery.cookie = function (b, j, m) { 12 if (typeof j != "undefined") { 13 m = m || {}; 14 if (j === null) { 15 j = ""; 16 m.expires = -1 17 } 18 var e = ""; 19 if (m.expires && (typeof m.expires == "number" || m.expires.toUTCString)) { 20 var f; 21 if (typeof m.expires == "number") { 22 f = new Date(); 23 f.setTime(f.getTime() + (m.expires * 24 * 60 * 60 * 1000)) 24 } else { 25 f = m.expires 26 } 27 e = "; expires=" + f.toUTCString() 28 } 29 var l = m.path ? "; path=" + (m.path) : ""; 30 var g = m.domain ? "; domain=" + (m.domain) : ""; 31 var a = m.secure ? "; secure" : ""; 32 document.cookie = [b, "=", encodeURIComponent(j), e, l, g, a].join("") 33 } else { 34 var d = null; 35 if (document.cookie && document.cookie != "") { 36 var k = document.cookie.split(";"); 37 for (var h = 0; h < k.length; h++) { 38 var c = jQuery.trim(k[h]); 39 if (c.substring(0, b.length + 1) == (b + "=")) { 40 d = decodeURIComponent(c.substring(b.length + 1)); 41 break 42 } 43 } 44 } 45 return d 46 } 47}; 48 49/* 50 * Currency tools 51 * 52 * Copyright (c) 2015 Caroline Schnapp ([email protected]) 53 * Licensed under the MIT license: 54 * http://www.opensource.org/licenses/mit-license.php 55 * 56 */ 57 58 59if (typeof Currency === "undefined") { 60 var Currency = {} 61} 62Currency.cookie = { 63 configuration: { 64 expires: 365, 65 path: "/", 66 domain: window.location.hostname 67 }, 68 name: "currency", 69 write: function (a) { 70 jQuery.cookie(this.name, a, this.configuration) 71 }, 72 read: function () { 73 return jQuery.cookie(this.name) 74 }, 75 destroy: function () { 76 jQuery.cookie(this.name, null, this.configuration) 77 } 78}; 79Currency.moneyFormats = { 80 USD: { 81 money_format: "${{amount}}", 82 money_with_currency_format: "${{amount}}" 83 }, 84 EUR: { 85 money_format: "€{{amount}}", 86 money_with_currency_format: "€{{amount}}" 87 }, 88 GBP: { 89 money_format: "£{{amount}}", 90 money_with_currency_format: "£{{amount}}" 91 }, 92 CAD: { 93 money_format: "${{amount}}", 94 money_with_currency_format: "C${{amount}}" 95 }, 96 ALL: { 97 money_format: "Lek {{amount}}", 98 money_with_currency_format: "Lek {{amount}} ALL" 99 }, 100 DZD: { 101 money_format: "DA {{amount}}", 102 money_with_currency_format: "DA {{amount}} DZD" 103 }, 104 AOA: { 105 money_format: "Kz{{amount}}", 106 money_with_currency_format: "Kz{{amount}} AOA" 107 }, 108 ARS: { 109 money_format: "${{amount_with_comma_separator}}", 110 money_with_currency_format: "${{amount_with_comma_separator}} ARS" 111 }, 112 AMD: { 113 money_format: "{{amount}} AMD", 114 money_with_currency_format: "{{amount}} AMD" 115 }, 116 AWG: { 117 money_format: "Afl{{amount}}", 118 money_with_currency_format: "Afl{{amount}} AWG" 119 }, 120 AUD: { 121 money_format: "${{amount}}", 122 money_with_currency_format: "${{amount}}" 123 }, 124 BBD: { 125 money_format: "${{amount}}", 126 money_with_currency_format: "${{amount}} Bds" 127 }, 128 AZN: { 129 money_format: "m.{{amount}}", 130 money_with_currency_format: "m.{{amount}} AZN" 131 }, 132 BDT: { 133 money_format: "Tk {{amount}}", 134 money_with_currency_format: "Tk {{amount}} BDT" 135 }, 136 BSD: { 137 money_format: "BS${{amount}}", 138 money_with_currency_format: "BS${{amount}} BSD" 139 }, 140 BHD: { 141 money_format: "{{amount}}0 BD", 142 money_with_currency_format: "{{amount}}0 BHD" 143 }, 144 BYR: { 145 money_format: "Br {{amount}}", 146 money_with_currency_format: "Br {{amount}} BYR" 147 }, 148 BZD: { 149 money_format: "BZ${{amount}}", 150 money_with_currency_format: "BZ${{amount}} BZD" 151 }, 152 BTN: { 153 money_format: "Nu {{amount}}", 154 money_with_currency_format: "Nu {{amount}} BTN" 155 }, 156 BAM: { 157 money_format: "KM {{amount_with_comma_separator}}", 158 money_with_currency_format: "KM {{amount_with_comma_separator}} BAM" 159 }, 160 BRL: { 161 money_format: "R$ {{amount_with_comma_separator}}", 162 money_with_currency_format: "R$ {{amount_with_comma_separator}} BRL" 163 }, 164 BOB: { 165 money_format: "Bs{{amount_with_comma_separator}}", 166 money_with_currency_format: "Bs{{amount_with_comma_separator}} BOB" 167 }, 168 BWP: { 169 money_format: "P{{amount}}", 170 money_with_currency_format: "P{{amount}} BWP" 171 }, 172 BND: { 173 money_format: "${{amount}}", 174 money_with_currency_format: "${{amount}} BND" 175 }, 176 BGN: { 177 money_format: "{{amount}} лв", 178 money_with_currency_format: "{{amount}} лв BGN" 179 }, 180 MMK: { 181 money_format: "K{{amount}}", 182 money_with_currency_format: "K{{amount}} MMK" 183 }, 184 KHR: { 185 money_format: "KHR{{amount}}", 186 money_with_currency_format: "KHR{{amount}}" 187 }, 188 KYD: { 189 money_format: "${{amount}}", 190 money_with_currency_format: "${{amount}} KYD" 191 }, 192 XAF: { 193 money_format: "FCFA{{amount}}", 194 money_with_currency_format: "FCFA{{amount}} XAF" 195 }, 196 CLP: { 197 money_format: "${{amount_no_decimals}}", 198 money_with_currency_format: "${{amount_no_decimals}} CLP" 199 }, 200 CNY: { 201 money_format: "¥{{amount}}", 202 money_with_currency_format: "¥{{amount}} CNY" 203 }, 204 COP: { 205 money_format: "${{amount_with_comma_separator}}", 206 money_with_currency_format: "${{amount_with_comma_separator}} COP" 207 }, 208 CRC: { 209 money_format: "₡ {{amount_with_comma_separator}}", 210 money_with_currency_format: "₡ {{amount_with_comma_separator}} CRC" 211 }, 212 HRK: { 213 money_format: "{{amount_with_comma_separator}} kn", 214 money_with_currency_format: "{{amount_with_comma_separator}} kn HRK" 215 }, 216 CZK: { 217 money_format: "{{amount_with_comma_separator}} Kč", 218 money_with_currency_format: "{{amount_with_comma_separator}} Kč" 219 }, 220 DKK: { 221 money_format: "{{amount_with_comma_separator}}", 222 money_with_currency_format: "kr.{{amount_with_comma_separator}}" 223 }, 224 DOP: { 225 money_format: "RD$ {{amount}}", 226 money_with_currency_format: "RD$ {{amount}}" 227 }, 228 XCD: { 229 money_format: "${{amount}}", 230 money_with_currency_format: "EC${{amount}}" 231 }, 232 EGP: { 233 money_format: "LE {{amount}}", 234 money_with_currency_format: "LE {{amount}} EGP" 235 }, 236 ETB: { 237 money_format: "Br{{amount}}", 238 money_with_currency_format: "Br{{amount}} ETB" 239 }, 240 XPF: { 241 money_format: "{{amount_no_decimals_with_comma_separator}} XPF", 242 money_with_currency_format: "{{amount_no_decimals_with_comma_separator}} XPF" 243 }, 244 FJD: { 245 money_format: "${{amount}}", 246 money_with_currency_format: "FJ${{amount}}" 247 }, 248 GMD: { 249 money_format: "D {{amount}}", 250 money_with_currency_format: "D {{amount}} GMD" 251 }, 252 GHS: { 253 money_format: "GH₵{{amount}}", 254 money_with_currency_format: "GH₵{{amount}}" 255 }, 256 GTQ: { 257 money_format: "Q{{amount}}", 258 money_with_currency_format: "{{amount}} GTQ" 259 }, 260 GYD: { 261 money_format: "G${{amount}}", 262 money_with_currency_format: "${{amount}} GYD" 263 }, 264 GEL: { 265 money_format: "{{amount}} GEL", 266 money_with_currency_format: "{{amount}} GEL" 267 }, 268 HNL: { 269 money_format: "L {{amount}}", 270 money_with_currency_format: "L {{amount}} HNL" 271 }, 272 HKD: { 273 money_format: "${{amount}}", 274 money_with_currency_format: "HK${{amount}}" 275 }, 276 HUF: { 277 money_format: "{{amount_no_decimals_with_comma_separator}}", 278 money_with_currency_format: "{{amount_no_decimals_with_comma_separator}} Ft" 279 }, 280 ISK: { 281 money_format: "{{amount_no_decimals}} kr", 282 money_with_currency_format: "{{amount_no_decimals}} kr ISK" 283 }, 284 INR: { 285 money_format: "Rs. {{amount}}", 286 money_with_currency_format: "Rs. {{amount}}" 287 }, 288 IDR: { 289 money_format: "{{amount_with_comma_separator}}", 290 money_with_currency_format: "Rp {{amount_with_comma_separator}}" 291 }, 292 ILS: { 293 money_format: "{{amount}} NIS", 294 money_with_currency_format: "{{amount}} NIS" 295 }, 296 JMD: { 297 money_format: "${{amount}}", 298 money_with_currency_format: "${{amount}} JMD" 299 }, 300 JPY: { 301 money_format: "¥{{amount_no_decimals}}", 302 money_with_currency_format: "¥{{amount_no_decimals}}" 303 }, 304 JEP: { 305 money_format: "£{{amount}}", 306 money_with_currency_format: "£{{amount}} JEP" 307 }, 308 JOD: { 309 money_format: "{{amount}}0 JD", 310 money_with_currency_format: "{{amount}}0 JOD" 311 }, 312 KZT: { 313 money_format: "{{amount}} KZT", 314 money_with_currency_format: "{{amount}} KZT" 315 }, 316 KES: { 317 money_format: "KSh{{amount}}", 318 money_with_currency_format: "KSh{{amount}}" 319 }, 320 KWD: { 321 money_format: "{{amount}}0 KD", 322 money_with_currency_format: "{{amount}}0 KWD" 323 }, 324 KGS: { 325 money_format: "лв{{amount}}", 326 money_with_currency_format: "лв{{amount}}" 327 }, 328 LVL: { 329 money_format: "Ls {{amount}}", 330 money_with_currency_format: "Ls {{amount}} LVL" 331 }, 332 LBP: { 333 money_format: "L£{{amount}}", 334 money_with_currency_format: "L£{{amount}} LBP" 335 }, 336 LTL: { 337 money_format: "{{amount}} Lt", 338 money_with_currency_format: "{{amount}} Lt" 339 }, 340 MGA: { 341 money_format: "Ar {{amount}}", 342 money_with_currency_format: "Ar {{amount}} MGA" 343 }, 344 MKD: { 345 money_format: "ден {{amount}}", 346 money_with_currency_format: "ден {{amount}} MKD" 347 }, 348 MOP: { 349 money_format: "MOP${{amount}}", 350 money_with_currency_format: "MOP${{amount}}" 351 }, 352 MVR: { 353 money_format: "Rf{{amount}}", 354 money_with_currency_format: "Rf{{amount}} MRf" 355 }, 356 MXN: { 357 money_format: "$ {{amount}}", 358 money_with_currency_format: "$ {{amount}} MXN" 359 }, 360 MYR: { 361 money_format: "RM{{amount}} MYR", 362 money_with_currency_format: "RM{{amount}} MYR" 363 }, 364 MUR: { 365 money_format: "Rs {{amount}}", 366 money_with_currency_format: "Rs {{amount}} MUR" 367 }, 368 MDL: { 369 money_format: "{{amount}} MDL", 370 money_with_currency_format: "{{amount}} MDL" 371 }, 372 MAD: { 373 money_format: "{{amount}} dh", 374 money_with_currency_format: "Dh {{amount}} MAD" 375 }, 376 MNT: { 377 money_format: "{{amount_no_decimals}} ₮", 378 money_with_currency_format: "{{amount_no_decimals}} MNT" 379 }, 380 MZN: { 381 money_format: "{{amount}} Mt", 382 money_with_currency_format: "Mt {{amount}} MZN" 383 }, 384 NAD: { 385 money_format: "N${{amount}}", 386 money_with_currency_format: "N${{amount}} NAD" 387 }, 388 NPR: { 389 money_format: "Rs{{amount}}", 390 money_with_currency_format: "Rs{{amount}} NPR" 391 }, 392 ANG: { 393 money_format: "ƒ{{amount}}", 394 money_with_currency_format: "{{amount}} NAƒ" 395 }, 396 NZD: { 397 money_format: "${{amount}}", 398 money_with_currency_format: "${{amount}}" 399 }, 400 NIO: { 401 money_format: "C${{amount}}", 402 money_with_currency_format: "C${{amount}} NIO" 403 }, 404 NGN: { 405 money_format: "₦{{amount}}", 406 money_with_currency_format: "₦{{amount}} NGN" 407 }, 408 NOK: { 409 money_format: "kr {{amount_with_comma_separator}}", 410 money_with_currency_format: "kr {{amount_with_comma_separator}} NOK" 411 }, 412 OMR: { 413 money_format: "{{amount_with_comma_separator}} OMR", 414 money_with_currency_format: "{{amount_with_comma_separator}} OMR" 415 }, 416 PKR: { 417 money_format: "Rs.{{amount}}", 418 money_with_currency_format: "Rs.{{amount}} PKR" 419 }, 420 PGK: { 421 money_format: "K {{amount}}", 422 money_with_currency_format: "K {{amount}} PGK" 423 }, 424 PYG: { 425 money_format: "Gs. {{amount_no_decimals_with_comma_separator}}", 426 money_with_currency_format: "Gs. {{amount_no_decimals_with_comma_separator}} PYG" 427 }, 428 PEN: { 429 money_format: "S/. {{amount}}", 430 money_with_currency_format: "S/. {{amount}} PEN" 431 }, 432 PHP: { 433 money_format: "₱{{amount}}", 434 money_with_currency_format: "₱{{amount}} PHP" 435 }, 436 PLN: { 437 money_format: "{{amount_with_comma_separator}} zl", 438 money_with_currency_format: "{{amount_with_comma_separator}} zl PLN" 439 }, 440 QAR: { 441 money_format: "QAR {{amount_with_comma_separator}}", 442 money_with_currency_format: "QAR {{amount_with_comma_separator}}" 443 }, 444 RON: { 445 money_format: "{{amount_with_comma_separator}} lei", 446 money_with_currency_format: "{{amount_with_comma_separator}} lei RON" 447 }, 448 RUB: { 449 money_format: "руб{{amount_with_comma_separator}}", 450 money_with_currency_format: "руб{{amount_with_comma_separator}}" 451 }, 452 RWF: { 453 money_format: "{{amount_no_decimals}} RF", 454 money_with_currency_format: "{{amount_no_decimals}} RWF" 455 }, 456 WST: { 457 money_format: "WS$ {{amount}}", 458 money_with_currency_format: "WS$ {{amount}} WST" 459 }, 460 SAR: { 461 money_format: "{{amount}} SR", 462 money_with_currency_format: "{{amount}} SAR" 463 }, 464 STD: { 465 money_format: "Db {{amount}}", 466 money_with_currency_format: "Db {{amount}} STD" 467 }, 468 RSD: { 469 money_format: "{{amount}} RSD", 470 money_with_currency_format: "{{amount}} RSD" 471 }, 472 SCR: { 473 money_format: "Rs {{amount}}", 474 money_with_currency_format: "Rs {{amount}} SCR" 475 }, 476 SGD: { 477 money_format: "${{amount}}", 478 money_with_currency_format: "S${{amount}}" 479 }, 480 SYP: { 481 money_format: "S£{{amount}}", 482 money_with_currency_format: "S£{{amount}} SYP" 483 }, 484 ZAR: { 485 money_format: "R {{amount}}", 486 money_with_currency_format: "R {{amount}} ZAR" 487 }, 488 KRW: { 489 money_format: "₩{{amount_no_decimals}}", 490 money_with_currency_format: "₩{{amount_no_decimals}}" 491 }, 492 LKR: { 493 money_format: "Rs {{amount}}", 494 money_with_currency_format: "Rs {{amount}} LKR" 495 }, 496 SEK: { 497 money_format: "{{amount_no_decimals}} kr", 498 money_with_currency_format: "{{amount_no_decimals}} kr SEK" 499 }, 500 CHF: { 501 money_format: "CHF {{amount}}", 502 money_with_currency_format: "SFr. {{amount}}" 503 }, 504 TWD: { 505 money_format: "${{amount}}", 506 money_with_currency_format: "${{amount}} TWD" 507 }, 508 THB: { 509 money_format: "{{amount}} ฿", 510 money_with_currency_format: "{{amount}} ฿ THB" 511 }, 512 TZS: { 513 money_format: "{{amount}} TZS", 514 money_with_currency_format: "{{amount}} TZS" 515 }, 516 TTD: { 517 money_format: "${{amount}}", 518 money_with_currency_format: "${{amount}} TTD" 519 },
520 TND: { 521 money_format: "{{amount}}", 522 money_with_currency_format: "{{amount}} DT" 523 }, 524 TRY: { 525 money_format: "{{amount}}TL", 526 money_with_currency_format: "{{amount}}TL" 527 }, 528 UGX: { 529 money_format: "Ush {{amount_no_decimals}}", 530 money_with_currency_format: "Ush {{amount_no_decimals}} UGX" 531 }, 532 UAH: { 533 money_format: "â´{{amount}}", 534 money_with_currency_format: "â´{{amount}} UAH" 535 }, 536 AED: { 537 money_format: "Dhs. {{amount}}", 538 money_with_currency_format: "Dhs. {{amount}} AED" 539 }, 540 UYU: { 541 money_format: "${{amount_with_comma_separator}}", 542 money_with_currency_format: "${{amount_with_comma_separator}} UYU" 543 }, 544 VUV: { 545 money_format: "${{amount}}", 546 money_with_currency_format: "${{amount}}VT" 547 }, 548 VEF: { 549 money_format: "Bs. {{amount_with_comma_separator}}", 550 money_with_currency_format: "Bs. {{amount_with_comma_separator}} VEF" 551 }, 552 VND: { 553 money_format: "{{amount_no_decimals_with_comma_separator}}₫", 554 money_with_currency_format: "{{amount_no_decimals_with_comma_separator}} VND" 555 }, 556 XBT: { 557 money_format: "{{amount_no_decimals}} BTC", 558 money_with_currency_format: "{{amount_no_decimals}} BTC" 559 }, 560 XOF: { 561 money_format: "CFA{{amount}}", 562 money_with_currency_format: "CFA{{amount}} XOF" 563 }, 564 ZMW: { 565 money_format: "K{{amount_no_decimals_with_comma_separator}}", 566 money_with_currency_format: "ZMW{{amount_no_decimals_with_comma_separator}}" 567 }, 568 YER: { 569 money_format: " YRls {{amount_no_decimals_with_comma_separator}}", 570 money_with_currency_format: " YRls {{amount_no_decimals_with_comma_separator}} YER" 571 }, 572 BIF: { 573 money_format: "FBu. {{amount_no_decimals}}", 574 money_with_currency_format: " FBu. {{amount_no_decimals}} BIF" 575 }, 576 CVE:{ 577 money_format: "$ {{amount_no_decimals}}", 578 money_with_currency_format: "$ {{amount_no_decimals}} CVE" 579 }, 580 KMF:{ 581 money_format: "{{amount_no_decimals}} FC", 582 money_with_currency_format: "{{amount_no_decimals}} FC" 583 }, 584 CDF:{ 585 money_format: "{{amount}} FC", 586 money_with_currency_format: "FC{{amount}} CDF" 587 }, 588 DJF:{ 589 money_format: "{{amount_no_decimals}} Fdj", 590 money_with_currency_format: "Fdj {{amount_no_decimals}} DJF" 591 }, 592 GNF:{ 593 money_format: "{{amount_no_decimals}} FG", 594 money_with_currency_format: "FG{{amount_no_decimals}} GNF" 595 }, 596 MWK:{ 597 money_format: "K {{amount}}", 598 money_with_currency_format: "K {{amount}} MWK" 599 }, 600 SLL:{ 601 money_format: "Le {{amount}}", 602 money_with_currency_format: "Le {{amount}} SLL" 603 }, 604 UZS:{ 605 money_format: "{{amount}} soum", 606 money_with_currency_format: "{{amount}} soum UZS" 607 } 608}; 609 610 611 612 613Currency.formatMoneyInteger = function (b, g) { 614 615 // if (typeof Shopify.formatMoney === "function") { 616 // return Shopify.formatMoney(b, g) 617 // } 618 619 if (typeof b == "string") { 620 b = b.replace(".", "") 621 } 622 var f = ""; 623 var e = /\{\{\s*(\w+)\s*\}\}/; 624 var a = g || "${{amount}}"; 625 626 function c(h, i) { 627 return (typeof h == "undefined" ? i : h) 628 } 629 630 function d(m, k, l, j) { 631 k = c(k, 2); 632 l = c(l, ","); 633 j = c(j, "."); 634 if (isNaN(m) || m == null) { 635 return 0 636 } 637 638 //Math.floor? 639 m = (m / 100).toFixed(k); 640 //m = (Math.ceil((m / 100)/0.5)*0.5).toFixed(k); 641 var n = m.split("."), 642 i = n[0].replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1" + l), 643 h = n[1] ? (j + n[1]) : ""; 644 return i + h 645 } 646 647 f = d(b, 0); 648 649 return a.replace(e, f) 650}; 651 652 653 654Currency.formatMoneyUpdateCart = function (b, g) { 655 656 if (typeof Shopify.formatMoney === "function") { 657 return Shopify.formatMoney(b, g) 658 } 659 660 if (typeof b == "string") { 661 b = b.replace(".", "") 662 } 663 var f = ""; 664 var e = /\{\{\s*(\w+)\s*\}\}/; 665 var a = g || "${{amount}}"; 666 667 function c(h, i) { 668 return (typeof h == "undefined" ? i : h) 669 } 670 671 function d(m, k, l, j) { 672 k = c(k, 2); 673 l = c(l, ","); 674 j = c(j, "."); 675 if (isNaN(m) || m == null) { 676 return 0 677 } 678 679 m = (m / 100).toFixed(k); 680 //m = (Math.ceil((m / 100)/0.5)*0.5).toFixed(k); 681 var n = m.split("."), 682 i = n[0].replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1" + l), 683 h = n[1] ? (j + n[1]) : ""; 684 return i + h 685 } 686 687 switch (a.match(e)[1]) { 688 case "amount": 689 f = d(b, 2); 690 break; 691 case "amount_no_decimals": 692 f = d(b, 0); 693 break; 694 case "amount_with_comma_separator": 695 f = d(b, 2, ".", ","); 696 break; 697 case "amount_no_decimals_with_comma_separator": 698 f = d(b, 0, ".", ","); 699 break 700 } 701 return a.replace(e, f) 702}; 703 704 705 706Currency.formatMoney = function (b, g) { 707 708// if (typeof Shopify.formatMoney === "function") { 709// console.log("Shopify.formatMoney",Shopify.formatMoney); 710// return Shopify.formatMoney(b, g) 711// } 712 713 if (typeof b == "string") { 714 b = b.replace(".", "") 715 } 716 var f = ""; 717 var e = /\{\{\s*(\w+)\s*\}\}/; 718 var a = g || "${{amount}}"; 719 720 function c(h, i) { 721 return (typeof h == "undefined" ? i : h) 722 } 723 724 function d(m, k, l, j) { 725 k = c(k, 2); 726 l = c(l, ","); 727 j = c(j, "."); 728 if (isNaN(m) || m == null) { 729 return 0 730 } 731 732 //m = (m / 100).toFixed(k); 733 m = (Math.ceil((m / 100)/0.05)*0.05).toFixed(k); 734 var n = m.split("."), 735 i = n[0].replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1" + l), 736 h = n[1] ? (j + n[1]) : ""; 737 return i + h 738 } 739 740 switch (a.match(e)[1]) { 741 case "amount": 742 f = d(b, 2); 743 break; 744 case "amount_no_decimals": 745 f = d(b, 0); 746 break; 747 case "amount_with_comma_separator": 748 f = d(b, 2, ".", ","); 749 break; 750 case "amount_no_decimals_with_comma_separator": 751 f = d(b, 0, ".", ","); 752 break 753 } 754 return a.replace(e, f) 755}; 756Currency.currentCurrency = ""; 757Currency.format = "money_with_currency_format"; 758Currency.convertAll = function (c, b, a, d) { 759 jQuery(a || "span.money:not(#customs_taxes)").each(function () { 760 if (jQuery(this).attr("data-currency") === b) { 761 return 762 } 763 if (jQuery(this).attr("data-currency-" + b)) { 764 jQuery(this).html(jQuery(this).attr("data-currency-" + b)) 765 } else { 766 var e = 0; 767 var f = Currency.moneyFormats[c][d || Currency.format] || "{{amount}}"; 768 var g = Currency.moneyFormats[b][d || Currency.format] || "{{amount}}"; 769 if (f.indexOf("amount_no_decimals") !== -1) {
770 e = Currency.convert(parseInt(jQuery(this).html().replace(/[^0-9]/g, ""), 10) * 100, c, b) 771 //e = (parseInt(jQuery(this).html().replace(/[^0-9]/g, ""), 10) * 100) * Shopify.currency["rate"] 772 } else { 773 if (c === "JOD" || c == "KWD" || c == "BHD") { 774 e = Currency.convert(parseInt(jQuery(this).html().replace(/[^0-9]/g, ""), 10) / 10, c, b) 775 } else { 776 e = Currency.convert(parseInt(jQuery(this).html().replace(/[^0-9]/g, ""), 10), c, b) 777 } 778 } 779 780// var h = Currency.formatMoney(e*1.05, g); 781 if(jQuery(this).hasClass("no_decimals")){ 782 var curr = document.querySelector("html").getAttribute("data-currency-primary"); 783 var banner = Currency.convert(parseInt(jQuery(this).html().replace(/[^0-9]/g, ""), 10) * 100, c, b) 784 var format = Currency.moneyFormats[b][d || Currency.format] || "{{amount}}"; 785 var h; 786 if(b == "JPY"){ 787 h = Currency.formatMoneyInteger(banner, format); 788 }else{ 789 //h = Currency.formatMoneyInteger(banner*1.15, format); 790 h = Currency.formatMoneyInteger(banner, format); 791 } 792 }else{ 793 if(b == "JPY"){ 794 var h = Currency.formatMoney(e, g); 795 }else{ 796 //var h = Currency.formatMoney(e*1.15, g); 797 var h = Currency.formatMoney(e, g); 798 } 799 } 800 801 802 jQuery(this).html(h); 803 jQuery(this).attr("data-currency-" + b, h) 804 } 805 jQuery(this).attr("data-currency", b) 806 }); 807 this.currentCurrency = b; 808 this.cookie.write(b) 809};
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.