1/* 2 * 2007-2015 PrestaShop 3 * 4 * NOTICE OF LICENSE 5 * 6 * This source file is subject to the Academic Free License (AFL 3.0) 7 * that is bundled with this package in the file LICENSE.txt. 8 * It is also available through the world-wide-web at this URL: 9 * http://opensource.org/licenses/afl-3.0.php 10 * If you did not receive a copy of the license and are unable to 11 * obtain it through the world-wide-web, please send an email 12 * to [email protected] so we can send you a copy immediately. 13 * 14 * DISCLAIMER 15 * 16 * Do not edit or add to this file if you wish to upgrade PrestaShop to newer 17 * versions in the future. If you wish to customize PrestaShop for your 18 * needs please refer to http://www.prestashop.com for more information. 19 * 20 * @author PrestaShop SA <[email protected]> 21 * @copyright 2007-2015 PrestaShop SA 22 * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) 23 * International Registered Trademark & Property of PrestaShop SA 24 */ 25//global variables 26var responsiveflag = false; 27 28$(document).ready(function () { 29 highdpiInit(); 30 responsiveResize(); 31 $(window).resize(responsiveResize); 32 if (navigator.userAgent.match(/Android/i)) { 33 var viewport = document.querySelector('meta[name="viewport"]'); 34 viewport.setAttribute( 35 "content", 36 "initial-scale=1.0,maximum-scale=1.0,user-scalable=0,width=device-width,height=device-height" 37 ); 38 window.scrollTo(0, 1); 39 } 40 if (typeof quickView !== "undefined" && quickView) quick_view(); 41 dropDown(); 42 43 if ( 44 typeof page_name != "undefined" && 45 !in_array(page_name, ["index", "product"]) 46 ) { 47 bindGrid(); 48 49 $(document).on("change", ".selectProductSort", function (e) { 50 if (typeof request != "undefined" && request) 51 var requestSortProducts = request; 52 var splitData = $(this).val().split(":"); 53 var url = ""; 54 if (typeof requestSortProducts != "undefined" && requestSortProducts) { 55 url += requestSortProducts; 56 if (typeof splitData[0] !== "undefined" && splitData[0]) { 57 url += 58 (requestSortProducts.indexOf("?") < 0 ? "?" : "&") + 59 "orderby=" + 60 splitData[0] + 61 (splitData[1] ? "&orderway=" + splitData[1] : ""); 62 if (typeof splitData[1] !== "undefined" && splitData[1]) 63 url += "&orderway=" + splitData[1]; 64 } 65 document.location.href = url; 66 } 67 }); 68 69 $(document).on("change", 'select[name="n"]', function () { 70 $(this.form).submit(); 71 }); 72 73 $(document).on("change", 'select[name="currency_payment"]', function () { 74 setCurrency($(this).val()); 75 }); 76 } 77 78 $(document).on( 79 "change", 80 'select[name="manufacturer_list"], select[name="supplier_list"]', 81 function () { 82 if (this.value != "") location.href = this.value; 83 } 84 ); 85 86 $(document).on("click", ".back", function (e) { 87 e.preventDefault(); 88 history.back(); 89 }); 90 91 jQuery.curCSS = jQuery.css; 92 if (!!$.prototype.cluetip) 93 $("a.cluetip") 94 .cluetip({ 95 local: true, 96 cursor: "pointer", 97 dropShadow: false, 98 dropShadowSteps: 0, 99 showTitle: false, 100 tracking: true, 101 sticky: false, 102 mouseOutClose: true, 103 fx: { 104 open: "fadeIn", 105 openSpeed: "fast", 106 }, 107 }) 108 .css("opacity", 0.8); 109 110 if ( 111 typeof FancyboxI18nClose !== "undefined" && 112 typeof FancyboxI18nNext !== "undefined" && 113 typeof FancyboxI18nPrev !== "undefined" && 114 !!$.prototype.fancybox 115 ) 116 $.extend($.fancybox.defaults.tpl, { 117 closeBtn: 118 '<a title="' + 119 FancyboxI18nClose + 120 '" class="fancybox-item fancybox-close" href="javascript:;"></a>', 121 next: 122 '<a title="' + 123 FancyboxI18nNext + 124 '" class="fancybox-nav fancybox-next" href="javascript:;"><span></span></a>', 125 prev: 126 '<a title="' + 127 FancyboxI18nPrev + 128 '" class="fancybox-nav fancybox-prev" href="javascript:;"><span></span></a>', 129 }); 130 131 // Close Alert messages 132 $(".alert.alert-danger").on("click", this, function (e) { 133 if ( 134 e.offsetX >= 16 && 135 e.offsetX <= 39 && 136 e.offsetY >= 16 && 137 e.offsetY <= 34 138 ) 139 $(this).fadeOut(); 140 }); 141 142 // MOD: Cima Digital 143 $("#btn-buscador-scroll").click(function () { 144 $("#search_block_top").addClass("buscador-fijo-activo"); 145 }); 146 147 $(window).scroll(function (event) { 148 var scroll = $(window).scrollTop(); 149 // Do something 150 //console.log(scroll); 151 if (scroll > 145) { 152 $("#search_block_top").addClass("buscador-fijo"); 153 } else { 154 $("#search_block_top").removeClass("buscador-fijo"); 155 $("#search_block_top").removeClass("buscador-fijo-activo"); 156 } 157 }); 158}); 159 160function highdpiInit() { 161 if (typeof highDPI === "undefined") return; 162 if (highDPI && $(".replace-2x").css("font-size") == "1px") { 163 var els = $("img.replace-2x").get(); 164 for (var i = 0; i < els.length; i++) { 165 src = els[i].src; 166 extension = src.substr(src.lastIndexOf(".") + 1); 167 src = src.replace("." + extension, "2x." + extension); 168 169 var img = new Image(); 170 img.src = src; 171 img.height != 0 ? (els[i].src = src) : (els[i].src = els[i].src); 172 } 173 } 174} 175 176// Used to compensante Chrome/Safari bug (they don't care about scroll bar for width)
177function scrollCompensate() { 178 var inner = document.createElement("p"); 179 inner.style.width = "100%"; 180 inner.style.height = "200px"; 181 182 var outer = document.createElement("div"); 183 outer.style.position = "absolute"; 184 outer.style.top = "0px"; 185 outer.style.left = "0px"; 186 outer.style.visibility = "hidden"; 187 outer.style.width = "200px"; 188 outer.style.height = "150px"; 189 outer.style.overflow = "hidden"; 190 outer.appendChild(inner); 191 192 document.body.appendChild(outer); 193 var w1 = inner.offsetWidth; 194 outer.style.overflow = "scroll"; 195 var w2 = inner.offsetWidth; 196 if (w1 == w2) w2 = outer.clientWidth; 197 198 document.body.removeChild(outer); 199 200 return w1 - w2; 201} 202 203function responsiveResize() { 204 compensante = scrollCompensate(); 205 if ( 206 $(window).width() + scrollCompensate() <= 767 && 207 responsiveflag == false 208 ) { 209 accordionLinks("enable"); 210 accordion("enable"); 211 accordionFooter("enable"); 212 responsiveflag = true; 213 } else if ($(window).width() + scrollCompensate() >= 768) { 214 accordionLinks("disable"); 215 accordion("disable"); 216 accordionFooter("disable"); 217 responsiveflag = false; 218 if (typeof bindUniform !== "undefined") bindUniform(); 219 } 220 blockHover(); 221} 222 223function blockHover(status) { } 224 225function quick_view() { 226 $(document).on( 227 "click", 228 ".quick-view:visible, .quick-view-mobile:visible", 229 function (e) { 230 e.preventDefault(); 231 var url = this.rel; 232 var anchor = ""; 233 234 if (url.indexOf("#") != -1) { 235 anchor = url.substring(url.indexOf("#"), url.length); 236 url = url.substring(0, url.indexOf("#")); 237 } 238 239 if (url.indexOf("?") != -1) url += "&"; 240 else url += "?"; 241 242 if (!!$.prototype.fancybox) 243 $.fancybox({ 244 padding: 0, 245 width: 1087, 246 height: 610, 247 type: "iframe", 248 href: url + "content_only=1" + anchor, 249 }); 250 } 251 ); 252} 253 254function bindGrid() { 255 var storage = false; 256 if (typeof getStorageAvailable !== "undefined") { 257 storage = getStorageAvailable(); 258 } 259 if (!storage) { 260 return; 261 } 262 263 var view = $.totalStorage("display"); 264 265 if (!view && typeof displayList != "undefined" && displayList) view = "list"; 266 267 if (view && view != "grid") display(view); 268 else $(".display").find("li#grid").addClass("selected"); 269 270 $(document).on("click", "#grid", function (e) { 271 e.preventDefault(); 272 display("grid"); 273 }); 274 275 $(document).on("click", "#list", function (e) { 276 e.preventDefault(); 277 display("list"); 278 }); 279} 280 281function display(view) { 282 if (view == "list") { 283 $("ul.product_list").removeClass("grid").addClass("list row"); 284 $(".product_list > li") 285 .removeClass("col-xs-12 col-sm-6 col-md-4") 286 .addClass("col-xs-12"); 287 $(".product_list > li").each(function (index, element) { 288 var html = ""; 289 html = 290 '<div class="product-container"><div class="item-inner"><div class="row">'; 291 html += 292 '<div class="left-block col-xs-4 col-sm-5 col-md-4"><div class="left-block-inner">' + 293 $(element).find(".left-block").html() + 294 "</div></div>"; 295 html += '<div class="right-block col-xs-8 col-sm-7 col-md-8">'; 296 html += '<h5 itemprop="name">' + $(element).find("h5").html() + "</h5>"; 297 var price = $(element).find(".content_price").html(); // check : catalog mode is enabled 298 if (price != null) { 299 html += '<div class="content_price">' + price + "</div>"; 300 } 301 html += 302 '<p class="product-desc">' + 303 $(element).find(".product-desc").html() + 304 "</p>"; 305 html += 306 '<p class="learn-more">' + 307 $(element).find(".learn-more").html() + 308 "</p>"; 309 var colorList = $(element).find(".color-list-container").html(); 310 if (colorList != null) { 311 html += '<div class="color-list-container">' + colorList + "</div>"; 312 } 313 var availability = $(element).find(".availability").html(); // check : catalog mode is enabled 314 if (availability != null) { 315 html += '<span class="availability">' + availability + "</span>"; 316 } 317 html += 318 '<div itemprop="offers" itemscope itemtype="https://schema.org/Offer" class="button-container">' + 319 $(element).find(".button-container").html() + 320 "</div>"; 321 html += "</div>"; 322 html += "</div></div></div>"; 323 $(element).html(html); 324 }); 325 $(".display").find("li#list").addClass("selected"); 326 $(".display").find("li#grid").removeAttr("class"); 327 $.totalStorage("display", "list"); 328 } else { 329 $("ul.product_list").removeClass("list").addClass("grid row"); 330 $(".product_list > li") 331 .removeClass("col-xs-12") 332 .addClass("col-xs-12 col-sm-6 col-md-4"); 333 $(".product_list > li").each(function (index, element) { 334 var html = ""; 335 html += '<div class="product-container">'; 336 html += '<div class="item-inner">'; 337 338 var leftinner = $(element).find(".left-block-inner").html(); 339 if (leftinner != null) { 340 html += 341 '<div class="left-block">' + 342 $(element).find(".left-block-inner").html() + 343 "</div>"; 344 } else { 345 html += 346 '<div class="left-block">' + 347 $(element).find(".left-block").html() + 348 "</div>"; 349 } 350 html += '<div class="right-block">'; 351 html += '<h5 itemprop="name">' + $(element).find("h5").html() + "</h5>"; 352 html += '<div class="price-rating">'; 353 var price = $(element).find(".content_price").html(); // check : catalog mode is enabled 354 if (price != null) { 355 html += '<div class="content_price">' + price + "</div>"; 356 } 357 358 html += 359 '<p itemprop="description" class="product-desc">' + 360 $(element).find(".product-desc").html() + 361 "</p>"; 362 html += 363 '<p class="learn-more">' + 364 $(element).find(".learn-more").html() + 365 "</p>"; 366 html += "</div>"; 367 var colorList = $(element).find(".color-list-container").html(); 368 if (colorList != null) { 369 html += '<div class="color-list-container">' + colorList + "</div>"; 370 } 371 var availability = $(element).find(".availability").html(); // check : catalog mode is enabled 372 if (availability != null) { 373 html += '<span class="availability">' + availability + "</span>"; 374 } 375 html += 376 '<div itemprop="offers" itemscope itemtype="https://schema.org/Offer" class="button-container-right">' + 377 $(element).find(".button-container").html() + 378 "</div>"; 379 html += "</div>"; 380 html += "</div></div>"; 381 $(element).html(html); 382 }); 383 $(".display").find("li#grid").addClass("selected"); 384 $(".display").find("li#list").removeAttr("class"); 385 $.totalStorage("display", "grid"); 386 } 387} 388 389function dropDown() { 390 elementClick = "#header .current"; 391 elementSlide = "ul.toogle_content"; 392 activeClass = "active"; 393 394 $(elementClick).on("click", function (e) { 395 e.stopPropagation(); 396 var subUl = $(this).next(elementSlide); 397 if (subUl.is(":hidden")) { 398 subUl.slideDown(); 399 $(this).addClass(activeClass); 400 } else { 401 subUl.slideUp(); 402 $(this).removeClass(activeClass); 403 } 404 $(elementClick).not(this).next(elementSlide).slideUp(); 405 $(elementClick).not(this).removeClass(activeClass); 406 e.preventDefault(); 407 }); 408 409 $(elementSlide).on("click", function (e) { 410 e.stopPropagation(); 411 }); 412 413 $(document).on("click", function (e) { 414 e.stopPropagation(); 415 var elementHide = $(elementClick).next(elementSlide); 416 $(elementHide).slideUp(); 417 $(elementClick).removeClass("active"); 418 }); 419} 420 421function accordionFooter(status) { 422 if (status == "enable") { 423 $("#footer .footer-block h4").on("click", function (e) { 424 $(this) 425 .toggleClass("active") 426 .parent() 427 .find(".toggle-footer") 428 .stop() 429 .slideToggle("medium"); 430 e.preventDefault(); 431 }); 432 $("#footer").addClass("accordion").find(".toggle-footer").slideUp("fast"); 433 } else { 434 $(".footer-block h4") 435 .removeClass("active") 436 .off() 437 .parent() 438 .find(".toggle-footer") 439 .removeAttr("style") 440 .slideDown("fast"); 441 $("#footer").removeClass("accordion"); 442 } 443} 444 445function accordion(status) { 446 if (status == "enable") { 447 var accordion_selector = 448 "#right_column .block .title_block, #left_column .block .title_block, #left_column #newsletter_block_left h4," + 449 "#left_column .shopping_cart > a:first-child, #right_column .shopping_cart > a:first-child"; 450 451 $(accordion_selector).on("click", function (e) { 452 $(this) 453 .toggleClass("active") 454 .parent() 455 .find(".block_content") 456 .stop() 457 .slideToggle("medium"); 458 }); 459 $("#right_column, #left_column") 460 .addClass("accordion") 461 .find(".block .block_content") 462 .slideUp("fast"); 463 if (typeof ajaxCart !== "undefined") ajaxCart.collapse(); 464 } else { 465 $( 466 "#right_column .block .title_block, #left_column .block .title_block, #left_column #newsletter_block_left h4" 467 ) 468 .removeClass("active") 469 .off() 470 .parent() 471 .find(".block_content") 472 .removeAttr("style") 473 .slideDown("fast"); 474 $("#left_column, #right_column").removeClass("accordion"); 475 } 476} 477 478function accordionLinks(status) { 479 if (status == "enable") { 480 $("#header_links").addClass("toogle_content"); 481 $("#header_links").css({ display: "none" }); 482 } else { 483 $("#header_links").removeClass("toogle_content"); 484 $("#header_links").css({ display: "block" }); 485 } 486} 487function bindUniform() { 488 if (!!$.prototype.uniform) 489 $("select.form-control,input[type='radio'],input[type='checkbox']") 490 .not(".not_uniform") 491 .uniform(); 492} 493 494/* MOD: */ 495$(function () { 496 // $("#add_address").submit(function () { 497 // var dni = $("#dni").val(); 498 // var pattern = 499 // /^(([X-Z]{1})([-]?)(\d{7})([-]?)([A-Z]{1}))|((\d{8})([-]?)([A-Z]{1}))|((\d{8})([-]?)(\d{1}))/; 500 // 501 // var resultado = pattern.test(dni); 502 //
503 // if (!resultado) 504 // alert( 505 // "El número de identificación fiscal es incorrecto o ya ha sido utilizado" 506 // ); 507 // 508 // return resultado; 509 // }); 510}); 511 512document.addEventListener("DOMContentLoaded", () => { 513 if (window.location !== window.parent.location) { 514 let intval = setInterval(() => { 515 console.log(document.querySelector("div.cookiesplus-modal")); 516 if (document.querySelector("div.cookiesplus-modal")) { 517 document.querySelector("div.cookiesplus-modal").remove(); 518 clearInterval(intval); 519 } 520 }, 100); 521 } 522}); 523 524// document.addEventListener('DOMContentLoaded', () => { 525// if(document.querySelector('body#index div#insideslider_mod')) { 526// const wwidth = screen.width; 527// const node = document.querySelector('body#index div#insideslider_mod'); 528// const nodeWidth = node.style.width; 529// 530// node.style.width = wwidth; 531// node.style.marginLeft = 0; 532// node.style.left = 0; 533// node.querySelectorAll('*').forEach(i => { 534// if(i.style.width === nodeWidth) { 535// i.style.width = wwidth + 'px'; 536// i.style.marginLeft = 0; 537// i.style.left = 0; 538// } 539// }); 540// } 541// }); 542 543document.addEventListener("DOMContentLoaded", () => { 544 if (document.querySelector("#cd-age32141-1")) { 545 document 546 .querySelector("#cd-age32141-1 > img") 547 .addEventListener("click", () => { 548 const node = document.querySelector("div.cd-ref4e1-1441-4"); 549 jQuery(node).slideToggle(); 550 }); 551 } 552}); 553 554// Slider 555/* 556document.addEventListener("DOMContentLoaded", () => { 557 if (document.querySelector("html").clientWidth < 1615) { 558 if (document.querySelector("div#insideslider_mod")) { 559 const parent = document.querySelector("div#insideslider_mod"); 560 const nodes = parent.querySelectorAll("*"); 561 const width = document.querySelector("html").clientWidth + "px"; 562 563 nodes.forEach((i) => { 564 if (i.style.height !== "" && i.style.width !== "") { 565 i.style.width = width; 566 i.style.height = "680px"; 567 } 568 }); 569 570 parent.style.width = width; 571 parent.style.height = '680px'; 572 } 573 } 574}); 575*/ 576 577/** 578 * MOD: Adrián 579 */ 580/* 581document.addEventListener('DOMContentLoaded', () => { 582 if(document.getElementById('header_links')) { 583 if(document.documentElement.clientWidth > 767) { 584 const node = document.createElement('div'); 585 node.setAttribute('id', 'cd-info-header'); 586 node.innerHTML = '<p><strong>¿TE AYUDAMOS?</strong></p><p>Teléfono: 941587676</p><p>WhatsApp: 628702240</p><p>Email: <a href="mailto:[email protected]">[email protected]</a></p><p>Horario de atención al cliente 10.00 â 18.00</p>'; 587 document.getElementById('header_links').appendChild(node); 588 589 document.querySelector('ul#header_links a').addEventListener('click', evt => { 590 evt.preventDefault(); 591 const node = document.getElementById('cd-info-header'); 592 $(node).slideToggle(); 593 }); 594 } 595 } 596 597 if(document.querySelector('.cd-header-idiomas')) { 598 document.querySelector('.cd-header-idiomas').addEventListener('click', evt => { 599 const target = evt.target; 600 const node = target.querySelector('.cd-langauge-container'); 601 $(node).slideToggle(); 602 }); 603 } 604 605 if(document.querySelector('.cd-header-searcher')) { 606 document.querySelector('.cd-header-searcher img').addEventListener('click', evt => { 607 const target = evt.target; 608 const node = document.querySelector('.cd-header-searcher > div'); 609 $(node).slideToggle(); 610 }); 611 612 document.querySelector('.js-cd-header-input-search').addEventListener('keyup', evt => { 613 const val = evt.target.value; 614 if(evt.key === 'Enter') { 615 document.getElementById('searchbox').submit(); 616 } else { 617 document.getElementById('search_query_top').value = val; 618 } 619 }); 620 621 document.querySelector('.js-cd-header-submit-search').addEventListener('click', evt => { 622 document.getElementById('searchbox').submit(); 623 }); 624 625 } 626}); 627*/ 628 629'use strict'; 630// Main object 631const cdThemeFunctions = { 632 // Teléfono 633 initPhone: () => { 634 const tlfNode = document.querySelector('.cd-top-header-inner ul#header_links a'); 635 tlfNode.addEventListener('click', evt => { 636 evt.preventDefault(); 637 const node = document.querySelector('.cd-top-header-inner #cd-info-header'); 638 $(node).slideToggle(); 639 }); 640 }, 641 initLanguages: () => { 642 const lanSelectorNode = document.querySelector('.cd-languages-top'); 643 lanSelectorNode.addEventListener('click', evt => { 644 const selector = document.querySelector('.cd-language-selector'); 645 $(selector).slideToggle(); 646 }); 647 }, 648 initBuscador: () => { 649 const searchNode = document.querySelector('.cd-top-header-inner .cd-header-searcher > img'); 650 651 searchNode.addEventListener('click', evt => { 652 const node = document.getElementById('search_block_top'); 653 $(node).slideToggle('fast', () => { 654 node.querySelector('input[type="text"]').focus(); 655 }); 656 }); 657 658 /* 659 document.querySelector('.cd-top-header-inner .js-cd-header-input-search').addEventListener('keyup', evt => { 660 const val = evt.target.value; 661 if(evt.key === 'Enter') { 662 document.getElementById('searchbox').submit(); 663 } else { 664 document.getElementById('search_query_top').value = val; 665 } 666 }); 667 668 document.querySelector('.cd-top-header-inner .js-cd-header-submit-search').addEventListener('click', evt => { 669 document.getElementById('searchbox').submit(); 670 }); 671 */ 672 } 673}; 674 675document.addEventListener('DOMContentLoaded', () => { 676 // Condiciones para los init 677 if (document.documentElement.clientWidth > 767 && document.getElementById('mobile_links')) { 678 cdThemeFunctions.initPhone(); 679 } 680 681 if (document.querySelector('.cd-languages-top')) { 682 cdThemeFunctions.initLanguages(); 683 } 684 685 if (document.querySelector('.cd-header-searcher') && document.querySelector('form#searchbox')) { 686 cdThemeFunctions.initBuscador(); 687 } 688 689 690 jQuery(function () { 691 // 692 if ($("#order").length) { 693 if ($("input[data-key='296,']").length) { 694 var target = $("input[data-key='296,']").parent().parent().parent().parent(); 695 console.log("target", target); 696 var optionprice = $(target).find(".delivery_option_price"); 697 if ($(optionprice).length) { 698 $(optionprice).html("Pendiente de confirmación"); 699 } 700 } 701 if ($(".payment_module .cash").length) { 702 if ($(".payment_module .cash").html().indexOf("Tenerife") !== -1) { 703 $("#cart_summary tbody tr .cart_avail").each(function () { 704 $(this).html("Pendiente de confirmación"); 705 }); 706 $("#total_shipping").html("Pendiente de confirmación"); 707 } 708 } 709 } 710 }); 711}); 712//MOD cimadigital - David Roura: Cambiar el tiempo de entrega segun cantidades disponibles 713jQuery(function () { 714 // 715 var startWith = "";
716 console.log("startWith", startWith); 717 if ($("#availability_value").length && $("#quantityAvailable").length) { 718 console.log("aware of quantity in detail product"); 719 var available = '<span id="availability_value" class="label label-success">Entrega en 24 - 48 horas</span>'; 720 var unavailable = '<span id="availability_value" class="label label-warning"> Entrega en 20 - 30 dÃas aprox.</span>'; 721 var mytimer; 722 $(document).on("change", ".attribute_select", function () { 723 startWith = ""; 724 console.log("reset startWith change"); 725 }); 726 $(document).on("input", ".attribute_select", function () { 727 startWith = ""; 728 console.log("reset startWith input"); 729 }); 730 $(document).on("click", ".product_quantity_up, .product_quantity_down", function () { 731 if (startWith == "") { 732 startWith = $("#availability_value").text(); 733 } 734 var isAvailable = startWith.search("en 24 - 48"); 735 console.log("isAvailable", isAvailable); 736 // if ((isAvailable == -1)) { 737 // return false; 738 // } else { 739 // unavailable = '<span id="availability_value" class="label label-warning">' + startWith + '</span>'; 740 // } 741 var quantity = $("#quantityAvailable").text(); 742 quantity = parseFloat(quantity); 743 744 var qtywanted = $("#quantity_wanted").val().trim(); 745 qtywanted = parseFloat(qtywanted); 746 747 console.log(qtywanted + ">" + quantity); 748 if (qtywanted > quantity) { 749 $("#availability_statut").html(unavailable); 750 mytimer = setInterval(function () { 751 if ($("#mensaje-ratraso-envio").length) { 752 $("#mensaje-ratraso-envio").html(unavailable); 753 } 754 }, 1000); 755 } else { 756 $("#availability_statut").html(available); 757 clearInterval(mytimer); 758 } 759 760 761 762 // MOD CIMADIGITAL FIX DISPONIBLE CUANDO NO QUEDA STOCK 763 // console.log("qtywanted", qtywanted); 764 // console.log("quantity", quantity); 765 // if (qtywanted > quantity) { 766 // $("availability_value").text() = "Entrega en 24 - 48 horas."; 767 // } else if (qtywanted <= quantity) { 768 // $("availability_value").text() = "Disponible"; 769 // } 770 // END MOD CIMADIGITAL FIX DISPONIBLE CUANDO NO QUEDA STOCK 771 772 773 774 775 776 }); 777 } 778}); 779//MOD CimadGitial David Roura 02 2024 - corregir buscador 780jQuery(function () { 781 console.log("fix searchbar"); 782 if ($(".search_query.form-control").length) { 783 $(".search_query.form-control").val(""); 784 $(".search_query.form-control").attr("placeholder", "Buscar en el catálogo..."); 785 $(".search_query.form-control").attr("value", ""); 786 } 787}); 788//MOD CimadGitial David Roura 04 2024 - Traducir Scroll infinito 789jQuery(function () { 790 console.log("translate infinite scroll"); 791 setInterval(function () { 792 var reachedBottom = "He llegado al final de la página."; 793 if ($(".infinitescroll-bottom-message.infinitescroll-reached-bottom-message").length) { 794 if ($("html[lang='pt-pt']").length) { 795 reachedBottom = "Chegamos ao final desta página."; 796 } 797 $(".infinitescroll-bottom-message.infinitescroll-reached-bottom-message").html(reachedBottom); 798 } 799 800 var loadMore = "Cargar más productos."; 801 if ($(".infinitescroll-bottom-message.infinitescroll-load-more-bottom a").length) { 802 if ($("html[lang='pt-pt']").length) { 803 loadMore = "Carregue mais produtos."; 804 } 805 $(".infinitescroll-bottom-message.infinitescroll-load-more-bottom a").html(loadMore); 806 } 807 }, 1000); 808});
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.