





window.dataLayer = window.dataLayer || []; dataLayer.push({ 'event' : 'FormSubmission', 'event_category' : 'New Vehicle Enquiry' })
if ( $('#basket_vehicle_type').length != 0) { if ( $('#isNew').length != 0) { $('#basket-new-enquiry').show(); } } jQuery('#bfb-popup-openbfb31').on('click', function () { if ($('#new_car_location select[name=location]').length != 0) { let vehicle_type = 'Car'; if (location.pathname.includes('/vans/')) { vehicle_type = 'Van'; } if ($('#vehicle_type .ppbd-product-attribute').length != 0) { vehicle_type = $('#vehicle_type .ppbd-product-attribute').html().trim(); } if ($('#basket_vehicle_type').length != 0) { vehicle_type = $('#basket_vehicle_type').val(); } if ($('#cap_database').length != 0) { vehicle_type = $('#cap_database').val(); } let lead_type = 'NWV'; if (vehicle_type.toLowerCase() == 'car') { lead_type = 'NWC'; } let product_name_lc = ''; let product_name = ''; let product_sku = ''; if ( $('#product_name .ppbd-product-attribute').length != 0 ) { product_name_lc = $('#product_name .ppbd-product-attribute').html().trim().toLowerCase(); product_name = $('#product_name .ppbd-product-attribute').html().trim(); product_sku = $('#product_sku .ppbd-product-attribute').html().trim(); } else if ( $('h3.product-item-name a').length != 0 ) { product_name_lc = $('h3.product-item-name a').html().trim().toLowerCase(); product_name = $('h3.product-item-name a').html().trim(); product_sku = $('#product_sku').val().trim(); } else if ( $('#vehicle_price_summary .name').length != 0 ) { product_name_lc = $('#vehicle_price_summary .name').html().replace('
',' ').trim().toLowerCase(); product_name = $('#vehicle_price_summary .name').html().replace('
',' ').trim(); product_sku = $('#sku').val().trim(); } else if ( $('#firstmake').length != 0 ) { product_name_lc = $('#firstmake').val().trim().toLowerCase(); product_name = $('#firstmake').val().trim(); product_sku = ''; } else if ( $('.category-description h1').length != 0 ) { product_name_lc = $('.category-description h1').html().replace(/new/gi, '').trim().toLowerCase(); product_name = $('.category-description h1').html().replace(/new/gi, '').trim(); product_sku = ''; } if (product_name_lc != '') { console.log(product_name_lc); if (product_sku != '') { product_sku = ' (' + product_sku + ')'; } $('#new_car_model input[name=model]').val(product_name + product_sku); if (product_name_lc.startsWith("seat ")) { $('#new_car_location select[name=location]').html(''); } if (product_name_lc.startsWith("cupra ")) { $('#new_car_location select[name=location]').html(''); } if (product_name_lc.startsWith("skoda ")) { $('#new_car_location select[name=location]').html(''); } if (product_name_lc.startsWith("honda ")) { $('#new_car_location select[name=location]').html(''); } if (product_name_lc.startsWith("ford ")) { if ( jQuery('#vehicle_type .ppbd-product-attribute').text().trim() == 'Vans' || jQuery('#basket_vehicle_type').val() == 'Vans') { $('#new_car_location select[name=location]').html(''); } else { $('#new_car_location select[name=location]').html(''); } } if (product_name_lc.startsWith("kia ")) { $('#new_car_location select[name=location]').html(''); } if (product_name_lc.startsWith("byd")) { $('#new_car_location select[name=location]').html(''); } } $("#new_car_location select[name=location] option").each(function() { if ( $( this ).text() == $('#selectedDealer').val() || $( this ).text() == $('#nearest_dealer').val()) { $(this).attr('selected','selected'); } }); } });
',' ').trim().toLowerCase(); product_name = $('#vehicle_price_summary .name').html().replace('
',' ').trim(); product_sku = $('#sku').val().trim(); } else if ( $('#firstmake').length != 0 ) { product_name_lc = $('#firstmake').val().trim().toLowerCase(); product_name = $('#firstmake').val().trim(); product_sku = ''; } else if ( $('.category-description h1').length != 0 ) { product_name_lc = $('.category-description h1').html().replace(/new/gi, '').trim().toLowerCase(); product_name = $('.category-description h1').html().replace(/new/gi, '').trim(); product_sku = ''; } if (product_name_lc != '') { console.log(product_name_lc); if (product_sku != '') { product_sku = ' (' + product_sku + ')'; } $('#new_car_model input[name=model]').val(product_name + product_sku); if (product_name_lc.startsWith("seat ")) { $('#new_car_location select[name=location]').html(''); } if (product_name_lc.startsWith("cupra ")) { $('#new_car_location select[name=location]').html(''); } if (product_name_lc.startsWith("skoda ")) { $('#new_car_location select[name=location]').html(''); } if (product_name_lc.startsWith("honda ")) { $('#new_car_location select[name=location]').html(''); } if (product_name_lc.startsWith("ford ")) { if ( jQuery('#vehicle_type .ppbd-product-attribute').text().trim() == 'Vans' || jQuery('#basket_vehicle_type').val() == 'Vans') { $('#new_car_location select[name=location]').html(''); } else { $('#new_car_location select[name=location]').html(''); } } if (product_name_lc.startsWith("kia ")) { $('#new_car_location select[name=location]').html(''); } if (product_name_lc.startsWith("byd")) { $('#new_car_location select[name=location]').html(''); } } $("#new_car_location select[name=location] option").each(function() { if ( $( this ).text() == $('#selectedDealer').val() || $( this ).text() == $('#nearest_dealer').val()) { $(this).attr('selected','selected'); } }); } });
window.dataLayer = window.dataLayer || []; dataLayer.push({ 'event' : 'FormSubmission', 'event_category' : 'Ford Car New Vehicle Enquiry' })
window.dataLayer = window.dataLayer || []; dataLayer.push({ 'event' : 'FormSubmission', 'event_category' : 'New Vehicle Enquiry' })
jQuery('#bfb-popup-openbfb3').on('click', function () { if ($('#new_car_location select[name=location]').length != 0) { let vehicle_type = 'Car'; if (location.pathname.includes('/vans/')) { vehicle_type = 'Van'; } if ($('#vehicle_type .ppbd-product-attribute').length != 0) { vehicle_type = $('#vehicle_type .ppbd-product-attribute').html().trim(); } let lead_type = 'NWV'; if (vehicle_type == 'Car') { lead_type = 'NWC'; } if ($('#product_name .ppbd-product-attribute').length != 0) { let product_name = $('#product_name .ppbd-product-attribute').html().trim().toLowerCase(); if (product_name.startsWith("ford ")) { $('#new_car_location select[name=location]').html(''); } if (product_name.startsWith("kia ")) { $('#new_car_location select[name=location]').html(''); } } if ($('#vehicle_type .ppbd-product-attribute').length != 0) { } } if ($('#product_name .ppbd-product-attribute').length != 0) { let product_name = $('#product_name .ppbd-product-attribute').html().trim(); let product_sku = $('#product_sku .ppbd-product-attribute').html().trim(); $('#new_car_model input[name=model]').val(product_name + ' (' + product_sku + ')'); } });
window.dataLayer = window.dataLayer || []; dataLayer.push({ 'event' : 'FormSubmission', 'event_category' : 'New Vehicle Enquiry' })
if ( $('#basket_vehicle_type').length != 0) { if ( $('#isNew').length != 0) { $('#basket-new-enquiry').show(); } } jQuery('#bfb-popup-openbfb31').on('click', function () { if ($('#new_car_location select[name=location]').length != 0) { let vehicle_type = 'Car'; if (location.pathname.includes('/vans/')) { vehicle_type = 'Van'; } if ($('#vehicle_type .ppbd-product-attribute').length != 0) { vehicle_type = $('#vehicle_type .ppbd-product-attribute').html().trim(); } if ($('#basket_vehicle_type').length != 0) { vehicle_type = $('#basket_vehicle_type').val(); } if ($('#cap_database').length != 0) { vehicle_type = $('#cap_database').val(); } let lead_type = 'NWV'; if (vehicle_type.toLowerCase() == 'car') { lead_type = 'NWC'; } let product_name_lc = ''; let product_name = ''; let product_sku = ''; if ( $('#product_name .ppbd-product-attribute').length != 0 ) { product_name_lc = $('#product_name .ppbd-product-attribute').html().trim().toLowerCase(); product_name = $('#product_name .ppbd-product-attribute').html().trim(); product_sku = $('#product_sku .ppbd-product-attribute').html().trim(); } else if ( $('h3.product-item-name a').length != 0 ) { product_name_lc = $('h3.product-item-name a').html().trim().toLowerCase(); product_name = $('h3.product-item-name a').html().trim(); product_sku = $('#product_sku').val().trim(); } else if ( $('#vehicle_price_summary .name').length != 0 ) { product_name_lc = $('#vehicle_price_summary .name').html().replace('
',' ').trim().toLowerCase(); product_name = $('#vehicle_price_summary .name').html().replace('
',' ').trim(); product_sku = $('#sku').val().trim(); } else if ( $('#firstmake').length != 0 ) { product_name_lc = $('#firstmake').val().trim().toLowerCase(); product_name = $('#firstmake').val().trim(); product_sku = ''; } else if ( $('.category-description h1').length != 0 ) { product_name_lc = $('.category-description h1').html().replace(/new/gi, '').trim().toLowerCase(); product_name = $('.category-description h1').html().replace(/new/gi, '').trim(); product_sku = ''; } if (product_name_lc != '') { console.log(product_name_lc); if (product_sku != '') { product_sku = ' (' + product_sku + ')'; } $('#new_car_model input[name=model]').val(product_name + product_sku); if (product_name_lc.startsWith("seat ")) { $('#new_car_location select[name=location]').html(''); } if (product_name_lc.startsWith("cupra ")) { $('#new_car_location select[name=location]').html(''); } if (product_name_lc.startsWith("skoda ")) { $('#new_car_location select[name=location]').html(''); } if (product_name_lc.startsWith("honda ")) { $('#new_car_location select[name=location]').html(''); } if (product_name_lc.startsWith("ford ")) { if ( jQuery('#vehicle_type .ppbd-product-attribute').text().trim() == 'Vans' || jQuery('#basket_vehicle_type').val() == 'Vans') { $('#new_car_location select[name=location]').html(''); } else { $('#new_car_location select[name=location]').html(''); } } if (product_name_lc.startsWith("kia ")) { $('#new_car_location select[name=location]').html(''); } if (product_name_lc.startsWith("byd")) { $('#new_car_location select[name=location]').html(''); } } $("#new_car_location select[name=location] option").each(function() { if ( $( this ).text() == $('#selectedDealer').val() || $( this ).text() == $('#nearest_dealer').val()) { $(this).attr('selected','selected'); } }); } });
',' ').trim().toLowerCase(); product_name = $('#vehicle_price_summary .name').html().replace('
',' ').trim(); product_sku = $('#sku').val().trim(); } else if ( $('#firstmake').length != 0 ) { product_name_lc = $('#firstmake').val().trim().toLowerCase(); product_name = $('#firstmake').val().trim(); product_sku = ''; } else if ( $('.category-description h1').length != 0 ) { product_name_lc = $('.category-description h1').html().replace(/new/gi, '').trim().toLowerCase(); product_name = $('.category-description h1').html().replace(/new/gi, '').trim(); product_sku = ''; } if (product_name_lc != '') { console.log(product_name_lc); if (product_sku != '') { product_sku = ' (' + product_sku + ')'; } $('#new_car_model input[name=model]').val(product_name + product_sku); if (product_name_lc.startsWith("seat ")) { $('#new_car_location select[name=location]').html(''); } if (product_name_lc.startsWith("cupra ")) { $('#new_car_location select[name=location]').html(''); } if (product_name_lc.startsWith("skoda ")) { $('#new_car_location select[name=location]').html(''); } if (product_name_lc.startsWith("honda ")) { $('#new_car_location select[name=location]').html(''); } if (product_name_lc.startsWith("ford ")) { if ( jQuery('#vehicle_type .ppbd-product-attribute').text().trim() == 'Vans' || jQuery('#basket_vehicle_type').val() == 'Vans') { $('#new_car_location select[name=location]').html(''); } else { $('#new_car_location select[name=location]').html(''); } } if (product_name_lc.startsWith("kia ")) { $('#new_car_location select[name=location]').html(''); } if (product_name_lc.startsWith("byd")) { $('#new_car_location select[name=location]').html(''); } } $("#new_car_location select[name=location] option").each(function() { if ( $( this ).text() == $('#selectedDealer').val() || $( this ).text() == $('#nearest_dealer').val()) { $(this).attr('selected','selected'); } }); } });