<commit_before>function subForm(){
    console.log("submitting");
    var fields = $(":input").serializeArray();
    $("#item").empty();
    $.each(fields, function(i, field){
        $("#item").append(field.value + ", ");
    });
    $("#item").append(": $6.95");

    
    console.log(fields);
}

function goBack() {
	window.history.back()
}	<commit_msg>added cart implementation<commit_after>function subForm(){
    console.log("submitting");
    var fields = $(":input").serializeArray();
    var jFields = JSON.stringify(fields);
    console.log(jFields);

    var currentCart = sessionStorage.getItem("cart");
    var newCart = $.extend(currentCart, fields);
    console.log(newCart);

    sessionStorage.setItem("cart", JSON.stringify(newCart));
    console.log(sessionStorage.getItem("cart"))
    window.location.href="addedtocart";
}

function populateCart(){
	//Access the cart object from session storage
	var cart = JSON.parse(sessionStorage.getItem("cart"));
	console.log(cart);
	var addonCtr = 0;
	//Only overwrite cart if the cart object is not empty
	if(! $.isEmptyObject(cart) ){
		$("#cart").empty();
		$.each(cart, function(i, cart){
			if(cart.name == "Entree"){
				$("#cart").append("\n" + cart.value);
			} else{
				if(addonCtr++ > 0){
					$("#cart").append(", ");
				}else{
					$("#cart").append(" with ");
				}
				$("#cart").append(cart.value);
			}
	    });
	    $("#cart").append(": $6.00");
	}

	console.log(cart);
}

function clearCart(){
	sessionStorage.removeItem("cart");
	console.log("cart cleared");
}

function goBack() {
	window.history.back()
}	
{'fraction_non_alphanumeric': 0.20780856423173805, 'fraction_numerical': 0.005037783375314861, 'mean_word_length': 3.815151515151515, 'pattern_counts': {'":': 4, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4375512', 'n_tokens_mistral': 548, 'n_tokens_neox': 511, 'n_words': 96}