Commit 1f43fe00 authored by irving's avatar irving

Añadida pantalla de espera al agregar al carrito

parent 608400b6
...@@ -113,7 +113,7 @@ function updateCart(){ ...@@ -113,7 +113,7 @@ function updateCart(){
} }
}); });
} }
console.log(user); //console.log(user);
if (user == "demo") { if (user == "demo") {
window.location.href = "pay"; window.location.href = "pay";
} }
...@@ -479,7 +479,7 @@ $(document).ready(function () { ...@@ -479,7 +479,7 @@ $(document).ready(function () {
success : function (data) { success : function (data) {
productListGlobe = []; productListGlobe = [];
console.log("DATA: ", data); //console.log("DATA: ", data);
product_list = data; product_list = data;
// productListGlobe = data.catalog; // productListGlobe = data.catalog;
...@@ -572,18 +572,20 @@ $(document).ready(function () { ...@@ -572,18 +572,20 @@ $(document).ready(function () {
var ul_element = document.getElementById('product-list-globe'); var ul_element = document.getElementById('product-list-globe');
if (ul_element.firstChild) { if (ul_element.firstChild) {
console.log("ULEMA: ", ul_element); //console.log('#product-to-cart-form')
showWaitingModal()
//console.log("ULEMA: ", ul_element);
var submit_data = $('#product-to-cart-form').serialize(); var submit_data = $('#product-to-cart-form').serialize();
console.log("Submitted data:", typeof(submit_data)); //console.log("Submitted data:", typeof(submit_data));
console.log("Submitted data:", submit_data); //console.log("Submitted data:", submit_data);
var submit_data_array = submit_data.split("&product_selected="); var submit_data_array = submit_data.split("&product_selected=");
console.log("djdj: ", productListGlobe); //console.log("djdj: ", productListGlobe);
deletePolygon(); deletePolygon();
productListGlobe.forEach(function (data) { productListGlobe.forEach(function (data) {
if (submit_data_array.indexOf(data.uuid) > -1) { if (submit_data_array.indexOf(data.uuid) > -1) {
console.log("DATA sí esta: ", data.uuid); //console.log("DATA sí esta: ", data.uuid);
console.log("SS: ", data.product.size); //console.log("SS: ", data.product.size);
productsToObtain.push(data.uuid); productsToObtain.push(data.uuid);
erase_product_list_globe_by_id(data.uuid); erase_product_list_globe_by_id(data.uuid);
...@@ -616,11 +618,12 @@ $(document).ready(function () { ...@@ -616,11 +618,12 @@ $(document).ready(function () {
success: function () { success: function () {
cartProductList = []; cartProductList = [];
productUUIDListCart.push.apply(productUUIDListCart, productsToObtain); productUUIDListCart.push.apply(productUUIDListCart, productsToObtain);
showWaitingModal() //showWaitingModal()
updateCart(); updateCart();
} }
}); });
} else { } else {
hideWaitingModal()
mssgModal({ mssgModal({
title : "No products selected!", title : "No products selected!",
body : "Select one or more products to send to your cart." body : "Select one or more products to send to your cart."
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment