").addClass("animated fadeIn slideDown"); shipping_valid = false; } } function createAfterZip(success_handler) { return function(response) { var shipping_valid; if ( response.is_user_within_maximum_distance == true ) { // Zip code passed test. Enable button $('#add_to_cart_button').removeClass('disabled'); shipping_valid = true; localStorage.setItem("rws_cart_zip", document.getElementById('zip').value); zip_code = document.getElementById('zip').value; } else { shipping_valid = false; // Zip code did not pass test. Display error and disable button if ( response.brand_caused_restriction == true ) { $('#zip_error').html("