Last active
March 27, 2020 19:50
-
-
Save jasson-33/2bd4366740ba06c597b0b1ec297d4195 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
console.log("new form git hub gist"); | |
var cartItems = [] | |
$(document).ready(function(){ | |
$(".goto-form").click(function(){ | |
console.log("on the button click") | |
$("#step1").toggle(); | |
$("#step2").toggle(); | |
}) | |
$(".add-addon").click(function(){ | |
$(this).toggle(); | |
cartItems.push({ | |
id: $(this).data("addon-id"), | |
name: $(this).data("addon-name") | |
}); | |
fillMyCart(); | |
}) | |
$(".popmake-close").click(function(){ | |
$("#step1").show(); | |
$("#step2").hide(); | |
}) | |
}) | |
function fillMyCart(){ | |
$(".curent-cart").html(""); | |
console.log(cartItems) | |
var tempNames = []; | |
for(var i = 0; i < cartItems.length; i++){ | |
tempNames.push(cartItems[i].name); | |
$(".curent-cart").append("<li>" + | |
"<div>" + | |
"MyUC" + | |
"</div>" + | |
"<div>" + | |
"<img src=\"https://cwcbusiness.com/wp-content/uploads/2020/03/Borrar.png\">\n" + | |
"</div>" + | |
"</li>" + | |
"<hr>") | |
} | |
$("#additional_request_details").val(tempNames.join(",")) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment