Commit b43cc511 authored by Renán Sosa Guillen's avatar Renán Sosa Guillen

delete product when added to cart

parent c9d15988
......@@ -98,6 +98,11 @@ function erase_product_list_globe() {
}
}
function erase_product_list_globe_by_id(element_id) {
var $li_element = $('li#' + element_id);
$li_element[0].parentNode.removeChild($li_element[0]);
}
var prevfeature = null;
function drawApiResponse(element) {
product_list.catalog.forEach(function (data) {
......@@ -274,7 +279,7 @@ $(document).ready(function () {
event.preventDefault();
erase_product_list_globe();
// erase_product_list_globe();
console.log("Submitted data:", typeof(submit_data));
console.log("Submitted data:", submit_data);
......@@ -301,6 +306,7 @@ $(document).ready(function () {
if (submit_data_array.indexOf(data.id) > -1) {
console.log("DATA sí esta: ", data.id);
console.log("SS: ", data.product.size);
erase_product_list_globe_by_id(data.id);
product_html_li += '<li id="' + data.id + '">' +
'<a href="javascript:void(0)">' +
......
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