×
Select Your Vehicle
Submit
Save VehicleSubmit
');$j('#empty_submit').hide();}}}});// ADDING NEW NDP_LABEL_VEHICLES TO VEHICLE SECTION$j(document).on('click', ".add_new_vehicle", function() {$j('#modal-package_search_modal').modal('show');var type = $j(this).data('type');setTimeout(function() {showNewVehicles(type);$j('.back_to_my_vehicles').hide(); //zipcode_append_div if we want to hide zip$j('.save_new_vehicle_submit_button').show();}, 1);});$j('.tab_vehicle_search').click(function() {var vehicleType = $j(this).attr('data-vehicle_category_type');$j('.packages_container').hide();$j('.tab_vehicle_search').removeClass('active_vehicle_search_select').addClass('inactive_vehicle_search_select');$j('#'+vehicleType+'_packages').addClass('active_vehicle_search').toggle();$j(this).addClass('active_vehicle_search_select').removeClass('inactive_vehicle_search_select');appendZipcode();appendVehicleColor();});$j('.back_to_my_vehicles').click(function() {var option_vehicle_category_type = $j(".active_vehicle_search_select").data('vehicle_category_type');showexistingVehicles(option_vehicle_category_type);appendZipcode();appendVehicleColor();});$j("#add_new_vehicle_button").click(function(){var option_vehicle_category_type = $j("#existing_vehicle_select option:selected").data('vehicle_category_type');showNewVehicles(option_vehicle_category_type);});function showexistingVehicles(vehicle_category_type = null){var selected_vehicle_val = $j("#existing_vehicle_select option:first").val();// SET FIRST VEHICLE MATCHING TYPEif(vehicle_category_type){$j("#existing_vehicle_select option").each(function() {var option_vehicle_category_type = $j(this).data('vehicle_category_type');if(option_vehicle_category_type == vehicle_category_type){selected_vehicle_val = $j(this).val();return false;}});}else{}$j('#existing_vehicle_select').val(selected_vehicle_val);$j('.existing_vehicles_container').show();$j('.new_vehicles_container').hide();$j('#vehicle_zipcode_form').appendTo('#existing_vehicle_zipcode').show();$j('#existing_vehicle_select').trigger('click');$j('#modal-package_search_modal').modal('refresh');}function showNewVehicles(vehicle_category_type = null){var selected_vehicle_val = $j("#existing_vehicle_select option:first").val();$j('#existing_vehicle_select').val(selected_vehicle_val);$j('.existing_vehicles_container').hide();$j('.new_vehicles_container').show();$j('.back_to_my_vehicles').show();appendZipcode();appendVehicleColor();//SET FIRST VEHICLE MATCHING TYPEvar match = false;if(vehicle_category_type){ //NEW 8.31.20 COULD CONFLICT WITH BELOW $j('.tab_vehicle_search').each(function() {$j("#existing_vehicle_select option").each(function() {var option_vehicle_category_type = $j(this).data('vehicle_category_type');if(option_vehicle_category_type == vehicle_category_type){selected_vehicle_val = $j(this).val();$j('#'+vehicle_category_type+'_trigger').trigger('click');match = true;return false;}});if(match == false){if(vehicle_category_type){$j('#'+vehicle_category_type+'_trigger').trigger('click');}else{$j('.auto_packages_button').trigger("click");}}}$j('.tab_vehicle_search').each(function() {if($j(this).hasClass("active_vehicle_search_select")){$j(this).trigger('click'); //REMOVING FOR NOW BECAUSE MIGHT CONFLICT WITH ABOVE. 8.31.20}});$j('#modal-package_search_modal').modal('refresh');}function appendZipcode(){if(tmpl){//return;}$j('.zipcode_append_div').each(function() {if($j(this).is(":visible")){$j('#vehicle_zipcode_form').appendTo($j(this));}});}function appendVehicleColor(){$j('.vehicle_color_append_div').each(function() {if($j(this).is(":visible")){$j('#vehicle_color_container').appendTo($j(this));}});}$j(document).on('change, click', '#existing_vehicle_select', function() {var val = $j(this).val();if(val == ''){showNewVehicles();}else{var make = $j('#existing_vehicle_select option:selected').attr('data-vehicle_make');var model = $j('#existing_vehicle_select option:selected').attr('data-vehicle_model');var color = $j('#existing_vehicle_select option:selected').attr('data-vehicle_color');var vehicle_category_id = $j('#existing_vehicle_select option:selected').attr('data-vehicle_category_id');var vehicle_category_type = $j('#existing_vehicle_select option:selected').attr('data-vehicle_category_type');var vehicle_length = $j('#existing_vehicle_select option:selected').attr('data-vehicle_length');var item_category = $j('#existing_vehicle_select option:selected').attr('data-item_category');if(vehicle_length){$j('#vehicle_length').val(vehicle_length);}else{$j('#vehicle_length').val('');}$j('#vehicle_make').val(make);$j('#vehicle_model').val(model);$j('#vehicle_color').val(color);$j('#vehicle_category_type').val(item_category);$j('#vehicle_category_type').val(vehicle_category_type);$j('#vehicle_category_id').val(vehicle_category_id);appendZipcode();}}).trigger('change');if(modal){//TRIGGERS MODAL$j('.auto_packages_button').trigger("click");//TRIGGERS CATEGORY$j('.'+modal+'_trigger').trigger("click");}else if(search_zipcode){$j('#modal-package_search_modal').modal('show');}$j('.navbar-nav li').click( function(){ //*****FOR MENU ITEM CLICK TO SHOW DETAILS. NOT BUILT ON NEW SITE************var rel = $j(this).text();if (rel.toLowerCase().indexOf("packages & prices") >= 0){//TRIGGERS MODAL$j('.auto_packages_button').trigger("click");$j('#package_search_modal').css('z-index','199').show();$j('#vail').css('z-index','198').show();//TRIGGERS CATEGORY$j('.auto_trigger, #auto_trigger').trigger("click");}});//SHOW MODAL BUTTONS$j('[data-id="package_search_modal"]').one().click( function(){if($j(this).hasClass('package_search_modal_existing_order')){ //NOT SURE IF THIS IS ACTUALLY BEING USED OR NOT, THINK USING TRIGGER ON CLASS .package_search_modal_existing_order$j('.data_component_append').remove();if($j(this).data('tmpl')){tmpl = true;tmpl_type = $j(this).data('tmpl_type');var detailing_address_id = $j(this).data('detailing_address_id');$j('#vehicle_search_address_selector').val(detailing_address_id).change();$j('#existing_vehicle_zipcode, .zipcode_append_div').hide();$j('#empty_modal_header').html('Select Detail Service Level From Tabs Below');$j('#empty_modal_body').html('');$j('#vehicle_search_form').append(' ');if($j(this).data('order_id')){$j('#vehicle_search_form').append(' ');};if($j(this).data('order_token')){$j('#vehicle_search_form').append(' ');};if(tmpl_type){$j('#vehicle_search_form').append(' ');}if($j(this).data('order_product_id')){$j('#vehicle_search_form').append(' ');};if($j(this).data('product_id')){$j('#vehicle_search_form').append(' ');};if(tmpl_type == 'add_new_package'){$j('#existing_vehicle_select').trigger('click');}if(tmpl_type == 'edit_package'){if($j(this).data('related_products_only')){$j('#vehicle_search_form').append(' ');if($j(this).data('related_product_ids')){$j('#vehicle_search_form').append(' ');};};var order_product_vehicle_id = $j(this).data('order_product_vehicle_id');var vehicle_found = false;var cart_vehicles = [];if(cart_vehicles){cart_vehicles = $j.parseJSON(cart_vehicles);if(cart_vehicles[order_product_vehicle_id]){vehicle_found = true;}}if(vehicle_found){$j('#modal-empty_modal').modal('show').addClass('hikashop_checkout_loading');$j('#existing_vehicle_select').val(order_product_vehicle_id).change();$j('#existing_vehicle_select').trigger('click');$j('#empty_modal_body').html('');setTimeout(function() {$j('#get_existing_vehicle_price').trigger('click');}, 1);}else{$j('#modal-empty_modal').modal('show');$j('#empty_modal_header').text('Oops! We are sorry this cannot be done online');$j('#empty_modal_body').html('
We are sorry it looks like this vehicle was deleted from your vehicles list. Your package cannot be edited online for this vehicle. Please give us a call to update your detail service at "(800) 601-0626"....
');$j('#empty_submit').hide();}}}}else{tmpl = false;tmpl_type = null;$j('.data_component_append').remove();$j('#existing_vehicle_zipcode, .zipcode_append_div').show();}$j('#modal-package_search_modal').modal('hide'); //FOR SOME REASON IF DONT HIDE AND SHOW, IT CAN BE OFF CENTER$j('#modal-package_search_modal').modal('show'); //FOR SOME REASON IF DONT HIDE AND SHOW, IT CAN BE OFF CENTERvar vehicle_category_type = $j(this).attr('data-type');var existing_vehicles;var has_existing_type = false;if(has_existing_type == true || (!vehicle_category_type && existing_vehicles)){showexistingVehicles(vehicle_category_type);}else{showNewVehicles(vehicle_category_type);}});// CAUSING ERROR ON ZIP VALIDATION.// Define a flag to debounce the onShow event so only triggers once.// var onShowDebounce = false;// // Initialize the modal with the onShow event// $j('#modal-package_search_modal').modal({// onShow: function() { // if (!onShowDebounce) {// onShowDebounce = true;// // Send the custom event to Google Analytics 4// gtag('event', 'package_search_modal_shown', {// 'event_category': 'engagement',// 'event_label': 'Package Search Modal',// 'value': 1// });// setTimeout(function() {// onShowDebounce = false;// }, 500); // Adjust the delay as needed// }// }// });$j('#modal-package_search_modal').on("keydown", function() {if (event.keyCode == 13) {$j('.submit_on_enter').each(function() {if($j(this).is(":visible") && !$j(this).hasClass('next_button_disabled')){$j(this).trigger('click');}});}});//UNIVERALS THUMBNAIL SELECT$j(".select_picture").on("click", function() {var picture_id = $j(this).attr('id');var vehicle_category = $j(this).attr('data-vehicle_category_type');$j("#"+vehicle_category+"_type option[data-picture_id='" + picture_id + "']").prop("selected", true).trigger("change");$j(".select_picture").removeClass('active_select_picture').removeClass('small-input-highlight');$j(this).addClass('active_select_picture');});//UNIVERAL SELECT AUTO TYPE$j(".tab_vehicle_search, .option_select_vehicle_search").on("click change", function() {setCurrentVehicle();var vehicle_type = $j(this).attr('data-vehicle_category_type');var vehicle_category_id = $j('#'+vehicle_type+'_type option:selected').val();//if($j(this).hasClass('tab_vehicle_search')){ //CANT REMEMBER WHY I PUT THIS BUT IT BREAKS CAPABILITY TO ADD DATA FOR NDP_LABEL_VEHICLESif(currentVehiclesObj[''+vehicle_category_id+'']){$j('#input_vehicle_make').val(currentVehiclesObj[''+vehicle_category_id+''].current_vehicle_make);$j('#input_vehicle_model').val(currentVehiclesObj[''+vehicle_category_id+''].current_vehicle_model);$j('#input_vehicle_color').val(currentVehiclesObj[''+vehicle_category_id+''].current_vehicle_color);$j('#input_vehicle_length').val(currentVehiclesObj[''+vehicle_category_id+''].current_vehicle_length);}else if(vehicle_type == loaded_vehicle_category_type && vehicle_category_id == loaded_vehicle_category_id){$j('#input_vehicle_make').val(loaded_vehicle_make);$j('#input_vehicle_model').val(loaded_vehicle_model);$j('#input_vehicle_color').val(loaded_vehicle_color);$j('#input_vehicle_length').val(loaded_vehicle_length);}else if(currentVehiclesObj[''+vehicle_type+'']){ //prevent from filling in and then selecting and erasing.$j('#input_vehicle_make').val(currentVehiclesObj[''+vehicle_type+''].current_vehicle_make);$j('#input_vehicle_model').val(currentVehiclesObj[''+vehicle_type+''].current_vehicle_model);$j('#input_vehicle_color').val(currentVehiclesObj[''+vehicle_type+''].current_vehicle_color);$j('#input_vehicle_length').val(currentVehiclesObj[''+vehicle_type+''].current_vehicle_length);}else{$j('.vehicle_search_input').val('');}//}if(vehicle_category_id == '0'){$j('.option_select_vehicle_type').val('');$j('.back_to_my_vehicles').trigger('click');}$j('.option_select_vehicle_type').removeClass('small-input-highlight');$j(".select_picture").removeClass('active_select_picture').removeClass('small-input-highlight');if(vehicle_type == 'rv' || vehicle_type == 'boat'){$j('.length_div').show();}else{$j('.length_div').hide();}var length_div = $j('#'+vehicle_type+'_type option:selected').data('length_div');if(length_div == true){$j('.length_div').show();}else if(length_div != undefined){$j('.length_div').hide();}var make_div = $j('#'+vehicle_type+'_type option:selected').data('make_div');if(make_div == true || make_div == undefined){$j('.make_div').show();}else{$j('.make_div').hide();}var model_div = $j('#'+vehicle_type+'_type option:selected').data('model_div');if(model_div == true || model_div == undefined){$j('.model_div').show();}else{$j('.model_div').hide();}var color_div = $j('#'+vehicle_type+'_type option:selected').data('color_div');if(color_div == true || color_div == undefined){$j('.color_div').show();}else{$j('.color_div').hide();}var inputs_div_visible = 0;$j('.inputs_div').each(function() {if($j(this).is(':visible')){inputs_div_visible++;}});if(inputs_div_visible == 4){$j('.inputs_div').addClass('hkc-xs-3');$j('.inputs_div').removeClass('hkc-xs-4');}else{$j('.inputs_div').addClass('hkc-xs-4');$j('.inputs_div').removeClass('hkc-xs-3');}var picture_id = $j('#'+vehicle_type+'_type option:selected').data('picture_id');$j('#'+picture_id).addClass('active_select_picture');var categories = $j('#'+vehicle_type+'_type option:selected').val();var body_style = $j('#'+vehicle_type+'_type option:selected').html();$j('#vehicle_category_id').val(categories);$j('#vehicle_category_type').val(vehicle_type);$j('#vehicle_length').val($j('#input_vehicle_length').val());$j('#vehicle_make').val($j('#input_vehicle_make').val());$j('#vehicle_model').val($j('#input_vehicle_model').val());$j('#vehicle_color').val($j('#input_vehicle_color').val());appendZipcode();var tabs = ['auto','rv','boat','industrial','atv'];if(jQuery.inArray(vehicle_category_id, tabs) !== -1){$j('#'+vehicle_type+'_vehicle_type').val('');$j('.'+vehicle_category_id+'_trigger').trigger('click');}}).trigger("change");//UNIVERSAL SELECT LENGTH$j('.option_select_length').change(function() {$j('#vehicle_length').val($j(this).val());$j(this).removeClass('small-input-highlight');});//UNIVERSAL MAKE/MODEL/COLOR$j('.make_model_color_input').change(function() {var inputType = $j(this).attr('data-input_type');$j('#vehicle_'+inputType).val($j(this).val());});//MAKE MODEL INPUT$j("#modal-package_search_modal :input").change(function() {$j(this).removeClass('small-input-highlight');});$j.validator.methods.validZip = function (value, element, param) {if($j(element).hasClass('valid_zipcode')){return true;}else{return false;}}//moved to on show function in js file.//window.validateZipcode('#vehicle_zipcode_form', '', '.get_price_submit_button', 'vehicle_search', false, true, false, true);var vehicleSearchFormValidator = $j(document).find('#vehicle_search_form').validate({ignore: ":hidden",rules: {'vehicle_search[vehicle_zipcode]': {required: true,minlength: 5,maxlength: 5,validZip: true,},},messages: {'vehicle_search[vehicle_zipcode]': {required: "Please enter a valid zipcode.",minlength: 'Please enter a valid zipcode minimum length of 5 characters.',maxlength: 'Please enter a valid zipcode maximum length of 5 characters.',validZip: 'Please enter a valid zipcode to proceed.',},},errorPlacement: function (error, element) {$j('#modal-package_search_modal, #modal-empty_modal').removeClass('hikashop_checkout_loading');},submitHandler: function (form) {var submitBool = window.submitVehicleSearchForm();return submitBool;},});window.submitVehicleSearchForm = function submitVehicleSearchForm(){//UNIVERSAL SUBMIT BUTTONif(event){event.preventDefault();}var fields = [];var vehicle_type = $j(this).attr('data-vehicle_category_type');if(!vehicle_type){vehicle_type = $j('#existing_vehicle_select option:selected').attr('data-vehicle_category_type');}$j('#vehicle_search_form :input').each(function() {var title = $j(this).attr('title');var id = $j(this).attr('id');if($j(this).is(":visible")){if(fieldEmpty($j(this).val())){var title = $j(this).attr('title');if(title == ''){title = $j(this).data('original-title');}if(title){fields.push(title);$j(this).addClass('small-input-highlight');if (title.toLowerCase().indexOf("type") >= 0){$j('.'+vehicle_type+'_select_picture').addClass('small-input-highlight');}}}}else if($j(this).attr('id') == 'vehicle_color'){ //CHOSENif(fieldEmpty($j(this).val())){var title = $j(this).attr('title');if(title == ''){title = $j(this).data('original-title');}if(title){fields.push(title);$j('#'+id+'_chzn').addClass('small-input-highlight');$j('#'+id+'_chzn').click( function(){$j(this).removeClass('small-input-highlight');});}}}});if(!$j('#input_vehicle_length').is(":visible")){$j(this).val('');};if(fields.length){alert('Please Select '+fields.join(', ')+'.');//.one(); //bla}else{$j('#modal-package_search_modal').addClass('hikashop_checkout_loading');if(tmpl == true){$j('#modal-empty_modal').modal('show').addClass('hikashop_checkout_loading');$j('#modal-empty_modal .modal-footer').hide();$j('#modal-package_search_modal').modal('hide'); //THINK THIS MIGHT BE USED ON CHANGE PACKAGE PAGE, MOVED FROM ABOVE$j.post($j('#vehicle_search_form').attr('action'),$j('#vehicle_search_form').serialize(),).done(function(data) {$j('#empty_modal_body').html(data);$j('#empty_modal_body').find('.hidden_tmpl').hide();$j('#modal-package_search_modal').removeClass('hikashop_checkout_loading');if(tmpl_type == 'add_new_package'){$j('#listing_div_package_search_modal').show().text('Change Vehicle');$j('#empty_modal_header').html('Select Detail Service Level From Tabs Below');$j('.add_to_cart').html(' Add This Detail');$j('.add_to_cart_additional_data').html('
Add this detail to increase your multi-vehicle discount
');}else if(tmpl_type == 'edit_package'){var product_id = $j('#product_id').val();var related_products_only = $j('#related_products_only').val();var related_product_ids = $j('#related_product_ids').val();$j('#modal-empty_modal [data-id="package_search_modal"]').hide();if(related_products_only){if(related_product_ids){related_product_ids = related_product_ids.split(",");}$j('#empty_modal_header').html('Add a Services Below');$j('.add_to_cart').html('Add This Service ');$j.each(related_product_ids, function (key, product_id) {$j('#add_to_cart_'+product_id).html('Service Added ').removeClass('add_to_cart').css('background-color','#F39C12').attr('onClick','alert("This is service is already added."); return false;');$j('#add_to_cart_'+product_id).parents('.hikashop_product_block').addClass('small-input-highlight-orange');});}else{$j('#empty_modal_header').html('Select Detail Service Level From Tabs Below');$j('.add_to_cart').html('Change to This Package ');$j('#add_to_cart_'+product_id).html('Current Package ').removeClass('add_to_cart').css('background-color','#F39C12').attr('onClick','alert("This is already your selected package."); return false;');$j('#add_to_cart_'+product_id).parents('.hikashop_product_block').addClass('small-input-highlight-orange');}}setTimeout(function() {$j('#modal-empty_modal').modal('refresh'); //ADD hkc-xs-12 SO CHECKOUT LOADING DISPLAYS PR$j('#modal-empty_modal').removeClass('hikashop_checkout_loading');setTimeout(function() {$j('#modal-empty_modal').addClass('hkc-xs-12'); //HAVE TO DO AFTER REFRESH HAPPENS AND TIMEOUT}, 500);}, 1);$j('.add_to_cart').click(function() {$j('#modal-empty_modal').addClass('reload_on_close');});$j('#modal-empty_modal [data-id="package_search_modal"]').click(function() {setTimeout(function() {$j('#modal-package_search_modal').modal('refresh');}, 500);});}).error(function() { alert('An error has occurred.');});}else{if($j(this).hasClass('save_new_vehicle_submit_button')){var modal_name = "package_item_info";var form = $j('#vehicle_search_form')[0];var data = new FormData(form);var form_data = $j('.r-modal').find('#'+modal_name+'_form').serializeArray();$j.each(form_data, function (key, input) {data.append(input.name, input.value);});$j.ajax({type: "POST",enctype: 'multipart/form-data',url: "/index.php/detailing-packages/tmpl-component",data: data,processData: false,contentType: false,cache: false,timeout: 600000,success: function (data) {$j('#modal-package_search_modal').removeClass('hikashop_checkout_loading');$j('#modal-package_search_modal').modal('hide');window.vehicleMgr.refresh();},error: function (e) {console.log("ERROR : ", e);$j('#modal-package_search_modal').removeClass('hikashop_checkout_loading');}});}else{//$j('#vehicle_search_form').submit();return true;}}}}$j('#modal-package_search_modal').on('click', ".get_price_submit_button", function() {//FOR SOME REASON WONT VALIDATE ON SHOW PG IF DONT REINSTANTIATE VALIDATOR AFTER SEARCHING FOR NEW PKG FOR ORDER IN IFRAME, SO HAVING TO DUPLICATE VALIDATOR$j(document).find('#vehicle_search_form').validate({ignore: ":hidden",rules: {'vehicle_search[vehicle_zipcode]': {required: true,minlength: 5,maxlength: 5,validZip: true,},},messages: {'vehicle_search[vehicle_zipcode]': {required: "Please enter a valid zipcode.",minlength: 'Please enter a valid zipcode minimum length of 5 characters.',maxlength: 'Please enter a valid zipcode maximum length of 5 characters.',validZip: 'Please enter a valid zipcode to proceed.',},},errorPlacement: function (error, element) {$j('#modal-package_search_modal, #modal-empty_modal').removeClass('hikashop_checkout_loading');},submitHandler: function (form) {var submitBool = window.submitVehicleSearchForm();return submitBool;},});$j(document).find('#vehicle_search_form').submit();});//BOAT JQUERY//$j('#boat_length_select').change( function(){if(!$j('#boat_select_picture_176').hasClass('active_select_picture')){if(!$j('#boat_select_picture_229').hasClass('active_select_picture')){if($j(this).val() > 35){$j('#boat_type_select').val(248); //new xl category$j('#boat_select_picture_176').trigger('click');alert("You have been redirected to the XL boat category for boats larger than 36 Ft.");}}}});$j('#boat_type').change( function(){var boat_type_xl_category = $j('#boat_type option:selected').text();if((boat_type_xl_category != 'XL Boats (36+ Ft.)' && boat_type_xl_category != 'House Boats' ) && $j('#boat_length_select').val() > 35){$j('#boat_length_select').val('');}});$j("#vehicle_search_address_selector").change(function() {$j('.zipcode_api_append').remove();if($j(this).val() == 0){$j('.zipcode_api_append').remove();$j('#existing_post_code').hide();$j('#new_post_code').show();$j("#vehicle_search_vehicle_zip").val(vehicle_zipcode).trigger('keyup');}else{$j("#vehicle_search_vehicle_zip").val($j(this).find('option:selected').attr('data-address_post_code')).trigger('keyup');}}).trigger('change');$j("#new_post_code_undo").click(function() {$j("#vehicle_search_address_selector").prop("selectedIndex", 0);$j('#existing_post_code').show();$j('#new_post_code').hide();$j('.zipcode_api_append').remove();$j("#vehicle_search_address_selector").trigger('change');});//MAIN MENU TRIGGER$j('.item-16601').click(function() {event.preventDefault();$j('#package_search_modal_trigger').trigger('click');$j('.r-nav-menu').removeClass('r-nav-menu-active');$j('.r-nav-menu-overlay').removeClass('r-nav-menu-active');});});