Skip to content

Instantly share code, notes, and snippets.

@jasson112
Last active March 27, 2020 19:50
Show Gist options
  • Save jasson112/2bd4366740ba06c597b0b1ec297d4195 to your computer and use it in GitHub Desktop.
Save jasson112/2bd4366740ba06c597b0b1ec297d4195 to your computer and use it in GitHub Desktop.
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