1<!DOCTYPE html> 2<!--[if IE 9]><html class="lt-ie10" > <![endif]--> 3<html class="no-js" xmlns="https://www.w3.org/1999/xhtml" xmlns:og="https://ogp.me/ns#" xmlns:fb="https://www.facebook.com/2008/fbml"> 4<!--<![endif]--> 5<head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# website: http://ogp.me/ns/website#"> 6 7 8 9 10<title>Carro | CompuElite Chile</title> 11 12<!-- Head MetaTags --> 13<meta http-equiv="Content-Type" content="text/html; charset=UTF-8; ie=edge" /> 14 15<meta name="description" content="Arma tu PC Gamer o Workstation en CompuElite Chile. Tienda especializada con showroom en Vitacura, atención personalizada, marcas premium y envÃos a todo Chile. Compra con Expertos, Compra Mejor!" /> 16<meta name="robots" content="follow, all" /> 17 18<!-- Set the viewport width to device width for mobile --> 19<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no" /> 20 21<link rel="canonical" href="https://www.compuelite.cl/cart"> 22 23<!-- Facebook Meta tags for Product --> 24<meta property="fb:app_id" content="283643215104248" /> 25 26 <meta property="og:title" content="CompuElite Chile" /> 27 <meta property="og:type" content="website" /> 28 <meta property="og:image" content="https://images.jumpseller.com/store/compuelite/store/logo/Compuelite_20Ver_20Pos.png?1776693561" /> 29 30 31<meta property="og:description" content="Arma tu PC Gamer o Workstation en CompuElite Chile. Tienda especializada con showroom en Vitacura, atención personalizada, marcas premium y envÃos a todo Chile. Compra con Expertos, Compra Mejor!" /> 32<meta property="og:url" content="https://www.compuelite.cl/cart" /> 33<meta property="og:site_name" content="CompuElite Chile" /> 34<meta name="twitter:card" content="summary" /> 35 36 37<meta property="og:locale" content="es_CL" /> 38 39 40 41<link rel="preconnect" href="https://images.jumpseller.com"> 42<link rel="preconnect" href="https://cdnx.jumpseller.com"> 43<link rel="preconnect" href="https://assets.jumpseller.com"> 44 45 46<link rel="alternate" hreflang="es-CL" href="https://www.compuelite.cl/cart" /> 47 48 49<!-- Bootstrap CSS --> 50 51<link rel="preload" href="//assets.jumpseller.com/public/bootstrap-5.1.3-dist/css/bootstrap.min.css" as="style" onload="this.onload=null;this.rel='stylesheet'"> 52<noscript><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.1.3/css/bootstrap.min.css" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous" ></noscript> 53 54 55<!-- Swiper files -->
56<script src="https://cdnjs.cloudflare.com/ajax/libs/Swiper/8.0.7/swiper-bundle.min.js" integrity="sha384-9UAjEH/hWCBrpIvGlIa3Y1bFwXvceFtZIB4kEuw8dPhXHwqADmYvC1FQcyKHMVGw" crossorigin="anonymous" ></script>
56 57 58<link rel="preload" href="//assets.jumpseller.com/public/swiper-8.0.7/swiper-bundle.min.css" as="style" onload="this.onload=null;this.rel='stylesheet'"> 59<noscript><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/Swiper/8.0.7/swiper-bundle.min.css" integrity="sha384-PkFv3YEXftf+kllyTcVl8cCpexHu47ERzAsXp+iZ4SIAnJKl6fZh0rdtTO7YBEHb" crossorigin="anonymous" ></noscript> 60 61 62 63<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/2.1.3/toastr.min.css" integrity="sha384-YzEqZ2pBV0i9OmlTyoz75PqwTR8If8GsXBv7HLQclEVqIC3VxIt98/U94ES6CJTR" crossorigin="anonymous" > 64 65 66<!-- CSS Files --> 67<link rel="stylesheet" href="https://assets.jumpseller.com/store/compuelite/themes/552300/variables.min.css?1789496506" /> 68<link rel="stylesheet" href="https://assets.jumpseller.com/store/compuelite/themes/552300/styles.min.css?1788467398" /> 69 70 71 72<link rel="stylesheet" href="https://assets.jumpseller.com/store/compuelite/themes/552300/styles_cart.min.css?1675179834" /> 73 74 75<link rel="stylesheet" href="https://assets.jumpseller.com/store/compuelite/themes/552300/styles_options.min.css?1789496506" /> 76 77 78 79 80<link rel="preconnect" href="https://fonts.googleapis.com"> 81<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> 82 83<!-- optionally increase loading priority --> 84<link rel="preload" as="style" href="https://fonts.googleapis.com/css2?family=Albert+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Work+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap"> 85 86<!-- async CSS --> 87<link rel="stylesheet" media="screen" onload="this.onload=null;this.removeAttribute('media');" href="https://fonts.googleapis.com/css2?family=Albert+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Work+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap"> 88 89<!-- no-JS fallback --> 90<noscript> 91 <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Albert+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Work+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap"> 92</noscript> 93 94<!-- jQuery -->
95<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js" integrity="sha384-ZvpUoO/+PpLXR1lu4jmpXWu80pZlYUAfxl5NsBMWOEPSjUn/6Z/hRTt8+pR6L4N2" crossorigin="anonymous" ></script>
95 96<!-- LazySizes -->
97<script src="https://cdnjs.cloudflare.com/ajax/libs/lazysizes/5.3.2/lazysizes.min.js" integrity="sha384-3gT/vsepWkfz/ff7PpWNUeMzeWoH3cDhm/A8jM7ouoAK0/fP/9bcHHR5kHq2nf+e" crossorigin="anonymous" async=''></script>
97 98<!-- Font Awesome Icon Library -->
99<script src="https://kit.fontawesome.com/f3e08c287e.js" crossorigin="anonymous"></script>
99 100 101<!-- Autocomplete search --> 102
103<script src="https://cdn.jsdelivr.net/npm/@algolia/[email protected]/dist/umd/index.production.min.js" integrity="sha384-fZZuusWZz3FhxzgaN0ZQmDKF5cZW+HP+L8BHTjUi16SY5rRdPc75fmH2rB0Y5Xlz" crossorigin="anonymous" ></script>
vendor: 1 bytes, line 103
103
104<script src="//assets.jumpseller.com/public/autocomplete/[email protected]" data-suggest-categories="false" defer="defer"></script>
104 105<style type="text/css">#store-search .aa-ClearButton:after {display: block;content: "Eliminar texto de búsqueda";}</style> 106 107 108<!-- Store Favicon --> 109 110 <link rel="apple-touch-icon" href="https://cdnx.jumpseller.com/compuelite/image/75924186/resize/180/180?1776691840" sizes="180x180"> 111 112 <link rel="icon" type="image/png" href="https://cdnx.jumpseller.com/compuelite/image/75924186/resize/32/32?1776691840" sizes="32x32"> 113 <link rel="icon" type="image/png" href="https://cdnx.jumpseller.com/compuelite/image/75924186/resize/16/16?1776691840" sizes="16x16"> 114 115 <link rel="manifest" href="/manifest.json"> 116 117 118 119 120 121 122 <meta name="google-site-verification" content="-vFF26ogK7e4CLD9vPgVAeZAhYwnmN8HOCkEYdY0JbA"/> 123 <meta name="facebook-domain-verification" content="ou500yyptumnw8ybsnwqm1zvq98bh2" /> 124 <meta name='google-site-verification' content='-vFF26ogK7e4CLD9vPgVAeZAhYwnmN8HOCkEYdY0JbA'/> 125 <meta name='google-site-verification' content='-vFF26ogK7e4CLD9vPgVAeZAhYwnmN8HOCkEYdY0JbA'/> 126 <meta name='google-site-verification' content='-vFF26ogK7e4CLD9vPgVAeZAhYwnmN8HOCkEYdY0JbA'/>
vendor: 69 bytes, lines 126-128
126 127 128 <script async src="https://www.googletagmanager.com/gtag/js?id=
128G-RL1XXRGS2F
vendor: 77 bytes, lines 128-129
128"></script> 129 <script async src="https://www.googletagmanager.com/gtag/js?id=
129AW-10873443654
vendor: 13 bytes, lines 129-130
129"></script> 130
131<script> 132 (() => { 133 window.dataLayer = window.dataLayer || []; 134 window.gtag = window.gtag || function () { window.dataLayer.push(arguments); }; 135 136 const gtag = window.gtag; 137 138 gtag('js', new Date()); 139 140 141 // custom dimensions (for OKRs metrics) 142 let custom_dimension_params = { custom_map: {} }; 143 custom_dimension_params['custom_map']['dimension1'] = 'theme'; 144 custom_dimension_params['theme'] = "apparel"; 145 146 // Send events to Jumpseller GA Account 147 // gtag('config', 'G-JBWEC7QQTS', Object.assign({}, { 'allow_enhanced_conversions': true }, custom_dimension_params)); 148 149 // Send events to Store Owner GA Account 150 151 const persistGaClientId = (clientId) => { 152 const orderRecoverToken = ""; 153 if (!clientId || !orderRecoverToken) return; 154 155 fetch('/api/analytics/ga4_client_id.json', { 156 method: 'POST', 157 headers: { 158 'Content-Type': 'application/json', 159 Accept: 'application/json' 160 }, 161 credentials: 'same-origin', 162 body: JSON.stringify({ client_id: clientId, order_recover_token: orderRecoverToken }) 163 }).catch(() => {}); 164 }; 165 166 gtag('config', 'G-RL1XXRGS2F'); 167 gtag('get', 'G-RL1XXRGS2F', 'client_id', (cid) => persistGaClientId(cid)); 168 gtag('config', 'AW-10873443654', { 'allow_enhanced_conversions': true }); 169 170 const order_items = []; 171 172 gtag('event', 'view_cart', { 173 currency: "CLP", 174 items: order_items, 175 value: 0.0 176 }); 177 178 })(); 179</script>
179 180 181 182
183<script> 184 (() => { 185 // Pixel code 186 187 // dont send fb events if page is rendered inside an iframe (like admin theme preview) 188 if(window.self === window.top) { 189 !function(f,b,e,v,n,t,s){if(f.fbq)return;n=f.fbq=function(){n.callMethod? 190 n.callMethod.apply(n,arguments):n.queue.push(arguments)};if(!f._fbq)f._fbq=n; 191 n.push=n;n.loaded=!0;n.version='2.0';n.agent='pljumpseller';n.queue=[];t=b.createElement(e);t.async=!0; 192 t.src=v;s=b.getElementsByTagName(e)[0];s.parentNode.insertBefore(t,s)}(window, 193 document,'script','https://connect.facebook.net/' + getNavigatorLocale() + '/fbevents.js'); 194 195 const data = {}; 196 197 data.currency = 'CLP'; 198 data.total = 0.0; 199 data.products_count = 0; 200 201 202 data.content_ids = []; 203 data.contents = []; 204 data.single_value = 0.0; 205 206 207 // Line to enable Manual Only mode. 208 fbq('set', 'autoConfig', false, '1940775012757138'); 209 210 // FB Pixel Advanced Matching 211 212 const advancedCustomerData = {}; 213 214 fbq('init', '1940775012757138', advancedCustomerData); 215 216 // PageView - build audience views (default FB Pixel behaviour) 217 fbq('track', 'PageView'); 218 219 // AddToCart - released on page load after a product was added to cart 220 221 // track conversion events, ordered by importance (not in this doc) 222 // https://developers.facebook.com/docs/facebook-pixel/api-reference%23events 223 224 // ViewCart - /cart/index 225 226 227 function getNavigatorLocale(){ 228 return navigator.language.replace(/-/g,'_') 229 } 230 } 231 })(); 232</script>
232 233 234 235
236<script src="https://files.jumpseller.com/common/packs/js/jumpseller-2.0.1-10eb7fbbfd1f4b7c.js" crossorigin="anonymous" integrity="sha256-QGLAYkoZGGIov/uix2lw3+nv/fdHlg9l+iZFpBRz4+k=" defer="defer"></script>
236</head> 237<body class="theme-style--rectangular"> 238 239 240 241 242 243 244 <!-- 245 Do NOT place any code here, between the Header and the Main container elements 246 --> 247 248 <div class="main-container main-container--cart"> 249 250 251 252 253 <!-- Cart Header --> 254<section class="container-fluid cart-header"> 255 <div class="container cart-header__container"> 256 <div class="row align-items-center justify-content-stretch"> 257 <div class="col-12 col-md text-center text-md-start cart-header__column"> 258 <h1 class="cart-header__title"> 259 <a href="https://www.compuelite.cl" class="cart-header__anchor" title="Ir al Inicio"> 260 261 <img src="https://assets.jumpseller.com/store/compuelite/themes/552300/settings/4fa7779555a1230953e7/LOGO%20COMPUELITE%201920x300.jpg?1729102469" alt="compuelite" class="cart-header__logo" style="height:50px!important;"> 262 263 </a> 264 </h1> 265 </div> 266 267 268 <div class="col-12 col-md-auto text-center text-md-end cart-header__column"> 269 <ul class="no-bullet cart-header__breadcrumbs"> 270 271 272 273 274 275 276 277 278 <li class="cart-header__item cart-header__item--active"> 279 280 <div class="cart-header__object"> 281 <span class="cart-header__number">1</span> 282 <span class="cart-header__text">Carro</span> 283 </div> 284 285 </li> 286 287 <li class="cart-header__item"> 288 289 <div class="cart-header__object"> 290 <span class="cart-header__number">2</span> 291 <span class="cart-header__text">Checkout</span> 292 </div> 293 294 </li> 295 296 <li class="cart-header__item"> 297 <div class="cart-header__object"> 298 <span class="cart-header__number">3</span> 299 <span class="cart-header__text">Revisión del Pedido</span> 300 </div> 301 </li> 302 303 <li class="cart-header__item"> 304 <div class="cart-header__object"> 305 <span class="cart-header__number">4</span> 306 <span class="cart-header__text">Compra Exitosa</span> 307 </div> 308 </li> 309 </ul> 310 </div> 311 312 </div> 313 </div> 314</section> 315<!-- end .cart-header --> 316 317<!-- Cart Content --> 318<section class="container-fluid cart-content"> 319 <div class="container cart-content__container"> 320 <div class="row"> 321 <div class="col-12 col-lg-8 cart-content__body"> 322 323 <div class="row text-center cart-message"> 324 <div class="col-12 cart-message__wrapper"> 325 <h1 class="cart-message__title">El carro está actualmente vacÃo. Puedes volver y comenzar a agregar productos.</h1> 326 <a href="https://www.compuelite.cl" class="button button--rectangular button--main button--upp cart-message__button" title="Go to home page">Go to home page</a> 327 </div> 328 </div> 329 330 </div> 331 <!-- end .cart-content__body --> 332 333 334 335<!-- Cart Summary --> 336<div class="col-12 col-lg-4 cart-summary cart-summary--empty"> 337 <div class="row cart-summary__wrapper"> 338 339 <div class="col-12 cart-summary__block"> 340 <h6 class="cart-summary__title">Estimar costos de envÃo</h6> 341 342 <div id="estimate_shipping"> 343 <form id="estimate_shipping_form" autocomplete="off" action="/cart/estimate" accept-charset="UTF-8" method="post"> 344 <!-- Country --> 345 <label for="estimate_shipping_country">PaÃs</label> 346 <select name="estimate[country]" id="estimate_shipping_country" class="select"><option selected="selected" value="CL">Chile</option></select> 347 348 <!-- Region --> 349 <label for="estimate_shipping_region">Región</label> 350 <select name="estimate[region]" id="estimate_shipping_region" class="select"><option value="02">Aisén</option> 351<option value="03">Antofagasta</option> 352<option value="04">AraucanÃa</option> 353<option value="16">Arica y Parinacota</option> 354<option value="05">Atacama</option> 355<option value="06">BiobÃo</option> 356<option value="07">Coquimbo</option> 357<option value="08">Libertador General Bernardo O'Higgins</option> 358<option value="14">Los Lagos</option> 359<option value="17">Los RÃos</option> 360<option value="10">Magallanes</option> 361<option value="11">Maule</option> 362<option value="18">Ãuble</option> 363<option value="12">Región Metropolitana</option> 364<option value="15">Tarapacá</option> 365<option value="01">ValparaÃso</option></select> 366 367 <!-- Municipality --> 368 <label for="estimate_shipping_municipality" style="display: none;">Comuna</label> 369 <select name="estimate[municipality]" id="estimate_shipping_municipality" class="select" style="display: none;"></select> 370 371 <!-- Postal --> 372 373 <div class="estimate_shipping_buttons"> 374 <input id="estimate_shipping_button" type="submit" value="Calcular EnvÃo "> 375 </div> 376</form> 377 378 <!-- Postal JS --> 379 380 <!-- Municipality JS --> 381 <!-- CSS pseudo elements on selects can't be hidden with Javascript --> 382 <style>.municipality-hide:after, .municipality-hide:before{ display: none; }</style> 383
383<script> 384 // define new Rule for Municipality field 385 const municipality_rule_source = '[{"dependency":"country","value":"CL","function":"municipality_change"}]'; 386 var municipality_rule = municipality_rule_source == 'null' ? {} : JSON.parse(municipality_rule_source)[0]; 387 388 // define array of functions to be called 389 if(rules_functions === undefined){ var rules_functions = []; } 390 rules_functions.push(municipality_rule['function']); 391 392 // define Municipality Rule function 393 window[municipality_rule['function']] = function(){ 394 if(municipality_rule['value'].indexOf($("select[name*=" + municipality_rule['dependency'] + "]").val()) > -1){ 395 $('label[for=estimate_shipping_municipality], select#estimate_shipping_municipality').show(); 396 $('select#estimate_shipping_municipality').parent('div').show(); 397 $("select#estimate_shipping_municipality").removeClass("municipality-hide").parent().removeClass("municipality-hide"); 398 399 if($('#estimate_shipping_municipality').val() == null){ 400 Jumpseller.getMunicipalities('#estimate_shipping_municipality', $('select#estimate_shipping_region').val(), $('select#estimate_shipping_country').val(), null); 401 } 402 } 403 else { 404 $('label[for=estimate_shipping_municipality], select#estimate_shipping_municipality').hide(); 405 $('select#estimate_shipping_municipality').parent('div').hide(); 406 $("select#estimate_shipping_municipality").addClass("municipality-hide").parent().addClass("municipality-hide"); 407 } 408 } 409</script>
409 410 411 </div> 412 413 </div> 414 415 416 417 418 419 420 421 422 <!-- Store Totals --> 423 <div class="col-12 store-totals"> 424 <div class="row align-items-center"> 425 <div class="col-12 store-totals__block"> 426 <hr class="store-totals__divider"> 427 </div> 428 429 <!-- Count --> 430 <div class="col-12 store-totals__block" data-name="products"> 431 <div class="row"> 432 <div class="col-6"> 433 <span class="store-totals__string">Products</span> 434 </div> 435 <div class="col-6 text-end"> 436 <span class="store-totals__number store-totals__number--count">0</span> 437 </div> 438 </div> 439 </div> 440 <!-- end .store-totals__block --> 441 442 <!-- Subtotal --> 443 <div class="col-12 store-totals__block" data-name="subtotal"> 444 <div class="row"> 445 <div class="col-6"> 446 <span class="store-totals__string">Subtotal</span> 447 </div> 448 <div class="col-6 text-end"> 449 <span class="store-totals__number store-totals__number--subtotal" data-value="0.0">$0</span> 450 </div> 451 </div> 452 </div> 453 <!-- end .store-totals__block --> 454 455 <!-- Shipping --> 456 <div class="col-12 store-totals__block" data-name="shipping"> 457 <div class="row"> 458 <div class="col-6"> 459 <span class="store-totals__string">EnvÃo</span> 460 </div> 461 <div class="col-6 text-end"> 462 <span class="store-totals__number store-totals__number--shipping" data-value="0.0">$0</span> 463 </div> 464 465 </div> 466 </div> 467 <!-- end .store-totals__block --> 468 469 <!-- Taxes --> 470 <div class="col-12 store-totals__block d-none" data-name="taxes"> 471 <div class="row"> 472 <div class="col-6"> 473 <span class="store-totals__string">Impuestos</span> 474 </div> 475 <div class="col-6 text-end"> 476 <span class="store-totals__number store-totals__number--taxes" data-value="0.0">$0</span> 477 </div> 478 </div> 479 </div> 480 <!-- end .store-totals__block --> 481 482 <!-- Discounts --> 483 <div class="col-12 store-totals__block" data-name="discounts"> 484 <div class="row"> 485 <div class="col-6"> 486 <span class="store-totals__string">Descuentos</span> 487 </div> 488 <div class="col-6 text-end"> 489 <span class="store-totals__number store-totals__number--discounts" data-value="0.0">$0</span> 490 </div> 491 </div> 492 </div> 493 <!-- end .store-totals__block --> 494 495 <!-- Total --> 496 <div class="col-12 store-totals__block" data-name="total"> 497 <div class="row"> 498 <div class="col-6"> 499 <span class="store-totals__string store-totals__string--last">Total</span> 500 </div> 501 <div class="col-6 text-end"> 502 <span class="store-totals__number store-totals__number--total store-totals__number--last" data-total="0.0">$0</span> 503 </div> 504 </div> 505 </div> 506 <!-- end .store-totals__block --> 507 508 509 510 511 <div class="col-12 store-totals__block"> 512 <hr class="store-totals__divider store-totals__divider--push"> 513 </div> 514 515 516 <div class="col-12 text-center store-totals__message dont-require-minimum"> 517 <div class="alert alert-warning store-totals__alert"> 518 519 </div>
520 </div> 521 <!-- end .store-totals__alert --> 522 523 524 <div class="col-12 text-center store-totals__actions"> 525 <div class="store-totals__wrapper"> 526 527 <a href="https://www.compuelite.cl/v2/checkout/information/" class="button button--rectangular button--main button--full button--upp store-totals__button" title="Ir al Checkout">Ir al Checkout <i class="far fa-arrow-right fa-fw"></i></a> 528 529 </div> 530 531 532 533 <a href="https://www.compuelite.cl" class="store-totals__link" title="Continuar comprando">Continuar comprando</a> 534 </div> 535 <!-- end .store-totals__actions --> 536 537 </div> 538</div> 539<!-- end .store-totals --> 540 </div> 541</div> 542<!-- end .cart-summary --> 543 </div> 544 </div> 545</section> 546<!-- end .cart-content --> 547 548 549<!-- Cart Page scripts -->
550<script type="text/javascript"> 551$(document).ready(function(){ 552 553 554 555 // Estimate Shipping additional code 556 var estimate_form = $('#estimate_shipping_form'), 557 estimate_results = $('#estimate_shipping_results'); 558 559 // Change value of first estimate shipping button 560 $('#estimate_shipping_button').val('Mostrar opciones de envÃo'); 561 562 563 564 if( estimate_results.is(':visible') ){ 565 // Hide first estimate shipping button 566 estimate_form.find('.estimate_shipping_buttons').hide(); 567 568 // Change name of the results button 569 estimate_results.find('input[type="submit"]').val('Confirmar opción de envÃo'); 570 571 // console.log('Estimates table is visible'); 572 $('#estimates dt').each(function(){ 573 let shipping_method = $(this), 574 shipping_method_anchor = shipping_method.find('span'), 575 shipping_method_radio = shipping_method.find('input[type="radio"]'); 576 577 if( shipping_method_radio.is(':checked') ){ 578 shipping_method.addClass('active'); 579 shipping_method_radio.addClass('checked'); 580 } 581 582 if( shipping_method_radio.is(':enabled') ){ 583 shipping_method.on('click', function(){ 584 // Sibling items 585 shipping_method.siblings('dt').removeClass('active'); 586 $('#estimates input[type="radio"]').attr('checked', false).removeClass('checked'); 587 588 // Current item 589 shipping_method.addClass('active'); 590 shipping_method_radio.attr('checked', true).addClass('checked'); 591 }); 592 } 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 }); 629 630 estimate_form.find('.select').on('change', function(){ 631 estimate_results.hide(); 632 estimate_form.find('.estimate_shipping_buttons').show(); 633 }); 634 } 635 636 637 jQuery.getJSON("/api/cart.json",function(data){ 638 var coupons = data.coupons; 639 640 if( coupons != null ){ 641 var coupons_split = coupons.split(','), 642 coupons_list = "", 643 coupons_container = 644 '<div class="col-12 store-totals__block" data-name="coupons">' + 645 '<div class="row align-items-center store-totals__coupons">' + 646 '<div class="col-12"><span class="store-totals__string">Códigos de descuento aplicados:</span></div>' + 647 '<div class="col-12" data-name="coupons-list"></div>' + 648 '</div>' + 649 '</div>'; 650 651 $(coupons_container).insertBefore($('.store-totals__block[data-name="total"]')); 652 653 // console.log('Cupones: ' + coupons); 654 655 // Iterate coupons and create 'li' items 656 for (var coupon = 0; coupon < coupons_split.length; coupon++){ 657 coupons_list += '<div class="store-totals__code"><span>' + coupons_split[coupon] + '</span><button type="button" class="trsn button store-totals__remove"><i class="fas fa-times fa-fw"></i></a></div>'; 658 } 659 // Append to coupons list 660 $('.store-totals__block[data-name="coupons"]').find('div[data-name="coupons-list"]').html(coupons_list); 661 662 // Remove Coupon function 663 $('.store-totals__remove').click(function(){ 664 let coupon = $(this).parents('.store-totals__code').find('span').text(); 665 Jumpseller.removeCouponFromCart(coupon, 0); 666 667 // console.log(coupon); 668 669 setTimeout(function() { 670 671 672 // location.reload(); 673 location.href = "/cart"; 674 alert('Tu código "' + coupon + '" ha sido eliminado exitosamente. Esta página ahora se actualizará.'); 675 }, 1000); 676 }); 677 } 678 }); 679}); 680</script>
680 681 682 683 684 685 </div> 686 <!-- end .main-container --> 687 688 689 690 691 692 693 <a href="https://api.whatsapp.com/send?phone=56944947006" class="button store-whatsapp store-whatsapp--bottom-right" title="EnvÃanos un mensaje por Whatsapp" target="_blank"><i class="fab fa-whatsapp fa-fw"></i></a> 694 695 696 <!-- Store Body Schema.org -->
697<script type="application/ld+json"> 698[ 699 { 700 "@context": "http://schema.org", 701 "@type": "BreadcrumbList", 702 "itemListElement": [ 703 704 { 705 "@type": "ListItem", 706 "position": 1, 707 "item": { 708 "name": "Inicio", 709 "@id": "/" 710 } 711 } 712 , 713 714 { 715 "@type": "ListItem", 716 "position": 2, 717 "item": { 718 "name": "Carro" 719 } 720 } 721 722 723 ] 724 }, 725 { 726 "@context": "http://schema.org/" 727 728 }] 729 </script>
729 730 731<!-- Currency Script -->
732<script>!function(e){function r(r){var t=e.formatCurrency.regions[r];if(t)return t;if(/(\w+)-(\w+)/g.test(r)){var n=r.replace(/(\w+)-(\w+)/g,"$1");return e.formatCurrency.regions[n]}return null}function t(e){switch(e.toLowerCase()){case"int":return"Int";case"float":return"Float";default:throw"invalid parseType"}}function n(e){if(""===e.symbol)return new RegExp("[^\\d"+e.decimalSymbol+"-]","g");var r=e.symbol.replace("$","\\$").replace(".","\\.");return new RegExp(r+"|[^\\d"+e.decimalSymbol+"-]","g")}e.formatCurrency={},e.formatCurrency.regions=[],e.formatCurrency.regions[""]={symbol:"$",positiveFormat:"%s%n",negativeFormat:"(%s%n)",decimalSymbol:".",digitGroupSymbol:".",groupDigits:!0},e.fn.formatCurrency=function(t,a){1==arguments.length&&"string"!=typeof t&&(a=t,t=!1);var i={name:"formatCurrency",colorize:!1,region:"",global:!0,roundToDecimalPlace:-1,eventOnDecimalsEntered:!1};return i=e.extend(i,e.formatCurrency.regions[""]),(a=e.extend(i,a)).region.length>0&&(a=e.extend(a,r(a.region))),a.regex=n(a),this.each(function(){$this=e(this);var r="0";if((r=$this[$this.is("input, select, textarea")?"val":"html"]()).search("\\(")>=0&&(r="-"+r),""!==r&&("-"!==r||-1!==a.roundToDecimalPlace)){if(isNaN(r)){if(""===(r=r.replace(a.regex,""))||"-"===r&&-1===a.roundToDecimalPlace)return;"."!=a.decimalSymbol&&(r=r.replace(a.decimalSymbol,".")),isNaN(r)&&(r="0")}var n=String(r).split("."),i=r==Math.abs(r),o=n.length>1,l=o?n[1].toString():"0",s=l;if(r=Math.abs(n[0]),r=isNaN(r)?0:r,a.roundToDecimalPlace>=0&&("2"==(l=(l=parseFloat("1."+l)).toFixed(a.roundToDecimalPlace)).substring(0,1)&&(r=Number(r)+1),l=l.substring(2)),r=String(r),a.groupDigits)for(var c=0;c<Math.floor((r.length-(1+c))/3);c++)r=r.substring(0,r.length-(4*c+3))+a.digitGroupSymbol+r.substring(r.length-(4*c+3));(o&&-1==a.roundToDecimalPlace||a.roundToDecimalPlace>0)&&(r+=a.decimalSymbol+l);var g=(i?a.positiveFormat:a.negativeFormat).replace(/%s/g,a.symbol);g=g.replace(/%n/g,r);var u=e([]);(u=t?e(t):$this)[u.is("input, select, textarea")?"val":"html"](g),o&&a.eventOnDecimalsEntered&&s.length>a.roundToDecimalPlace&&u.trigger("decimalsEntered",s),a.colorize&&u.css("color",i?"black":"red")}})},e.fn.toNumber=function(t){var a=e.extend({name:"toNumber",region:"",global:!0},e.formatCurrency.regions[""]);return(t=jQuery.extend(a,t)).region.length>0&&(t=e.extend(t,r(t.region))),t.regex=n(t),this.each(function(){var r=e(this).is("input, select, textarea")?"val":"html";e(this)[r](e(this)[r]().replace("(","(-").replace(t.regex,""))})},e.fn.asNumber=function(a){var i=e.extend({name:"asNumber",region:"",parse:!0,parseType:"Float",global:!0},e.formatCurrency.regions[""]);(a=jQuery.extend(i,a)).region.length>0&&(a=e.extend(a,r(a.region))),a.regex=n(a),a.parseType=t(a.parseType);var o=e(this).is("input, select, textarea")?"val":"html",l=e(this)[o]();return l=l||"",l=l.replace("(","(-"),l=l.replace(a.regex,""),a.parse?(0==l.length&&(l="0"),"."!=a.decimalSymbol&&(l=l.replace(a.decimalSymbol,".")),window["parse"+a.parseType](l)):l}}(jQuery);</script>
732 733<!--
733<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/accounting.js/0.4.1/accounting.min.js"></script>
733--> 734<!--
734<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/money.js/0.2.0/money.min.js"></script>
734--> 735
736<script type="text/javascript"> 737 localStorage.setItem('global_currency', 'CLP'); 738</script>
738 739 740 741 742<!-- Main JS file -->
743<script src="https://assets.jumpseller.com/store/compuelite/themes/552300/main.min.js?1739965520"></script>
743 744 745 746<!-- Add to Cart scripts -->
747<script src="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/2.1.3/toastr.min.js" integrity="sha384-VDls8ImYGI8SwVxpmjX2Bn27U2TcNodzTNROTusVEWO55+lmL+H9NczoQJk6mwZR" crossorigin="anonymous" ></script>
747 748<!-- Cart Delete --> 749<div class="modal fade" id="cart-delete" tabindex="-1" aria-labelledby="cart-delete-title" aria-hidden="true" data-bs-backdrop="static" data-bs-keyboard="false"> 750 751 <div class="modal-dialog"> 752 <div class="modal-content cart-delete__content"> 753 <div class="modal-header cart-delete__heading"> 754 <h5 class="modal-title cart-delete__title" id="cart-delete-title">Eliminar producto</h5> 755 </div> 756 757 <div class="modal-body cart-delete__body"> 758 <div class="cart-delete__text">Estás a punto de eliminar <span class="cart-delete__product"></span> de tu carro. ¿Estás seguro?</div> 759 </div> 760 761 <div class="modal-footer cart-delete__footer"> 762 <button type="button" class="button button--rectangular cart-delete__button cart-delete__button--dismiss" data-bs-dismiss="modal" data-bs-target="#cart-delete" aria-label="Close"><i class="far fa-times fa-fw"></i> Cancelar</button> 763 <button type="button" class="button button--rectangular cart-delete__button cart-delete__button--confirm"><i class="far fa-check fa-fw"></i> Confirmar</button> 764 </div> 765 </div> 766 </div> 767</div> 768 769<!-- Add to Cart scripts -->
770<script> 771 $(document).ready(function() { 772 // Force modal-backdrop removing 773 $('.cart-delete__button--dismiss').click(function(){ 774 $('.modal-backdrop.fade.show').removeClass('show'); 775 776 setTimeout(function() { 777 $('.modal-backdrop').remove(); 778 }, 1000); 779 }); 780 781 document.querySelectorAll('.product-block__handler').forEach(handler => { 782 let isPlusButton = [...handler.classList].some(c => c.includes('__handler--plus')); 783 let isMinusButton = [...handler.classList].some(c => c.includes('__handler--minus')); 784 let product = handler.closest('.product-block__form'); 785 let productInput = product.querySelector('.product-block__input'); 786 let productMaxQty = parseInt(productInput.dataset.stock); 787 let newQuantity = 0; 788 const handlerType = handler.nodeName == "INPUT" ? "change" : "click"; 789 790 handler.addEventListener(handlerType, _ => { 791 let currentQuantity = Number(productInput.value); 792 793 if(!(currentQuantity >= 0)) { 794 currentQuantity = 1; 795 productInput.value = 1; 796 }; 797 798 if(isPlusButton) { 799 newQuantity = Math.min(currentQuantity + 1, productMaxQty); 800 } else if(isMinusButton) { 801 newQuantity = Math.max(currentQuantity -1, 0); 802 } else { 803 newQuantity = currentQuantity > productMaxQty ? productMaxQty : currentQuantity < 0 ? 0 : currentQuantity; 804 } 805 806 updateEveryInstanceOfProduct(product.dataset.id, newQuantity, productMaxQty) 807 }); 808 }); 809 810 // Get each store product 811 $('.store-product:not(.store-product--cross)').each(function(){ 812 let orderedProduct = $(this); 813 814 // Info 815 let orderedProductID = orderedProduct.find('.store-product__in-cart').val(), 816 orderedProductOriginalID = orderedProduct.find('.store-product__form').data('original-id'), 817 orderedProductPermalink = orderedProduct.data('permalink'), 818 orderedProductName = orderedProduct.find('.store-product__name').text(), 819 orderedProductRemove = orderedProduct.find('.store-product__delete'); 820 // Qty 821 let orderedProductForm = orderedProduct.find('.store-product__form'), 822 orderedProductQty = orderedProduct.find('.store-product__quantity'), 823 orderedProductInput = orderedProductQty.find('.store-product__input'), 824 orderedProductCounter = parseFloat(orderedProductInput.val()), 825 orderedProductPlus = orderedProductQty.find('.store-product__handler--plus'), 826 orderedProductMinus = orderedProductQty.find('.store-product__handler--minus'), 827 orderedProductMin = '1', 828 orderedProductMax = orderedProductInput.attr('data-stock'), 829 orderedProductQuantity = orderedProduct.find('.store-product__qty'); 830 // Original product 831 let originalProduct = $('.product-block__form--' + orderedProductOriginalID), 832 originalProductPlus = originalProduct.find('.product-block__handler--plus'); 833 834 835 836 if( orderedProductCounter == orderedProductMax ){ 837 orderedProductPlus.addClass('store-product__handler--disabled').prop('disabled', true); 838 } 839 840 // Plus handler 841 orderedProductPlus.click(function(){ 842 var oldValue = parseFloat(orderedProductInput.val()); 843 844 if (oldValue >= orderedProductMax) { 845 var newVal = oldValue; 846 } else { 847 var newVal = oldValue + 1; 848 } 849 850 orderedProductInput.val(newVal); 851 orderedProductInput.trigger('change'); 852 853 orderedProductQuantity.text(newVal); 854 orderedProductQuantity.trigger('change'); 855 856 if(newVal == orderedProductMax){ 857 orderedProductPlus.addClass('store-product__handler--disabled').prop('disabled', true); 858 originalProductPlus.addClass('product-block__handler--disabled').prop('disabled', true); 859 860 // orderedProduct.appendd 861 alert('Sólo hay ' + orderedProductMax + ' unidades de ' + orderedProductName); 862 } 863 864 if( originalProduct.length > 0 ){ 865 originalProduct.find('.product-block__input').val(newVal); 866 originalProduct.find('.product-block__input').trigger('change'); 867 } 868 869 }); 870 871 // Minus handler 872 orderedProductMinus.click(function() { 873 var oldValue = parseFloat(orderedProductInput.val()); 874 if (oldValue <= orderedProductMin) { 875 var newVal = oldValue; 876 removeOrderedProduct(); 877 orderedProductRemove.click(); 878 // $(this).parents('.store-product').remove(); 879 } else { 880 var newVal = oldValue - 1; 881 } 882 883 // product input 884 orderedProductInput.val(newVal); 885 orderedProductInput.trigger('change'); 886 // product quantity 887 orderedProductQuantity.text(newVal); 888 orderedProductQuantity.trigger('change'); 889 890 if(newVal < orderedProductMax){ 891 orderedProductPlus.removeClass('store-product__handler--disabled').prop('disabled', false); 892 originalProductPlus.removeClass('product-block__handler--disabled').prop('disabled', false); 893 } 894 895 if( originalProduct.length > 0 ){ 896 originalProduct.find('.product-block__input').val(newVal); 897 originalProduct.find('.product-block__input').trigger('change'); 898 } 899 900 }); 901 902 // call refreshCart function 903 refreshCart(); 904
905 // Trigger UpdateCart event 906 orderedProductInput.change(function(){ 907 orderedProduct.find('.store-product__button--update-cart').click(); 908 }); 909 910 orderedProductRemove.click(function(){ 911 removeOrderedProduct(); 912 }); 913 914 // Function for delete modal 915 function removeOrderedProduct(){ 916 var deleteModal = $('#cart-delete'), 917 deleteModalProduct = deleteModal.find('.cart-delete__product'), 918 deleteModalConfirm = deleteModal.find('.cart-delete__button--confirm'); 919 920 deleteModalProduct.text(orderedProductName); 921 deleteModalConfirm.attr('data-delete', orderedProductID); 922 923 deleteModalConfirm.off('click'); 924 deleteModalConfirm.on('click', function(){ 925 updateEveryInstanceOfProduct(originalProduct.data('id') || orderedProduct.data('originalId'), 0); 926 927 deleteModal.find('.cart-delete__button--dismiss').click(); 928 929 $('.modal-backdrop.fade.show').removeClass('show'); 930 931 setTimeout(function() { 932 $('.modal-backdrop').remove(); 933 }, 1000); 934 935 936 937 refreshCart(); 938 }); 939 } 940 }); 941 942 // Enable update cart button 943 document.querySelectorAll('.product-block__button--add-to-cart[data-clicked="1"]').forEach(function(element){ 944 element.setAttribute('data-clicked', '0'); 945 }); 946 }); 947 948 function toggleHandler(element, disabled) { 949 let handlerType = element.classList[0]; 950 if (disabled) { 951 element.setAttribute('disabled', 'disabled'); 952 element.classList.add(`${handlerType}--disabled`); 953 } else { 954 element.removeAttribute('disabled'); 955 element.classList.remove(`${handlerType}--disabled`); 956 } 957} 958 959function updateEveryInstanceOfProduct(id, quantity, productMaxQty = null) { 960 let sameProductElements = document.querySelectorAll(`.product-block__form--${id}`); 961 let storeProduct = document.querySelector(`.store-product[data-original-id='${id}']`); 962 let productName = storeProduct.querySelector('.store-product__name').textContent; 963 964 sameProductElements.forEach(product => { 965 let productInput = product.querySelector('.product-block__input'); 966 let productPlus = product.querySelector('.product-block__handler--plus'); 967 let productMinus = product.querySelector('.product-block__handler--minus'); 968 let productQuantity = product.querySelector('.product-block__quantity'); 969 let productAddToCart = product.querySelector('.product-block__button--add-to-cart'); 970 let productActions = product.parentNode; 971 let productBuynow = productActions.querySelector('.product-block__buy-now'); 972 973 974 // Update quantity 975 productInput.value = quantity; 976 977 // Disable/enable handlers if needed 978 switch(quantity) { 979 case productMaxQty: 980 toggleHandler(productPlus, true); 981 break; 982 case 0: 983 productQuantity.classList.remove('product-block__quantity--visible'); 984 productAddToCart.classList.remove('product-block__button--hidden'); 985 product.classList.remove('product-block__form--push'); 986 productBuynow.classList.remove('product-block__buy-now--hidden'); 987 productInput.value = 1; // Reset to 1 988 break; 989 default: 990 toggleHandler(productPlus, false); 991 toggleHandler(productMinus, false); 992 break; 993 } 994 }); 995 996 // Update Qty in sidebar product 997 if (quantity == 0) { 998 storeProduct.remove(); 999 } else { 1000 storeProduct.querySelector('.store-product__qty').textContent = quantity; 1001 storeProduct.querySelector('.store-product__input').value = quantity; 1002 } 1003 1004 // Finally, update the cart 1005 let storeProductId = storeProduct.dataset.id || storeProduct.querySelector('.store-product__in-cart').value 1006 updateCart(storeProductId, quantity, productName); 1007} 1008 1009// Get Cart function 1010function refreshCart(){ 1011 var callbackFunction = function(data){ 1012 // Check products and place quantity in the qty box 1013 var products = data.products; 1014 1015 $.each( products, function( key, value ) { 1016 var productCartID = value.id; 1017 var productName = value.name; 1018 var productID = value.product_id; 1019 var productQty = value.qty; 1020 var productSku = value.sku; 1021 var productStock = value.stock; 1022 1023 1024 // Call product block form 1025 let blockForm = $('.product-block__form--' + productID), 1026 blockFormQuantity = blockForm.find('.product-block__quantity'), 1027 blockFormInput = blockForm.find('.product-block__input'), 1028 blockFormInputQty = blockFormInput.val(), 1029 blockFormInputStock = blockFormInput.attr('data-stock'), 1030 blockFormAddtocart = blockForm.find('.product-block__button--add-to-cart'), 1031 blockFormIncart = blockForm.find('.product-block__in-cart'), 1032 blockFormDefaultQty = 1, 1033 blockFormBuynow = blockForm.parents('.product-block__actions').find('.product-block__buy-now'); 1034 1035 1036 1037 if( productQty > 0 ){ 1038 // Get store product 1039 var storeProduct = $('.store-product[data-original-id="' + productID + '"]'), 1040 storeProductName = storeProduct.find('.store-product__name').text(), 1041 storeProductOnclick = "updateCart( $('.store-product__in-cart--" + productCartID + "').val(), $('.store-product__input--" + productCartID +"').val(), '" + storeProductName + "');"; 1042 1043 var storeProductForm = 1044 '<form action="/cart/add/' + productID + '" class="store-product__form store-product__form--' + productCartID + '" method=post name=buy>' + 1045 '<button type="button" class="button button--main button--full store-product__button store-product__button--update-cart"' + 'onclick="' + storeProductOnclick + '" style="display:none!important;">Update cart</button>' + 1046 '<input id="prod_cart_id-' + productCartID + '" type="hidden" class="store-product__in-cart store-product__in-cart--' + productCartID + '" value="' + productCartID + '">' + 1047 '<div class="trsn store-product__quantity store-product__quantity--' + productCartID + '">' + 1048 '<button type="button" class="button store-product__handler store-product__handler--minus"><i class="fas fa-minus fa-fw"></i></button>' + 1049 '<input type="number" data-stock="' + blockFormInputStock + '" max="' + blockFormInputStock + '" class="store-product__input store-product__input--' + productCartID + '" value="' + productQty + '">' + 1050 '<button type="button" class="button store-product__handler store-product__handler--plus"><i class="fas fa-plus fa-fw"></i></button>' + 1051 '</div>' + 1052 '<input type="hidden">' + 1053 '</form>' + '<button type="button" class="button store-product__delete" data-bs-toggle="modal" data-bs-target="#cart-delete">Remove</button>'; 1054 1055 // Append ordered product form 1056 if( storeProduct.find('.store-product__form').length == 0 ){ 1057 storeProduct.find('.store-product__actions').append(storeProductForm); 1058 1059 var storeProductInput = storeProduct.find('.store-product__input'), 1060 storeProductMaxQty = parseFloat(storeProductInput.attr('data-stock')), 1061 storeProductMinQty = '1', 1062 storeProductPlus = storeProduct.find('.store-product__handler--plus'), 1063 storeProductMinus = storeProduct.find('.store-product__handler--minus'), 1064 storeProductDelete = storeProduct.find('.store-product__delete'), 1065 storeProductQuantity = storeProduct.find('.store-product__qty'); 1066 1067 // Add 1 item to cart 1068 storeProductPlus.click(function(){ 1069 // storeProduct.find('.store-product__input').val(productQty); 1070 1071 var oldQuantity = parseFloat(storeProductInput.val()); 1072 if (oldQuantity >= storeProductMaxQty) { 1073 var newQuantity = oldQuantity; 1074 } else { 1075 var newQuantity = oldQuantity + 1; 1076 } 1077 1078 // store product input 1079 storeProductInput.val(newQuantity); 1080 storeProductInput.trigger('change'); 1081 // store product quantity 1082 storeProductQuantity.text(newQuantity); 1083 storeProductQuantity.trigger('change'); 1084 1085 if(newQuantity == storeProductMaxQty){ 1086 storeProductPlus.addClass('store-product__handler--disabled').prop('disabled', true); 1087 1088 if( blockForm.length > 0 ){ 1089 blockForm.find('.product-block__handler--plus').addClass('product-block__handler--disabled'); 1090 } 1091 1092 1093 } 1094 1095 // $('.product-block__quantity--' + productID).find('.product-block__handler--plus').click(); 1096 }); 1097 1098 // Remove 1 unit from cart 1099 storeProductMinus.click(function(){ 1100 // storeProduct.find('.store-product__input').val(productQty); 1101 1102 var oldQuantity = parseFloat(storeProductInput.val()); 1103 if (oldQuantity <= storeProductMinQty) { 1104 var newQuantity = oldQuantity; 1105 removeStoreProduct(); 1106 //storeProductDelete.click(); 1107 // $(this).parents('.store-product').remove(); 1108 } else { 1109 var newQuantity = oldQuantity - 1; 1110 } 1111 1112 // store product input 1113 storeProductInput.val(newQuantity); 1114 storeProductInput.trigger('change'); 1115 // store product quantity 1116 storeProductQuantity.text(newQuantity); 1117 storeProductQuantity.trigger('change'); 1118 1119 if(newQuantity < storeProductMaxQty){ 1120 storeProductPlus.removeClass('store-product__handler--disabled').prop('disabled', false); 1121 1122 if( blockForm.length > 0 ){ 1123 blockForm.find('.product-block__handler--plus').removeClass('product-block__handler--disabled'); 1124 } 1125 1126 1127 } 1128 }); 1129
1130 // Trigger UpdateCart event 1131 storeProductInput.change(function(){ 1132 storeProduct.find('.store-product__button--update-cart').click(); 1133 }); 1134 1135 // Remove the product completely 1136 storeProductDelete.click(function(){ 1137 $('#cart-delete').addClass('show').attr('aria-hidden', 'true'); 1138 removeStoreProduct(); 1139 }); 1140 1141 // Function for delete modal 1142 function removeStoreProduct(){ 1143 var deleteModal = $('#cart-delete'), 1144 deleteModalProduct = deleteModal.find('.cart-delete__product'), 1145 deleteModalConfirm = deleteModal.find('.cart-delete__button--confirm'); 1146 1147 deleteModalProduct.text(productName); 1148 deleteModalConfirm.attr('data-delete', productCartID); 1149 1150 deleteModalConfirm.off('click'); 1151 deleteModalConfirm.on('click', function(){ 1152 updateEveryInstanceOfProduct(storeProduct.data('original-id'), 0); 1153 1154 deleteModal.find('.cart-delete__button--dismiss').click(); 1155 $('.modal-backdrop.fade.show').remove(); 1156 1157 // Check if form exists 1158 if( blockForm.length > 0 ){ 1159 blockForm.find('.product-block__input').val('1'); 1160 blockForm.find('.product-block__handler').removeClass('product-block__handler--disabled'); 1161 blockForm.find('.product-block__quantity').removeClass('product-block__quantity--visible'); 1162 blockForm.find('.product-block__button--add-to-cart').removeClass('product-block__button--hidden'); 1163 if( blockFormBuynow.length > 0 ){ 1164 blockFormBuynow.removeClass('product-block__buy-now--hidden'); 1165 blockForm.removeClass('product-block__form--push'); 1166 } 1167 } 1168 1169 1170 1171 // Call functions 1172 refreshCart(); 1173 updateCart(); 1174 }); 1175 1176 var newDeleteModal = new bootstrap.Modal(deleteModal); 1177 newDeleteModal.show(); 1178 } 1179 } 1180 1181 // for Product block 1182 blockFormInput.val(productQty); 1183 blockFormQuantity.addClass('product-block__quantity--visible'); 1184 blockFormAddtocart.addClass('product-block__button--hidden'); 1185 blockFormIncart.val(productCartID); 1186 if( productQty == blockFormInputStock ){ 1187 blockForm.find('.product-block__handler--plus').addClass('product-block__handler--disabled').prop('disabled', true); 1188 } 1189 if( blockFormBuynow.length > 0 ){ 1190 blockFormBuynow.addClass('product-block__buy-now--hidden'); 1191 blockForm.addClass('product-block__form--push'); 1192 } 1193 1194 1195 } else { 1196 // for Product block 1197 blockFormInput.val(blockFormDefaultQty); 1198 blockFormQuantity.removeClass('product-block__quantity--visible'); 1199 blockFormAddtocart.removeClass('product-block__button--hidden'); 1200 if( blockFormBuynow.length > 0 ){ 1201 blockFormBuynow.removeClass('product-block__buy-now--hidden'); 1202 blockForm.removeClass('product-block__form--push'); 1203 } 1204 1205 1206 } 1207 }); 1208 }; 1209 // outputs the cart's total amount. 1210 Jumpseller.getCart({callback: callbackFunction}) 1211} 1212 1213// Update Cart function 1214function updateCart(id, qty, productName, options) { 1215 Jumpseller.updateCart(id, qty, /*options,*/ { 1216 callback: function(data, status) { 1217 var products_count = data.products_count; 1218 var order_total = data.subtotal_with_discount; 1219 1220 1221 1222 1223 if( products_count == 0 ){ 1224 location.reload(); 1225 } else if( products_count > 0 ){ 1226 1227 if( $('.store-totals__message').length > 0 ){ 1228 1229 } 1230 1231 } 1232 1233 1234 // Update Order totals 1235 let updateTotals = function(data){ 1236 1237 1238// Update Store Totals values 1239$('.store-totals__number--count').html(data.products_count); 1240 1241// Subtotal 1242let subtotal = $('.store-totals__number--subtotal'); 1243subtotal.html(data.subtotal_formatted); 1244subtotal.attr('data-value', data.subtotal_formatted); 1245 1246if (data.subtotal > 0.0) { 1247 subtotal.parents('.store-totals__block').removeClass('d-none'); 1248} else { 1249 subtotal.parents('.store-totals__block').addClass('d-none'); 1250} 1251 1252// Shipping 1253let shipping = $('.store-totals__number--shipping'); 1254shipping.html(data.shipping_formatted); 1255shipping.attr('data-value', data.shipping_formatted); 1256 1257//if (data.shipping > 0.0) { 1258// shipping.parents('.store-totals__block').removeClass('d-none'); 1259//} else { 1260// shipping.parents('.store-totals__block').addClass('d-none'); 1261//} 1262 1263// Taxes 1264let taxes = $('.store-totals__number--taxes'); 1265taxes.html(data.tax_formatted); 1266taxes.attr('data-value', data.tax_formatted); 1267 1268if (data.tax > 0.0) { 1269 taxes.parents('.store-totals__block').removeClass('d-none'); 1270} else { 1271 taxes.parents('.store-totals__block').addClass('d-none'); 1272} 1273 1274// Discounts 1275let discounts = $('.store-totals__number--discounts'); 1276discounts.html(data.discount_formatted); 1277discounts.attr('data-value', data.discount_formatted); 1278 1279if (data.discount > 0.0) { 1280 discounts.parents('.store-totals__block').removeClass('d-none'); 1281} else { 1282 discounts.parents('.store-totals__block').addClass('d-none'); 1283} 1284 1285// Total 1286$('.store-totals__number--total').html(data.total_formatted); 1287$('.store-totals__number--total').attr('data-value', data.total_formatted); 1288 }; 1289 Jumpseller.getCart({callback: updateTotals}) 1290 1291 1292 1293 refreshCart(); 1294 } 1295 }); 1296} 1297 1298 function getProductOptions() { 1299 var options = {}; 1300 $(".prod-options").each(function() { 1301 var option = $(this); 1302 if($(this).is("fieldset")) options[option.attr('id')] = option.find(":checked").first().val(); 1303 else options[option.attr('id')] = option.val(); 1304 }); 1305 return options; 1306 } 1307 1308 // Add to Cart function 1309 function addToCart(id, productName, qty, options) { 1310 var prod = $('.product-block__form--' + id); 1311 let addToCartButtons = $('.product-block__form--' + id + ' .product-block__button--add-to-cart'); 1312 let alreadyOnCart = document.querySelector(`.store-product[data-original-id="${id}"]`) != null; 1313 1314 // Disable add to cart button while adding to cart process 1315 // Skip adding to cart if any button was already clicked 1316 if (addToCartButtons.data('clicked') == 1 || alreadyOnCart) return; 1317 else addToCartButtons.data('clicked', 1); 1318 1319 Jumpseller.addProductToCart(id, qty, options, { 1320 callback: function(data, status) { 1321 toastr.options = { 1322 closeButton: true, 1323 debug: false, 1324 newestOnTop: false, 1325 progressBar: true, 1326 positionClass: 'top-right', 1327 preventDuplicates: false, 1328 onclick: null, 1329 showDuration: '500', 1330 hideDuration: '1000', 1331 timeOut: '5000', 1332 extendedTimeOut: '1000', 1333 showEasing: 'swing', 1334 hideEasing: 'linear', 1335 showMethod: 'fadeIn', 1336 hideMethod: 'fadeOut', 1337 }; 1338 1339 if (data.status == 404) { 1340 toastr.error(data.responseJSON.message); 1341 } else { 1342 var prod_brand = prod.data('brand'), 1343 prod_name = prod.data('name'), 1344 prod_permalink = prod.data('permalink'), 1345 prod_image = prod.data('image'), 1346 prod_qty = prod.find('.product-block__input').first().val(), 1347 prod_message = prod.find('.product-block__message'), 1348 prod_buy_now = prod.parents('.product-block__actions').find('.product-block__buy-now'); 1349 1350 if(prod.hasClass('product-block__form--discount')){
1351 let converted_prod_pricing_new = prod.attr('data-price'); 1352 let converted_prod_pricing_old = prod.attr('data-price-default'); 1353 var prod_price = 1354 '<div class="store-product__price store-product__price--has-discount">' + 1355 '<span class="store-product__qty">' + prod_qty + '</span>' + 1356 '<span class="store-product__times">Ã</span>' + 1357 '<span class="store-product__price-new">' + converted_prod_pricing_new + '</span>' + 1358 '<small class="store-product__price-old">' + converted_prod_pricing_old + '</small>' + 1359 '</div>'; 1360 } else { 1361 let converted_prod_pricing_default = prod.attr('data-price'); 1362 var prod_price = 1363 '<div class="store-product__price">' + 1364 '<span class="store-product__qty">' + prod_qty + '</span>' + '<span class="store-product__times">Ã</span>' + converted_prod_pricing_default + 1365 '</div>'; 1366 } 1367 1368 var prod_parse = 1369 '<div class="store-product" data-original-id="' + id + '" data-permalink="' + prod_permalink + '">' + 1370 '<div class="store-product__container">' + 1371 '<a href="' + prod_permalink + '" class="store-product__image" title="Ir a ' + prod_name + '">' + 1372 '<img src="' + prod_image + '" alt="' + prod_name + '">' + 1373 '</a>' + 1374 '<div class="store-product__info">' + 1375 '<span class="store-product__brand">' + prod_brand + '</span>' + 1376 '<span class="store-product__name">' + prod_name + '</span>' + prod_price + 1377 '<div class="store-product__actions"></div>' + 1378 '</div>' + 1379 '</div>' + 1380 '</div>'; 1381 1382 $('.sidebar-cart__products').append(prod_parse); 1383 1384 // Show product added message and then hide it 1385 prod_message.addClass('product-block__message--visible'); 1386 setTimeout(function() { 1387 prod_message.removeClass('product-block__message--visible'); 1388 }, 1500); 1389 1390 // Hide 'Buy Now' link if exists 1391 if( prod_buy_now.length > 0 ){ 1392 prod_buy_now.addClass('product-block__buy-now--hidden'); 1393 prod_buy_now.parents('.product-block__actions').find('.product-block__form').addClass('product-block__form--push'); 1394 } 1395 1396 // Update Order totals 1397 1398 1399 // Update cart information 1400 var toolbar_counter = parseInt($('.header-toolbar__text--counter>div').text()); 1401 var toolbar_start = 1; 1402 if (toolbar_counter == 0 || !true) { 1403 // Open Sidebar Cart 1404 var offcanvas_el = document.getElementById("sidebar-cart"); 1405 var offcanvas = new bootstrap.Offcanvas(offcanvas_el, {backdrop: true}); 1406 offcanvas.show(); 1407 } else { 1408 $('.header-toolbar__text--counter>div').text(parseInt($('.header-toolbar__text--counter>div').text()) + parseInt(1)); 1409 1410 //Toastr notification 1411 toastr.success( 1412 qty + ' unidad de <strong>' + productName + '</strong> ha sido agregado al carro.' + ' <a href="/cart">Ir al Carro</a>' 1413 ); 1414 } 1415 1416 // call refreshCart function 1417 refreshCart(); 1418 updateCart(); 1419 } 1420 // Enable buttons again by setting the data property to false. There is no need to disable them, since or the buttons 1421 // are hidden and wont be clicked or something went bad and we need the buttons again. 1422 addToCartButtons.data('clicked', 0); 1423 }, 1424 }); 1425 } 1426</script>
1426 1427 1428 1429<!-- Bootstrap Bundle with Popper -->
1430<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.1.3/js/bootstrap.bundle.min.js" integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p" crossorigin="anonymous" ></script>
1430 1431 1432 1433 1434 1435 1436</body> 1437</html>
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.