Caracteríticas:
'; } if(document.getElementById("botonlist"+id)) { document.getElementById("botonlist"+id).innerHTML = ''; } var base_url = "https://www.compumousemx.com/"; fetch(base_url+'/all/ProductAddCar?id='+id+'&cantidad='+cantidad+'&modelo='+modelo+'&sat_description='+sat_description+'&sat_key='+sat_key).then(res => res.json()) .then ( data => { getToCar(()=>{ if (document.getElementById("boton"+id)){document.getElementById("boton"+id).innerHTML = 'Agregar';} if (document.getElementById("botonlist"+id)){document.getElementById("botonlist"+id).innerHTML = 'Agregar';} }); } ) .catch ( error => { if (document.getElementById("boton"+id)){document.getElementById("boton"+id).innerHTML = 'Agregar';} if (document.getElementById("botonlist"+id)){document.getElementById("botonlist"+id).innerHTML = 'Agregar';} msg("Ooops!", "Primero inicie sesión", "error"); setTimeout(function() { window.location.href = '/all/login_mobile'; }, 500); } ); } function addToFav (id) { if (document.getElementById("boton"+id)) { document.getElementById("boton"+id).innerHTML = ''; } if(document.getElementById("botonlist"+id)) { document.getElementById("botonlist"+id).innerHTML = ''; } var base_url = "https://www.compumousemx.com/"; fetch(base_url+'/all/ProductAddFav?id='+id).then(res => res.json()) .then ( data => { getToCar(()=>{ if (document.getElementById("boton"+id)){document.getElementById("boton"+id).innerHTML = 'Agregar';} if (document.getElementById("botonlist"+id)){document.getElementById("botonlist"+id).innerHTML = 'Agregar';} }); } ) .catch ( error => { msg("Ooops!", "Primero inicie sesión", "error"); setTimeout(function() { window.location.href = '/all/login_mobile'; }, 500); } ); } function addToFavLocal (id) { if (document.getElementById("botonLocal"+id)) { document.getElementById("botonLocal"+id).innerHTML = ''; } if(document.getElementById("botonlistLocal"+id)) { document.getElementById("botonlistLocal"+id).innerHTML = ''; } var base_url = "https://www.compumousemx.com/"; fetch(base_url+'/all/ProductAddFavLocal?id='+id).then(res => res.json()) .then ( data => { getToCar(()=>{ if (document.getElementById("botonLocal"+id)){document.getElementById("botonLocal"+id).innerHTML = 'Agregar';} if (document.getElementById("botonlistLocal"+id)){document.getElementById("botonlistLocal"+id).innerHTML = 'Agregar';} }); } ) .catch ( error => { msg("Ooops!", "Primero inicie sesión", "error"); setTimeout(function() { window.location.href = '/all/login_mobile'; }, 500); } ); } function getToCar (_callback) { var base_url = "https://www.compumousemx.com/"; fetch(base_url+'/all/getCar').then(res => res.json()) .then ( data => { console.log(data); document.getElementById("car_get_products").innerHTML = data; if(document.getElementById("car_count_products0")) { if (document.getElementById("car_count_products")) { document.getElementById("car_count_products").innerHTML = document.getElementById("car_count_products0").value; } if (document.getElementById("car_count_products_mobile")) { document.getElementById("car_count_products_mobile").innerHTML = document.getElementById("car_count_products0").value; } } } ) .catch ( error => { if (document.getElementById("car_count_products")) { document.getElementById("car_count_products").innerHTML = 0; } if (document.getElementById("car_count_products_mobile")) { document.getElementById("car_count_products_mobile").innerHTML = 0; } } ) .finally ( () => { _callback(); } ); } getToCar(); function _delete (id, cantidad) { if (document.getElementById("boton_delete"+id)) { document.getElementById("boton_delete"+id).innerHTML = ''; } var base_url = "https://www.compumousemx.com/"; fetch(base_url+'/all/RemoveItemCar?id_product='+id+'&cantidad='+cantidad).then(res => res.json()) .then ( data => { getToCar(); } ) .catch ( error => { msg("Ooops!","No hay coneccion con carrito de compras","error"); } ); } function _deleteLocal (id, cantidad) { if (document.getElementById("boton_delete"+id)) { document.getElementById("boton_delete"+id).innerHTML = ''; } var base_url = "https://www.compumousemx.com/"; fetch(base_url+'/all/RemoveItemCarLocal?id='+id).then(res => res.json()) .then ( data => { getToCar(); } ) .catch ( error => { msg("Ooops!","No hay coneccion con carrito de compras","error"); } ); } function addToCar_locales (id) { var cantidad = 1; if (document.getElementById("cantidad"+id)) { cantidad = document.getElementById("cantidad"+id).value; } if (document.getElementById("boton"+id)) { document.getElementById("boton"+id).innerHTML = ''; } if(document.getElementById("boton"+id)) { document.getElementById("boton"+id).innerHTML = ''; } var base_url = "https://www.compumousemx.com/"; fetch(base_url+'/all/ProductAddCar_locales?id='+id+'&cantidad='+cantidad).then(res => res.json()) .then ( data => { getToCar(); if (document.getElementById("boton"+id)){document.getElementById("boton"+id).innerHTML = 'Agregar';} if (document.getElementById("botonlist"+id)){document.getElementById("botonlist"+id).innerHTML = 'Agregar';} } ) .catch ( error => { if (document.getElementById("boton"+id)){document.getElementById("boton"+id).innerHTML = 'Agregar';} if (document.getElementById("botonlist"+id)){document.getElementById("botonlist"+id).innerHTML = 'Agregar';} msg("Ooops!", "Primero inicie sesión", "error"); setTimeout(function() { window.location.href = '/all/login_mobile'; }, 500); } ); }