<?php
  $options = get_option($this->plugin_name);
  $cars = get_option('eurostocks_cars');
  $makes = get_option('eurostocks_makes');

  foreach ($accepted_langs as $lang) {
    if (!isset($options[esc_html($lang)])) {
      $options[esc_html($lang)] = array();
    }
  }

  // API settings
  if (!isset($options['username'])) {
    $euro_username = '';
  } else {
    $euro_username = $options['username'];
  }
  if (!isset($options['password'])) {
    $euro_password = "";
  } else {
    $euro_password = $options['password'];
  }
  if (!isset($options['api_key'])) {
    $euro_api_key = "";
  } else {
    $euro_api_key = $options['api_key'];
  }

  // SHORTCODES (translatable)
  if (!isset($options['details_page'])) {
    $details_page = '';
  } else {
    $details_page = $options['details_page'];
  }

  if (!isset($options['filters_page'])) {
    $filters_page = '';
  } else {
    $filters_page = $options['filters_page'];
  }

  foreach ($accepted_langs as $lang) {
   
    
    if (!isset($options[esc_html($lang)]['details_page'])) {
      $details_page_e[esc_html($lang)] = '';
    } else {
      $details_page_e[esc_html($lang)] = $options[esc_html($lang)]['details_page'];
    }

    if (!isset($options[esc_html($lang)]['filters_page'])) {
      $filters_page_e[esc_html($lang)] = '';
    } else {
      $filters_page_e[esc_html($lang)] = $options[esc_html($lang)]['filters_page'];
    }
  }


  // OPTIONS

  // FILTERS, CONFIGURATION, SETTINGS

  // iframe
  if (!isset($options['use_as_iframe'])) {
    $use_as_iframe = 0;
  } else {
    $use_as_iframe = $options['use_as_iframe'];
  }

  // grid or list
  if (!isset($options['griddisplay']) || $options['griddisplay'] != 1) {
    $griddisplay = 0;
  } else {
    $griddisplay = $options['griddisplay'];
  }

  // price for country
  if (!isset($options['country'])) {
    $country = 'nl';
  } else {
    $country = $options['country'];
  }

  // only show cars with
  if (!isset($options['feature_warranty'])) {
    $feature_warranty = 0;
  } else {
    $feature_warranty = $options['feature_warranty'];
  }

  if (!isset($options['maintenance_history']) || $options['maintenance_history'] != 1) {
    $maintenance_history = 0;
  } else {
    $maintenance_history = $options['maintenance_history'];
  }

  if (!isset($options['max_prev_owners']) || $options['max_prev_owners'] != 1) {
    $max_prev_owners = 0;
  } else {
    $max_prev_owners = $options['max_prev_owners'];
  }

  if (!isset($options['no_damage_history']) || $options['no_damage_history'] != 1) {
    $no_damage_history = 0;
  } else {
    $no_damage_history = $options['no_damage_history'];
  }

  if (!isset($options['dealers'])) {
    $dealers = '';
  } else {
    $dealers = $options['dealers'];
  }

  if (!isset($options['max_kmstand']) || $options['max_kmstand'] == '') {
    $max_kmstand = '125000';
  } else {
    $max_kmstand = $options['max_kmstand'];
  }

  if (!isset($options['min_bouwjaar']) || $options['min_bouwjaar'] == '') {
    $min_bouwjaar = 2015;
  } else {
    $min_bouwjaar = $options['min_bouwjaar'];
  }


  // page blocks
  if (!isset($options['show_nav']) || $options['show_nav'] != 1) {
    $show_nav = 0;
  } else {
    $show_nav = $options['show_nav'];
  }

  if(!isset($options['show_options_sep']) || $options['show_options_sep'] != 1) {
    $show_options_sep = 0;
  } else {
    $show_options_sep = $options['show_options_sep'];
  }

  if(!isset($options['show_cta_cf']) || $options['show_cta_cf'] != 1) {
    $show_cta_cf = 0;
  } else {
    $show_cta_cf = $options['show_cta_cf'];
  }

  if(!isset($options['show_cta_app']) || $options['show_cta_app'] != 1) {
    $show_cta_app = 0;
  } else {
    $show_cta_app = $options['show_cta_app'];
  }

  if(!isset($options['show_cta_tel']) || $options['show_cta_tel'] != 1) {
    $show_cta_tel = 0;
  } else {
    $show_cta_tel = $options['show_cta_tel'];
  }

  if(!isset($options['show_cta_fav']) || $options['show_cta_fav'] != 1) {
    $show_cta_fav = 0;
  } else {
    $show_cta_fav = $options['show_cta_fav'];
  }





  $default_cta_order = $this->eurostocks_get_available_ctas();


  if(!isset($options['cta_order'])) {
    $cta_order = array_keys($default_cta_order);
  } else {
    if (is_string($options['cta_order'])) {
      $cta_order = explode(',', $options['cta_order']);
    } else {
        $cta_order = $options['cta_order'];
    }
  }



  $ordered_ctas = array_filter($cta_order, fn($key) => isset($default_cta_order[$key]));
  // Add any new CTAs not in saved order
  foreach ($default_cta_order as $key => $label) {
      if (!in_array($key, $ordered_ctas)) {
          $ordered_ctas[] = $key;
      }
  }


  if (!isset($options['hide_experts']) || $options['hide_experts'] != 1) {
    $hide_experts = 0;
  } else {
    $hide_experts = $options['hide_experts'];
  }

  if (!isset($options['hide_reviews']) || $options['hide_reviews'] != 1) {
    $hide_reviews = 0;
  } else {
    $hide_reviews = $options['hide_reviews'];
  }

  if (!isset($options['hide_kosten_left'])) {
    $hide_kosten_left = 0;
  } else {
    $hide_kosten_left = $options['hide_kosten_left'];
  }

  if (!isset($options['hide_kosten_right']) || $options['hide_kosten_right'] != 1) {
    $hide_kosten_right = 0;
  } else {
    $hide_kosten_right = $options['hide_kosten_right'];
  }

  if (!isset($options['enable_pdf'])) {
    $enable_pdf = 0;
  } else {
    $enable_pdf = $options['enable_pdf'];
  }


  // powered by
  if (!isset($options['show_powered_by'])) {
    $show_powered_by = 0;
  } else {
    $show_powered_by = $options['show_powered_by'];
  }

  // expanded filters

  if (!isset($options['expand_filters']) || $options['expand_filters'] != 1) {
    $expand_filters = 0;
  } else {
    $expand_filters = $options['expand_filters'];
  }

  // hide filters

  if (!isset($options['hide_mileage']) || $options['hide_mileage'] != 1) {
    $hide_mileage = 0;
  } else {
    $hide_mileage = $options['hide_mileage'];
  }

  if (!isset($options['hide_power']) || $options['hide_power'] != 1) {
    $hide_power = 0;
  } else {
    $hide_power = $options['hide_power'];
  }

  if (!isset($options['hide_drive_type']) || $options['hide_drive_type'] != 1) {
    $hide_drive_type = 0;
  } else {
    $hide_drive_type = $options['hide_drive_type'];
  }

  if (!isset($options['hide_seats']) || $options['hide_seats'] != 1) {
    $hide_seats = 0;
  } else {
    $hide_seats = $options['hide_seats'];
  }

  if (!isset($options['hide_filter_parking']) || $options['hide_filter_parking'] != 1) {
    $hide_filter_parking = 0;
  } else {
    $hide_filter_parking = $options['hide_filter_parking'];
  }

  if (!isset($options['hide_filter_options']) || $options['hide_filter_options'] != 1) {
    $hide_filter_options = 0;
  } else {
    $hide_filter_options = $options['hide_filter_options'];
  }

  if (!isset($options['hide_year']) || $options['hide_year'] != 1) {
    $hide_year = 0;
  } else {
    $hide_year = $options['hide_year'];
  }

  if (!isset($options['hide_price']) || $options['hide_price'] != 1) {
    $hide_price = 0;
  } else {
    $hide_price = $options['hide_price'];
  }

  if (!isset($options['hide_fuel_type']) || $options['hide_fuel_type'] != 1) {
    $hide_fuel_type = 0;
  } else {
    $hide_fuel_type = $options['hide_fuel_type'];
  }

  if (!isset($options['hide_transmission']) || $options['hide_transmission'] != 1) {
    $hide_transmission = 0;
  } else {
    $hide_transmission = $options['hide_transmission'];
  }

  if (!isset($options['hide_speed_control']) || $options['hide_speed_control'] != 1) {
    $hide_speed_control = 0;
  } else {
    $hide_speed_control = $options['hide_speed_control'];
  }
  if (!isset($options['hide_interior_type']) || $options['hide_interior_type'] != 1) {
    $hide_interior_type = 0;
  } else {
    $hide_interior_type = $options['hide_interior_type'];
  }


  if (!isset($options['hide_climatisation']) || $options['hide_climatisation'] != 1) {
    $hide_climatisation = 0;
  } else {
    $hide_climatisation = $options['hide_climatisation'];
  }

  if (!isset($options['hide_exterior_color']) || $options['hide_exterior_color'] != 1) {
    $hide_exterior_color = 0;
  } else {
    $hide_exterior_color = $options['hide_exterior_color'];
  }

  if (!isset($options['hide_headlight_type']) || $options['hide_headlight_type'] != 1) {
    $hide_headlight_type = 0;
  } else {
    $hide_headlight_type = $options['hide_headlight_type'];
  }

  if (!isset($options['hide_door_count']) || $options['hide_door_count'] != 1) {
    $hide_door_count = 0;
  } else {
    $hide_door_count = $options['hide_door_count'];
  }

  if (!isset($options['hide_vat']) || $options['hide_vat'] != 1) {
    $hide_vat = 0;
  } else {
    $hide_vat = $options['hide_vat'];
  }

  if (!isset($options['hide_category']) || $options['hide_category'] != 1) {
    $hide_category = 0;
  } else {
    $hide_category = $options['hide_category'];
  }

  if (!isset($options['co2_disclaimer_display']) || $options['co2_disclaimer_display'] == 1) {
    $co2_disclaimer_display = 1;
  } else {
    $co2_disclaimer_display = $options['co2_disclaimer_display'];
  }

  if (!isset($options['co2_fallback_display']) || $options['co2_fallback_display'] == 1) {
    $co2_fallback_display = 1;
  } else {
    $co2_fallback_display = $options['co2_fallback_display'];
  }

  // sort options

  if (!isset($options['hide_sort']) || $options['hide_sort'] != 1) {
    $hide_sort = 0;
  } else {
    $hide_sort = $options['hide_sort'];
  }

  if (!isset($options['hide_sort_price']) || $options['hide_sort_price'] != 1) {
    $hide_sort_price = 0;
  } else {
    $hide_sort_price = $options['hide_sort_price'];
  }

  if (!isset($options['hide_sort_creation']) || $options['hide_sort_creation'] != 1) {
    $hide_sort_creation = 0;
  } else {
    $hide_sort_creation = $options['hide_sort_creation'];
  }

  if (!isset($options['hide_sort_mileage']) || $options['hide_sort_mileage'] != 1) {
    $hide_sort_mileage = 0;
  } else {
    $hide_sort_mileage = $options['hide_sort_mileage'];
  }

  if (!isset($options['hide_sort_registration']) || $options['hide_sort_registration'] != 1) {
    $hide_sort_registration = 0;
  } else {
    $hide_sort_registration = $options['hide_sort_registration'];
  }

  if (!isset($options['default_sort'])) {
    $default_sort = 'creationDesc';
  } else {
    $default_sort = $options['default_sort'];
  }

  // CONTENT

  // Search and filter page

  if (!isset($options['txt_srch'])) {
    $txt_srch = __('Import your new car from Germany?', 'eurostocks');
  } else {
    $txt_srch = $options['txt_srch'];
  }

  foreach ($accepted_langs as $lang) {
    if($lang == 'nl'){
      $locale_lang = 'nl_NL';
    }elseif($lang == 'de'){
      $locale_lang = 'de_DE';
    }elseif($lang == 'fr'){
      $locale_lang = 'fr_FR';
    }elseif($lang == 'es'){
      $locale_lang = 'es_ES';
    }else{
      $locale_lang = 'en_US';
    }
    switch_to_locale($locale_lang);
    if (!isset($options[esc_html($lang)]['txt_srch'])) {
      $txt_srch_e[esc_html($lang)] = '';
    } else {
      $txt_srch_e[esc_html($lang)] = $options[esc_html($lang)]['txt_srch'];
    }
    restore_previous_locale();
  }


  // search page

  if (!isset($options['txt_srch_btn'])) {
    $txt_srch_btn = __('Search', 'eurostocks');
  } else {
    $txt_srch_btn = $options['txt_srch_btn'];
  }

  foreach ($accepted_langs as $lang) {
    if($lang == 'nl'){
      $locale_lang = 'nl_NL';
    }elseif($lang == 'de'){
      $locale_lang = 'de_DE';
    }elseif($lang == 'fr'){
      $locale_lang = 'fr_FR';
    }elseif($lang == 'es'){
      $locale_lang = 'es_ES';
    }else{
      $locale_lang = 'en_US';
    }
    switch_to_locale($locale_lang);
    if (!isset($options[esc_html($lang)]['txt_srch_btn'])) {
      $txt_srch_btn_e[esc_html($lang)] = '';
    } else {
      $txt_srch_btn_e[esc_html($lang)] = $options[esc_html($lang)]['txt_srch_btn'];
    }
    restore_previous_locale();
  }

  // filters page

  if (!isset($options['fav_opt_title'])) {
    $fav_opt_title = __('Most chosen options', 'eurostocks');
  } else {
    $fav_opt_title = $options['fav_opt_title'];
  }

  if (!isset($options['nonfav_opt_title'])) {
    $nonfav_opt_title = __('Other options', 'eurostocks');
  } else {
    $nonfav_opt_title = $options['nonfav_opt_title'];
  }

  if (!isset($options['txt_search_title'])) {
    $txt_search_title = __('{aantal} {merk} {model} occasions found', 'eurostocks');
  } else {
    $txt_search_title = $options['txt_search_title'];
  }

  if (!isset($options['txt_make'])) {
    $txt_make = __('Make', 'eurostocks');
  } else {
    $txt_make = $options['txt_make'];
  }

  if (!isset($options['txt_priceonrequest'])) {
    $txt_priceonrequest = __('Price on request', 'eurostocks');
  } else {
    $txt_priceonrequest = $options['txt_priceonrequest'];
  }

  if (!isset($options['txt_model'])) {
    $txt_model = __('Model', 'eurostocks');
  } else {
    $txt_model = $options['txt_model'];
  }

  if (!isset($options['txt_select_make'])) {
    $txt_select_make = __('Select make', 'eurostocks');
  } else {
    $txt_select_make = $options['txt_select_make'];
  }

  if (!isset($options['txt_select_model'])) {
    $txt_select_model = __('Select model', 'eurostocks');
  } else {
    $txt_select_model = $options['txt_select_model'];
  }

  if (!isset($options['txt_search'])) {
    $txt_search = __('The sales price shown is only an indication. Why can this price differ in some cases?', 'eurostocks');
  } else {
    $txt_search = $options['txt_search'];
  }

  if (!isset($options['txt_search_help'])) {
    $txt_search_help = __('There are different ways in which you can pay BPM. Via the fixed table, with the help of price lists or with a valuation report. [COMPANY NAME] specializes in calculating the lowest possible BPM. Therefore, always request a quote without obligation.', 'eurostocks');
  } else {
    $txt_search_help = $options['txt_search_help'];
  }

  if (!isset($options['txt_search_help_show']) || $options['txt_search_help_show'] != 1) {
    $txt_search_help_show = 0;
  } else {
    $txt_search_help_show = $options['txt_search_help_show'];
  }

  if (!isset($options['txt_btn'])) {
    $txt_btn = __('Request a quote', 'eurostocks');
  } else {
    $txt_btn = $options['txt_btn'];
  }

  if (!isset($options['txt_price_help'])) {
    $txt_price_help = __('Including VAT, BPM and import costs', 'eurostocks');
  } else {
    $txt_price_help = $options['txt_price_help'];
  }
  if (!isset($options['txt_price_helpp'])) {
    $txt_price_helpp = __('Including VAT, BPM and import costs', 'eurostocks');
  } else {
    $txt_price_helpp = $options['txt_price_helpp'];
  }

  if (!isset($options['replacement_img'])) {
    $replacement_img_id = false;
  } else {
    $replacement_img_id = $options['replacement_img'];
  }

  if (!isset($options['cta_url'])) {
    $cta_url = '';
  } else {
    $cta_url = $options['cta_url'];
  }
  


  foreach ($accepted_langs as $lang) {

    if($lang == 'nl'){
      $locale_lang = 'nl_NL';
    }elseif($lang == 'de'){
      $locale_lang = 'de_DE';
    }elseif($lang == 'fr'){
      $locale_lang = 'fr_FR';
    }elseif($lang == 'es'){
      $locale_lang = 'es_ES';
    }else{
      $locale_lang = 'en_US';
    }
    switch_to_locale($locale_lang);

    if (!isset($options[esc_html($lang)]['fav_opt_title'])) {
      $fav_opt_title_e[esc_html($lang)] = __('Most chosen options', 'eurostocks');
    } else {
      $fav_opt_title_e[esc_html($lang)] = $options[esc_html($lang)]['fav_opt_title'];
    }

    if (!isset($options[esc_html($lang)]['txt_priceonrequest'])) {
      $txt_priceonrequest_e[esc_html($lang)] = __('Price on request', 'eurostocks');
    } else {
      $txt_priceonrequest_e[esc_html($lang)] = $options[esc_html($lang)]['txt_priceonrequest'];
    }

    if (!isset($options[esc_html($lang)]['nonfav_opt_title'])) {
      $nonfav_opt_title_e[esc_html($lang)] = __('Other options', 'eurostocks');
    } else {
      $nonfav_opt_title_e[esc_html($lang)] = $options[esc_html($lang)]['nonfav_opt_title'];
    }


    if (!isset($options[esc_html($lang)]['txt_search_title'])) {
      $txt_search_title_e[esc_html($lang)] = __('{aantal} {merk} {model} occasions found', 'eurostocks');
    } else {
      $txt_search_title_e[esc_html($lang)] = $options[esc_html($lang)]['txt_search_title'];
    }

    if (!isset($options[esc_html($lang)]['txt_make'])) {
      $txt_make_e[esc_html($lang)] = __('Make', 'eurostocks');
    } else {
      $txt_make_e[esc_html($lang)] = $options[esc_html($lang)]['txt_make'];
    }

    if (!isset($options[esc_html($lang)]['txt_model'])) {
      $txt_model_e[esc_html($lang)] = __('Model', 'eurostocks');
    } else {
      $txt_model_e[esc_html($lang)] = $options[esc_html($lang)]['txt_model'];
    }

    if (!isset($options[esc_html($lang)]['txt_select_make'])) {
      $txt_select_make_e[esc_html($lang)] = __('Select make', 'eurostocks');
    } else {
      $txt_select_make_e[esc_html($lang)] = $options[esc_html($lang)]['txt_select_make'];
    }

    if (!isset($options[esc_html($lang)]['txt_select_model'])) {
      $txt_select_model_e[esc_html($lang)] = __('Select model', 'eurostocks');
    } else {
      $txt_select_model_e[esc_html($lang)] = $options[esc_html($lang)]['txt_select_model'];
    }

    if (!isset($options[esc_html($lang)]['txt_search'])) {
      $txt_search_e[esc_html($lang)] = __('The sales price shown is only an indication. Why can this price differ in some cases?', 'eurostocks');
    } else {
      $txt_search_e[esc_html($lang)] = $options[esc_html($lang)]['txt_search'];
    }

    if (!isset($options[esc_html($lang)]['txt_search_help'])) {
      $txt_search_help_e[esc_html($lang)] =  __('There are different ways in which you can pay BPM. Via the fixed table, with the help of price lists or with a valuation report. [COMPANY NAME] specializes in calculating the lowest possible BPM. Therefore, always request a quote without obligation.', 'eurostocks');
    } else {
      $txt_search_help_e[esc_html($lang)] = $options[esc_html($lang)]['txt_search_help'];
    }

    if (!isset($options[esc_html($lang)]['txt_btn'])) {
      $txt_btn_e[esc_html($lang)] = __('Request a quote', 'eurostocks');
    } else {
      $txt_btn_e[esc_html($lang)] = $options[esc_html($lang)]['txt_btn'];
    }

    if (!isset($options[esc_html($lang)]['txt_price_help'])) {
      $txt_price_help_e[esc_html($lang)] = __('Including VAT, BPM and import costs', 'eurostocks');
    } else {
      $txt_price_help_e[esc_html($lang)] = $options[esc_html($lang)]['txt_price_help'];
    }
    if (!isset($options[esc_html($lang)]['txt_price_helpp'])) {
      $txt_price_helpp_e[esc_html($lang)] = __('Including VAT, BPM and import costs', 'eurostocks');
    } else {
      $txt_price_helpp_e[esc_html($lang)] = $options[esc_html($lang)]['txt_price_helpp'];
    }

    if (!isset($options[esc_html($lang)]['cta_url'])) {
      $cta_url_e[esc_html($lang)] = '';
    } else {
      $cta_url_e[esc_html($lang)] = $options[esc_html($lang)]['cta_url'];
    }

    restore_previous_locale();
  }

  // details page
  if (!isset($options['details_top_txt'])) {
    $details_top_txt = __('Do you want to import this {merk} from Germany?', 'eurostocks');
  } else {
    $details_top_txt = $options['details_top_txt'];
  }

  if (!isset($options['txt_btn_product'])) {
    $txt_btn_product = __('Request a quote', 'eurostocks');
  } else {
    $txt_btn_product = $options['txt_btn_product'];
  }

  if (!isset($options['offerte_title'])) {
    $offerte_title = __('Request a quote', 'eurostocks');
  } else {
    $offerte_title = $options['offerte_title'];
  }

  if (!isset($options['offerte_txt'])) {
    $offerte_txt = __('Leave your details for a free, no-obligation customized quote.', 'eurostocks');
  } else {
    $offerte_txt = $options['offerte_txt'];
  }

  if (!isset($options['top_footer_img'])) {
    $top_footer_img = false;
  } else {
    $top_footer_img = $options['top_footer_img'];
  }

  if (!isset($options['txt_voordeel1'])) {
    $txt_voordeel1 = __('Prices shown include BPM', 'eurostocks');
  } else {
    $txt_voordeel1 = $options['txt_voordeel1'];
  }

  if (!isset($options['txt_voordeel2'])) {
    $txt_voordeel2 = __('[Company name] specializes in calculating the lowest possible BPM', 'eurostocks');
  } else {
    $txt_voordeel2 = $options['txt_voordeel2'];
  }

  if (!isset($options['txt_voordeel3'])) {
    $txt_voordeel3 = __('Accelerated RDW procedure', 'eurostocks');
  } else {
    $txt_voordeel3 = $options['txt_voordeel3'];
  }

  if (!isset($options['txt_voordeel4'])) {
    $txt_voordeel4 = '';
  } else {
    $txt_voordeel4 = $options['txt_voordeel4'];
  }

  if (!isset($options['txt_disclaimer'])) {
    $txt_disclaimer = __('This listing has been compiled based on information from external sources.', 'eurostocks');
  } else {
    $txt_disclaimer = $options['txt_disclaimer'];
  }

  if (!isset($options['txt_co2_disclaimer'])) {
    $txt_co2_disclaimer = __('NB. It often happens that the specified CO2 value is not stated correctly by our external data supplier, resulting in an incorrectly calculated residual BPM amount. This residual BPM amount should always be regarded as indicative, no rights can be derived from it.', 'eurostocks');
  } else {
    $txt_co2_disclaimer = $options['txt_co2_disclaimer'];
  }

    if (!isset($options['txt_co2_disclaimer_fallback'])) {
    $txt_co2_disclaimer_fallback = __('The stated CO₂ emissions are an estimate; actual emissions may vary. The calculated residual BPM (private car and motorcycle tax) is an indicative value and cannot be legally binding. For an accurate calculation, please request a quote without obligation.', 'eurostocks');
  } else {
    $txt_co2_disclaimer_fallback = $options['txt_co2_disclaimer_fallback'];
  }

  if(!isset($options['cta_app'])) {
    $cta_app = __('App us', 'eurostocks');
  } else {
    $cta_app = $options['cta_app'];
  }

  if(!isset($options['cta_app_app'])) {
    $cta_app_app = __('Hello, I\'m interested in {{url}}', 'eurostocks');
  } else {
    $cta_app_app = $options['cta_app_app'];
  }
  if(!isset($options['cta_tel'])) {
    $cta_tel = __('Call us', 'eurostocks');
  } else {
    $cta_tel = $options['cta_tel'];
  } 

  if(!isset($options['cta_fav'])) {
    $cta_fav = __('Add to favorites', 'eurostocks');
  } else {
    $cta_fav = $options['cta_fav'];
  }

  if(!isset($options['cta_fav_fav'])) {
    $cta_fav_fav = __('Added to favorites', 'eurostocks');
  } else {
    $cta_fav_fav = $options['cta_fav_fav'];
  }

  // details 404

  if(!isset($options['txt_404_title'])) {
    $txt_404_title = __('Car not available', 'eurostocks');
  } else {
    $txt_404_title = $options['txt_404_title'];
  }

  if(!isset($options['txt_404_btn'])) {
    $txt_404_btn = __('Go back', 'eurostocks');
  } else {
    $txt_404_btn = $options['txt_404_btn'];
  }

  if(!isset($options['txt_404_txt'])) {
    $txt_404_txt = __('The car you are looking for is no longer available.', 'eurostocks');
  } else {
    $txt_404_txt = $options['txt_404_txt'];
  }

  foreach ($accepted_langs as $lang) {
    if($lang == 'nl'){
      $locale_lang = 'nl_NL';
    }elseif($lang == 'de'){
      $locale_lang = 'de_DE';
    }elseif($lang == 'fr'){
      $locale_lang = 'fr_FR';
    }elseif($lang == 'es'){
      $locale_lang = 'es_ES';
    }else{
      $locale_lang = 'en_US';
    }
    switch_to_locale($locale_lang);
    if (!isset($options[esc_html($lang)]['details_top_txt'])) {
      $details_top_txt_e[esc_html($lang)] = __('Do you want to import this {merk} from Germany?', 'eurostocks');
    } else {
      $details_top_txt_e[esc_html($lang)] = $options[esc_html($lang)]['details_top_txt'];
    }

    if (!isset($options[esc_html($lang)]['txt_btn_product'])) {
      $txt_btn_product_e[esc_html($lang)] = __('Request a quote', 'eurostocks');
    } else {
      $txt_btn_product_e[esc_html($lang)] = $options[esc_html($lang)]['txt_btn_product'];
    }

    if (!isset($options[esc_html($lang)]['offerte_title'])) {
      $offerte_title_e[esc_html($lang)] = __('Request a quote', 'eurostocks');
    } else {
      $offerte_title_e[esc_html($lang)] = $options[esc_html($lang)]['offerte_title'];
    }

    if (!isset($options[esc_html($lang)]['offerte_txt'])) {
      $offerte_txt_e[esc_html($lang)] = __('Leave your details for a free, no-obligation customized quote.', 'eurostocks');
    } else {
      $offerte_txt_e[esc_html($lang)] = $options[esc_html($lang)]['offerte_txt'];
    }

    if (!isset($options[esc_html($lang)]['txt_voordeel1'])) {
      $txt_voordeel1_e[esc_html($lang)] = __('Prices shown include BPM', 'eurostocks');
    } else {
      $txt_voordeel1_e[esc_html($lang)] = $options[esc_html($lang)]['txt_voordeel1'];
    }

    if (!isset($options[esc_html($lang)]['txt_voordeel2'])) {
      $txt_voordeel2_e[esc_html($lang)] = __('[Company name] specializes in calculating the lowest possible BPM', 'eurostocks');
    } else {
      $txt_voordeel2_e[esc_html($lang)] = $options[esc_html($lang)]['txt_voordeel2'];
    }

    if (!isset($options[esc_html($lang)]['txt_voordeel3'])) {
      $txt_voordeel3_e[esc_html($lang)] = __('Accelerated RDW procedure', 'eurostocks');
    } else {
      $txt_voordeel3_e[esc_html($lang)] = $options[esc_html($lang)]['txt_voordeel3'];
    }

    if (!isset($options[esc_html($lang)]['txt_voordeel4'])) {
      $txt_voordeel4_e[esc_html($lang)] = '';
    } else {
      $txt_voordeel4_e[esc_html($lang)] = $options[esc_html($lang)]['txt_voordeel4'];
    }


    if (!isset($options[esc_html($lang)]['txt_disclaimer'])) {
      $txt_disclaimer_e[esc_html($lang)] = __('This listing has been compiled based on information from external sources.', 'eurostocks');
    } else {
      $txt_disclaimer_e[esc_html($lang)] = $options[esc_html($lang)]['txt_disclaimer'];
    }

    if (!isset($options[esc_html($lang)]['txt_co2_disclaimer'])) {
      $txt_co2_disclaimer_e[esc_html($lang)] = __('NB. It often happens that the specified CO2 value is not stated correctly by our external data supplier, resulting in an incorrectly calculated residual BPM amount. This residual BPM amount should always be regarded as indicative, no rights can be derived from it.', 'eurostocks');
    } else {
      $txt_co2_disclaimer_e[esc_html($lang)] = $options[esc_html($lang)]['txt_co2_disclaimer'];
    }

    if (!isset($options[esc_html($lang)]['txt_co2_disclaimer_fallback'])) {
      $txt_co2_disclaimer_fallback_e[esc_html($lang)] = __('The stated CO₂ emissions are an estimate; actual emissions may vary. The calculated residual BPM (private car and motorcycle tax) is an indicative value and cannot be legally binding. For an accurate calculation, please request a quote without obligation.', 'eurostocks');
    } else {
      $txt_co2_disclaimer_fallback_e[esc_html($lang)] = $options[esc_html($lang)]['txt_co2_disclaimer_fallback'];
    }

    if(!isset($options[esc_html($lang)]['cta_app'])) {
      $cta_app_e[esc_html($lang)] = __('App us', 'eurostocks');
    } else {
      $cta_app_e[esc_html($lang)] = $options[esc_html($lang)]['cta_app'];
    }

    if(!isset($options[esc_html($lang)]['cta_app_app'])) {
      $cta_app_app_e[esc_html($lang)] = "";
    } else {
      $cta_app_app_e[esc_html($lang)] = $options[esc_html($lang)]['cta_app_app'];
    }
  
    if(!isset($options[esc_html($lang)]['cta_tel'])) {
      $cta_tel_e[esc_html($lang)] = __('Call us', 'eurostocks');
    } else {
      $cta_tel_e[esc_html($lang)] = $options[esc_html($lang)]['cta_tel'];
    }

    if(!isset($options[esc_html($lang)]['cta_fav'])) {
      $cta_fav_e[esc_html($lang)] = __('Add to favorites', 'eurostocks');
    } else {
      $cta_fav_e[esc_html($lang)] = $options[esc_html($lang)]['cta_fav'];
    }
    if(!isset($options[esc_html($lang)]['cta_fav_fav'])) {
      $cta_fav_fav_e[esc_html($lang)] = __('Added to favorites', 'eurostocks');
    } else {
      $cta_fav_fav_e[esc_html($lang)] = $options[esc_html($lang)]['cta_fav_fav'];
    }
    if(!isset($options[esc_html($lang)]['txt_404_title'])) {
      $txt_404_title_e[esc_html($lang)] = __('Car not available', 'eurostocks');
    } else {
      $txt_404_title_e[esc_html($lang)] = $options[esc_html($lang)]['txt_404_title'];
    }

    if(!isset($options[esc_html($lang)]['txt_404_btn'])) {
      $txt_404_btn_e[esc_html($lang)] = __('Go back', 'eurostocks');
    } else {
      $txt_404_btn_e[esc_html($lang)] = $options[esc_html($lang)]['txt_404_btn'];
    }

    if(!isset($options[esc_html($lang)]['txt_404_txt'])) {
      $txt_404_txt_e[esc_html($lang)] = __('The car you are looking for is no longer available.', 'eurostocks');
    } else {
      $txt_404_txt_e[esc_html($lang)] = $options[esc_html($lang)]['txt_404_txt'];
    }

    restore_previous_locale();
  }


  // EXPERT BLOCK
  if (!isset($options['txt_experts'])) {
    $txt_experts = __('Ask one of our import coaches', 'eurostocks');
  } else {
    $txt_experts = $options['txt_experts'];
  }

  if (!isset($options['html_experts'])) {
    $html_experts = '';
  } else {
    $html_experts = $options['html_experts'];
  }

  foreach ($accepted_langs as $lang) {
    if($lang == 'nl'){
      $locale_lang = 'nl_NL';
    }elseif($lang == 'de'){
      $locale_lang = 'de_DE';
    }elseif($lang == 'fr'){
      $locale_lang = 'fr_FR';
    }elseif($lang == 'es'){
      $locale_lang = 'es_ES';
    }else{
      $locale_lang = 'en_US';
    }
    switch_to_locale($locale_lang);
    if (!isset($options[esc_html($lang)]['txt_experts'])) {
      $txt_experts_e[esc_html($lang)] = __('Ask one of our import coaches', 'eurostocks');
    } else {
      $txt_experts_e[esc_html($lang)] = $options[esc_html($lang)]['txt_experts'];
    }

    if (!isset($options[esc_html($lang)]['html_experts'])) {
      $html_experts_e[esc_html($lang)] = '';
    } else {
      $html_experts_e[esc_html($lang)] = $options[esc_html($lang)]['html_experts'];
    }
    restore_previous_locale();
  }

  if (!isset($options['experts_one_name'])) {
    $experts_one_name = '';
  } else {
    $experts_one_name = $options['experts_one_name'];
  }

  if (!isset($options['experts_one_function'])) {
    $experts_one_function = '';
  } else {
    $experts_one_function = $options['experts_one_function'];
  }

  if (!isset($options['experts_one_tel'])) {
    $experts_one_tel = '';
  } else {
    $experts_one_tel = $options['experts_one_tel'];
  }

  if (!isset($options['experts_one_mail'])) {
    $experts_one_mail = '';
  } else {
    $experts_one_mail = $options['experts_one_mail'];
  }

  if (!isset($options['experts_one_img'])) {
    $experts_one_img_id = false;
  } else {
    $experts_one_img_id = $options['experts_one_img'];
  }

  foreach ($accepted_langs as $lang) {
    if($lang == 'nl'){
      $locale_lang = 'nl_NL';
    }elseif($lang == 'de'){
      $locale_lang = 'de_DE';
    }elseif($lang == 'fr'){
      $locale_lang = 'fr_FR';
    }elseif($lang == 'es'){
      $locale_lang = 'es_ES';
    }else{
      $locale_lang = 'en_US';
    }
    switch_to_locale($locale_lang);
    if (!isset($options[esc_html($lang)]['experts_one_name'])) {
      $experts_one_name_e[esc_html($lang)] = '';
    } else {
      $experts_one_name_e[esc_html($lang)] = $options[esc_html($lang)]['experts_one_name'];
    }

    if (!isset($options[esc_html($lang)]['experts_one_function'])) {
      $experts_one_function_e[esc_html($lang)] = '';
    } else {
      $experts_one_function_e[esc_html($lang)] = $options[esc_html($lang)]['experts_one_function'];
    }

    if (!isset($options[esc_html($lang)]['experts_one_tel'])) {
      $experts_one_tel_e[esc_html($lang)] = '';
    } else {
      $experts_one_tel_e[esc_html($lang)] = $options[esc_html($lang)]['experts_one_tel'];
    }

    if (!isset($options[esc_html($lang)]['experts_one_mail'])) {
      $experts_one_mail_e[esc_html($lang)] = '';
    } else {
      $experts_one_mail_e[esc_html($lang)] = $options[esc_html($lang)]['experts_one_mail'];
    }
    restore_previous_locale();
  }

  if (!isset($options['experts_two_name'])) {
    $experts_two_name = '';
  } else {
    $experts_two_name = $options['experts_two_name'];
  }

  if (!isset($options['experts_two_function'])) {
    $experts_two_function = '';
  } else {
    $experts_two_function = $options['experts_two_function'];
  }

  if (!isset($options['experts_two_tel'])) {
    $experts_two_tel = '';
  } else {
    $experts_two_tel = $options['experts_two_tel'];
  }

  if (!isset($options['experts_two_mail'])) {
    $experts_two_mail = '';
  } else {
    $experts_two_mail = $options['experts_two_mail'];
  }

  if (!isset($options['experts_two_img'])) {
    $experts_two_img_id = false;
  } else {
    $experts_two_img_id = $options['experts_two_img'];
  }

  foreach ($accepted_langs as $lang) {
    if($lang == 'nl'){
      $locale_lang = 'nl_NL';
    }elseif($lang == 'de'){
      $locale_lang = 'de_DE';
    }elseif($lang == 'fr'){
      $locale_lang = 'fr_FR';
    }elseif($lang == 'es'){
      $locale_lang = 'es_ES';
    }else{
      $locale_lang = 'en_US';
    }
    switch_to_locale($locale_lang);
    if (!isset($options[esc_html($lang)]['experts_two_name'])) {
      $experts_two_name_e[esc_html($lang)] = '';
    } else {
      $experts_two_name_e[esc_html($lang)] = $options[esc_html($lang)]['experts_two_name'];
    }

    if (!isset($options[esc_html($lang)]['experts_two_function'])) {
      $experts_two_function_e[esc_html($lang)] = '';
    } else {
      $experts_two_function_e[esc_html($lang)] = $options[esc_html($lang)]['experts_two_function'];
    }

    if (!isset($options[esc_html($lang)]['experts_two_tel'])) {
      $experts_two_tel_e[esc_html($lang)] = '';
    } else {
      $experts_two_tel_e[esc_html($lang)] = $options[esc_html($lang)]['experts_two_tel'];
    }

    if (!isset($options[esc_html($lang)]['experts_two_mail'])) {
      $experts_two_mail_e[esc_html($lang)] = '';
    } else {
      $experts_two_mail_e[esc_html($lang)] = $options[esc_html($lang)]['experts_two_mail'];
    }
    restore_previous_locale();
  }


  // REVIEWS BLOCK

  if (!isset($options['txt_review'])) {
    $txt_review = __('Others went before you', 'eurostocks');
  } else {
    $txt_review = $options['txt_review'];
  }

  if (!isset($options['txt_more_reviews'])) {
    $txt_more_reviews = __('Read what others write about [COMPANY NAME]', 'eurostocks');
  } else {
    $txt_more_reviews = $options['txt_more_reviews'];
  }

  if (!isset($options['review_img'])) {
    $review_img = false;
  } else {
    $review_img = $options['review_img'];
  }

  if (!isset($options['reviews_url'])) {
    $reviews_url = '';
  } else {
    $reviews_url = $options['reviews_url'];
  }

  foreach ($accepted_langs as $lang) {
    if($lang == 'nl'){
      $locale_lang = 'nl_NL';
    }elseif($lang == 'de'){
      $locale_lang = 'de_DE';
    }elseif($lang == 'fr'){
      $locale_lang = 'fr_FR';
    }elseif($lang == 'es'){
      $locale_lang = 'es_ES';
    }else{
      $locale_lang = 'en_US';
    }
    switch_to_locale($locale_lang);
    if (!isset($options[esc_html($lang)]['txt_review'])) {
      $txt_review_e[esc_html($lang)] = __('Others went before you', 'eurostocks');
    } else {
      $txt_review_e[esc_html($lang)] = $options[esc_html($lang)]['txt_review'];
    }

    if (!isset($options[esc_html($lang)]['txt_more_reviews'])) {
      $txt_more_reviews_e[esc_html($lang)] = __('Read what others write about [COMPANY NAME]', 'eurostocks');
    } else {
      $txt_more_reviews_e[esc_html($lang)] = $options[esc_html($lang)]['txt_more_reviews'];
    }

    if (!isset($options[esc_html($lang)]['reviews_url'])) {
      $reviews_url_e[esc_html($lang)] = '';
    } else {
      $reviews_url_e[esc_html($lang)] = $options[esc_html($lang)]['reviews_url'];
    }
    restore_previous_locale();
  }

  if (!isset($options['reviews_one_name'])) {
    $reviews_one_name = '';
  } else {
    $reviews_one_name = $options['reviews_one_name'];
  }

  if (!isset($options['reviews_one_place'])) {
    $reviews_one_place = '';
  } else {
    $reviews_one_place = $options['reviews_one_place'];
  }

  if (!isset($options['reviews_one_stars'])) {
    $reviews_one_stars = '';
  } else {
    $reviews_one_stars = $options['reviews_one_stars'];
  }

  if (!isset($options['reviews_one_title'])) {
    $reviews_one_title = '';
  } else {
    $reviews_one_title = $options['reviews_one_title'];
  }

  if (!isset($options['reviews_one_text'])) {
    $reviews_one_text = '';
  } else {
    $reviews_one_text = $options['reviews_one_text'];
  }

  foreach ($accepted_langs as $lang) {
    if($lang == 'nl'){
      $locale_lang = 'nl_NL';
    }elseif($lang == 'de'){
      $locale_lang = 'de_DE';
    }elseif($lang == 'fr'){
      $locale_lang = 'fr_FR';
    }elseif($lang == 'es'){
      $locale_lang = 'es_ES';
    }else{
      $locale_lang = 'en_US';
    }
    switch_to_locale($locale_lang);
    if (!isset($options[esc_html($lang)]['reviews_one_name'])) {
      $reviews_one_name_e[esc_html($lang)] = '';
    } else {
      $reviews_one_name_e[esc_html($lang)] = $options[esc_html($lang)]['reviews_one_name'];
    }

    if (!isset($options[esc_html($lang)]['reviews_one_place'])) {
      $reviews_one_place_e[esc_html($lang)] = '';
    } else {
      $reviews_one_place_e[esc_html($lang)] = $options[esc_html($lang)]['reviews_one_place'];
    }

    if (!isset($options[esc_html($lang)]['reviews_one_title'])) {
      $reviews_one_title_e[esc_html($lang)] = '';
    } else {
      $reviews_one_title_e[esc_html($lang)] = $options[esc_html($lang)]['reviews_one_title'];
    }

    if (!isset($options[esc_html($lang)]['reviews_one_text'])) {
      $reviews_one_text_e[esc_html($lang)] = '';
    } else {
      $reviews_one_text_e[esc_html($lang)] = $options[esc_html($lang)]['reviews_one_text'];
    }
    restore_previous_locale();
  }

  if (!isset($options['reviews_two_name'])) {
    $reviews_two_name = '';
  } else {
    $reviews_two_name = $options['reviews_two_name'];
  }

  if (!isset($options['reviews_two_place'])) {
    $reviews_two_place = '';
  } else {
    $reviews_two_place = $options['reviews_two_place'];
  }

  if (!isset($options['reviews_two_stars'])) {
    $reviews_two_stars = '';
  } else {
    $reviews_two_stars = $options['reviews_two_stars'];
  }

  if (!isset($options['reviews_two_title'])) {
    $reviews_two_title = '';
  } else {
    $reviews_two_title = $options['reviews_two_title'];
  }

  if (!isset($options['reviews_two_text'])) {
    $reviews_two_text = '';
  } else {
    $reviews_two_text = $options['reviews_two_text'];
  }

  foreach ($accepted_langs as $lang) {
    if($lang == 'nl'){
      $locale_lang = 'nl_NL';
    }elseif($lang == 'de'){
      $locale_lang = 'de_DE';
    }elseif($lang == 'fr'){
      $locale_lang = 'fr_FR';
    }elseif($lang == 'es'){
      $locale_lang = 'es_ES';
    }else{
      $locale_lang = 'en_US';
    }
    switch_to_locale($locale_lang);
    if (!isset($options[esc_html($lang)]['reviews_two_name'])) {
      $reviews_two_name_e[esc_html($lang)] = '';
    } else {
      $reviews_two_name_e[esc_html($lang)] = $options[esc_html($lang)]['reviews_two_name'];
    }

    if (!isset($options[esc_html($lang)]['reviews_two_place'])) {
      $reviews_two_place_e[esc_html($lang)] = '';
    } else {
      $reviews_two_place_e[esc_html($lang)] = $options[esc_html($lang)]['reviews_two_place'];
    }

    if (!isset($options[esc_html($lang)]['reviews_two_title'])) {
      $reviews_two_title_e[esc_html($lang)] = '';
    } else {
      $reviews_two_title_e[esc_html($lang)] = $options[esc_html($lang)]['reviews_two_title'];
    }

    if (!isset($options[esc_html($lang)]['reviews_two_text'])) {
      $reviews_two_text_e[esc_html($lang)] = '';
    } else {
      $reviews_two_text_e[esc_html($lang)] = $options[esc_html($lang)]['reviews_two_text'];
    }
    restore_previous_locale();
  }


  // KOSTEN BLOCK

  if (!isset($options['txt_kosten_diensten'])) {
    $txt_kosten_diensten = __('Costs of our services', 'eurostocks');
  } else {
    $txt_kosten_diensten = $options['txt_kosten_diensten'];
  }

  if (!isset($options['kosten_one_title'])) {
    $kosten_one_title = '';
  } else {
    $kosten_one_title = $options['kosten_one_title'];
  }

  if (!isset($options['kosten_title'])) {
    $kosten_title = '';
  } else {
    $kosten_title = $options['kosten_title'];
  }

  if(!isset($options['kosten_restbpm'])) {
    $kosten_restbpm = __('BPM indication', 'eurostocks');
  } else {
    $kosten_restbpm = $options['kosten_restbpm'];
  }

  if (!isset($options['kosten_one_txt'])) {
    $kosten_one_txt = '';
  } else {
    $kosten_one_txt = $options['kosten_one_txt'];
  }
  if (!isset($options['kosten_two_title'])) {
    $kosten_two_title = '';
  } else {
    $kosten_two_title = $options['kosten_two_title'];
  }
  if (!isset($options['kosten_two_txt'])) {
    $kosten_two_txt = '';
  } else {
    $kosten_two_txt = $options['kosten_two_txt'];
  }

  foreach ($accepted_langs as $lang) {
    if($lang == 'nl'){
      $locale_lang = 'nl_NL';
    }elseif($lang == 'de'){
      $locale_lang = 'de_DE';
    }elseif($lang == 'fr'){
      $locale_lang = 'fr_FR';
    }elseif($lang == 'es'){
      $locale_lang = 'es_ES';
    }else{
      $locale_lang = 'en_US';
    }
    switch_to_locale($locale_lang);
    if (!isset($options[esc_html($lang)]['txt_kosten_diensten'])) {
      $txt_kosten_diensten_e[esc_html($lang)] = __('Costs of our services', 'eurostocks');
    } else {
      $txt_kosten_diensten_e[esc_html($lang)] = $options[esc_html($lang)]['txt_kosten_diensten'];
    }

    if (!isset($options[esc_html($lang)]['kosten_one_title'])) {
      $kosten_one_title_e[esc_html($lang)] = '';
    } else {
      $kosten_one_title_e[esc_html($lang)] = $options[esc_html($lang)]['kosten_one_title'];
    }

    if (!isset($options[esc_html($lang)]['kosten_title'])) {
      $kosten_title_e[esc_html($lang)] = '';
    } else {
      $kosten_title_e[esc_html($lang)] = $options[esc_html($lang)]['kosten_title'];
    }

      if (!isset($options[esc_html($lang)]['kosten_restbpm'])) {
      $kosten_restbpm_e[esc_html($lang)] = '';
    } else {
      $kosten_restbpm_e[esc_html($lang)] = $options[esc_html($lang)]['kosten_restbpm'];
    }

    if (!isset($options[esc_html($lang)]['kosten_one_txt'])) {
      $kosten_one_txt_e[esc_html($lang)] = '';
    } else {
      $kosten_one_txt_e[esc_html($lang)] = $options[esc_html($lang)]['kosten_one_txt'];
    }

    if (!isset($options[esc_html($lang)]['kosten_two_title'])) {
      $kosten_two_title_e[esc_html($lang)] = '';
    } else {
      $kosten_two_title_e[esc_html($lang)] = $options[esc_html($lang)]['kosten_two_title'];
    }

    if (!isset($options[esc_html($lang)]['kosten_two_txt'])) {
      $kosten_two_txt_e[esc_html($lang)] = '';
    } else {
      $kosten_two_txt_e[esc_html($lang)] = $options[esc_html($lang)]['kosten_two_txt'];
    }
    restore_previous_locale();
  }


  if (!isset($options['kosten_vraagprijs_tax'])) {
    $kosten_vraagprijs_tax = __('Including 19% VAT', 'eurostocks');
  } else {
    $kosten_vraagprijs_tax = $options['kosten_vraagprijs_tax'];
  }

  if (!isset($options['kosten_vraagprijs_no_tax'])) {
    $kosten_vraagprijs_no_tax = __('Including 19% VAT', 'eurostocks');
  } else {
    $kosten_vraagprijs_no_tax = $options['kosten_vraagprijs_no_tax'];
  }

  if (!isset($options['kosten_toelating'])) {
    $kosten_toelating = __('Dutch admission', 'eurostocks');
  } else {
    $kosten_toelating = $options['kosten_toelating'];
  }

  if (!isset($options['kosten_transport'])) {
    $kosten_transport = __('Mediation and transport', 'eurostocks');
  } else {
    $kosten_transport = $options['kosten_transport'];
  }

  if (!isset($options['kosten_transport2'])) {
    $kosten_transport_two = __('Transport costs', 'eurostocks');
  } else {
    $kosten_transport_two = $options['kosten_transport2'];
  }

  if (!isset($options['kosten_totaal'])) {
    $kosten_totaal =  __('Total costs', 'eurostocks');
  } else {
    $kosten_totaal = $options['kosten_totaal'];
  }

  if (!isset($options['kosten_vraagprijs'])) {
    $kosten_vraagprijs = __('Sales price', 'eurostocks');
  } else {
    $kosten_vraagprijs = $options['kosten_vraagprijs'];
  }

  foreach ($accepted_langs as $lang) {
    if($lang == 'nl'){
      $locale_lang = 'nl_NL';
    }elseif($lang == 'de'){
      $locale_lang = 'de_DE';
    }elseif($lang == 'fr'){
      $locale_lang = 'fr_FR';
    }elseif($lang == 'es'){
      $locale_lang = 'es_ES';
    }else{
      $locale_lang = 'en_US';
    }
    switch_to_locale($locale_lang);
    if (!isset($options[esc_html($lang)]['kosten_vraagprijs_tax'])) {
      $kosten_vraagprijs_tax_e[esc_html($lang)] = __('Including 19% VAT', 'eurostocks');
    } else {
      $kosten_vraagprijs_tax_e[esc_html($lang)] = $options[esc_html($lang)]['kosten_vraagprijs_tax'];
    }

    if (!isset($options[esc_html($lang)]['kosten_vraagprijs_no_tax'])) {
      $kosten_vraagprijs_no_tax_e[esc_html($lang)] = __('Including 19% VAT', 'eurostocks');
    } else {
      $kosten_vraagprijs_no_tax_e[esc_html($lang)] = $options[esc_html($lang)]['kosten_vraagprijs_no_tax'];
    }

    if (!isset($options[esc_html($lang)]['kosten_toelating'])) {
      $kosten_toelating_e[esc_html($lang)] = __('Dutch admission', 'eurostocks');
    } else {
      $kosten_toelating_e[esc_html($lang)] = $options[esc_html($lang)]['kosten_toelating'];
    }

    if (!isset($options[esc_html($lang)]['kosten_transport'])) {
      $kosten_transport_e[esc_html($lang)] = __('Mediation and transport', 'eurostocks');
    } else {
      $kosten_transport_e[esc_html($lang)] = $options[esc_html($lang)]['kosten_transport'];
    }

    if (!isset($options[esc_html($lang)]['kosten_transport2'])) {
      $kosten_transport_two_e[esc_html($lang)] = __('Transport costs', 'eurostocks');
    } else {
      $kosten_transport_two_e[esc_html($lang)] = $options[esc_html($lang)]['kosten_transport2'];
    }

    if (!isset($options[esc_html($lang)]['kosten_totaal'])) {
      $kosten_totaal_e[esc_html($lang)] = __('Total costs', 'eurostocks');
    } else {
      $kosten_totaal_e[esc_html($lang)] = $options[esc_html($lang)]['kosten_totaal'];
    }

    if (!isset($options[esc_html($lang)]['kosten_vraagprijs'])) {
      $kosten_vraagprijs_e[esc_html($lang)] = __('Sales price', 'eurostocks');
    } else {
      $kosten_vraagprijs_e[esc_html($lang)] = $options[esc_html($lang)]['kosten_vraagprijs'];
    }
    restore_previous_locale();
  }


  // CONTACT SETTINGS

  if (!isset($options['email'])) {
    $email = '';
  } else {
    $email = $options['email'];
  }

  if (!isset($options['contact_tel'])) {
    $contact_tel = '';
  } else {
    $contact_tel = $options['contact_tel'];
  }

  if (!isset($options['contact_app'])) {
    $contact_app = '';
  } else {
    $contact_app = $options['contact_app'];
  }

  if (!isset($options['redirect'])) {
    $redirect = '';
  } else {
    $redirect = $options['redirect'];
  }

  foreach ($accepted_langs as $lang) {
    if($lang == 'nl'){
      $locale_lang = 'nl_NL';
    }elseif($lang == 'de'){
      $locale_lang = 'de_DE';
    }elseif($lang == 'fr'){
      $locale_lang = 'fr_FR';
    }elseif($lang == 'es'){
      $locale_lang = 'es_ES';
    }else{
      $locale_lang = 'en_US';
    }
    switch_to_locale($locale_lang);
    if (!isset($options[esc_html($lang)]['redirect'])) {
      $redirect_e[esc_html($lang)] = '';
    } else {
      $redirect_e[esc_html($lang)] = $options[esc_html($lang)]['redirect'];
    }
    restore_previous_locale();
  }

  if (!isset($options['tel'])) {
    $tel = '';
  } else {
    $tel = $options['tel'];
  }

  if (!isset($options['hide_carlease']) || $options['hide_carlease'] != 1) {
    $hide_carlease = 0;
  } else {
    $hide_carlease = $options['hide_carlease'];
  }
  if (!isset($options['hide_cartrade']) || $options['hide_cartrade'] != 1) {
    $hide_cartrade = 0;
  } else {
    $hide_cartrade = $options['hide_cartrade'];
  }


  // PDF SETTINGS

  if (!isset($options['logo'])) {
    $logo = false;
  } else {
    $logo = $options['logo'];
  }

  if (!isset($options['contacttimes'])) {
    $contacttimes = __('Monday through Friday from 9 a.m. to 5 p.m.', 'eurostocks');
  } else {
    $contacttimes = $options['contacttimes'];
  }

  if (!isset($options['contactaddress'])) {
    $contactaddress = '';
  } else {
    $contactaddress = $options['contactaddress'];
  }



  if (!isset($options['contactmes'])) {
    $contactmes = '';
  } else {
    $contactmes = $options['contactmes'];
  }
  if (!isset($options['contactcar'])) {
    $contactcar = '';
  } else {
    $contactcar = $options['contactcar'];
  }

  foreach ($accepted_langs as $lang) {
    if($lang == 'nl'){
      $locale_lang = 'nl_NL';
    }elseif($lang == 'de'){
      $locale_lang = 'de_DE';
    }elseif($lang == 'fr'){
      $locale_lang = 'fr_FR';
    }elseif($lang == 'es'){
      $locale_lang = 'es_ES';
    }else{
      $locale_lang = 'en_US';
    }
    switch_to_locale($locale_lang);
    if (!isset($options[esc_html($lang)]['contacttimes'])) {
      $contacttimes_e[esc_html($lang)] = __('Monday through Friday from 9 a.m. to 5 p.m.', 'eurostocks');
    } else {
      $contacttimes_e[esc_html($lang)] = $options[esc_html($lang)]['contacttimes'];
    }

    if (!isset($options[esc_html($lang)]['contactaddress'])) {
      $contactaddress_e[esc_html($lang)] = '';
    } else {
      $contactaddress_e[esc_html($lang)] = $options[esc_html($lang)]['contactaddress'];
    }

    if (!isset($options[esc_html($lang)]['contactmes'])) {
      $contactmes_e[esc_html($lang)] = '';
    } else {
      $contactmes_e[esc_html($lang)] = $options[esc_html($lang)]['contactmes'];
    }

    if (!isset($options[esc_html($lang)]['contactcar'])) {
      $contactcar_e[esc_html($lang)] = '';
    } else {
      $contactcar_e[esc_html($lang)] = $options[esc_html($lang)]['contactcar'];
    }
    restore_previous_locale();
  }

  // FINANCIAL LEASE SETTINGS
  if (!isset($options['enable_fl'])) {
    $enable_fl = 0;
  } else {
    $enable_fl = $options['enable_fl'];
  }

  if (!isset($options['only_fl'])) {
    $only_fl = 0;
  } else {
    $only_fl = $options['only_fl'];
  }


  if (!isset($options['fl_percentage'])) {
    $fl_percentage = 6;
  } else {
    $fl_percentage = $options['fl_percentage'];
  }

  if (!isset($options['fl_duration'])) {
    $fl_duration = 60;
  } else {
    $fl_duration = $options['fl_duration'];
  }

  if (!isset($options['fl_restschuld'])) {
    $fl_restschuld = 25;
  } else {
    $fl_restschuld = $options['fl_restschuld'];
  }

  $caroptions = array(
    "AIR_SUSPENSION" => __("Air suspension", "eurostocks"),
    "ALARM_SYSTEM" => __("Alarm system", "eurostocks"),
    "ALLOY_WHEELS" => __("Alloy wheels", "eurostocks"),
    "ALL_SEASON_TIRES" => __("All season tires", "eurostocks"),
    "AMBIENT_LIGHTING" => __("Ambient lighting", "eurostocks"),
    "ANDROID_AUTO" => __("Android Auto", "eurostocks"),
    "ARM_REST" => __("Armrest", "eurostocks"),
    "AUTOMATIC_RAIN_SENSOR" => __("Automatic rain sensor", "eurostocks"),
    "AUXILIARY_HEATING" => __("Auxiliary heating", "eurostocks"),
    "BIODIESEL_SUITABLE" => __("Biodiesel suitable", "eurostocks"),
    "BLIND_SPOT_MONITOR" => __("Blind spot monitor", "eurostocks"),
    "BLUETOOTH" => __("Bluetooth", "eurostocks"),
    "CARGO_BARRIER" => __("Cargo barrier", "eurostocks"),
    "CARPLAY" => __("Apple CarPlay", "eurostocks"),
    "CD_MULTICHANGER" => __("CD multichanger", "eurostocks"),
    "CD_PLAYER" => __("CD player", "eurostocks"),
    "CENTRAL_LOCKING" => __("Central locking", "eurostocks"),
    "COLLISION_AVOIDANCE" => __("Pre-collision system", "eurostocks"),
    "DIGITAL_COCKPIT" => __("Digital cockpit", "eurostocks"),
    "DIMMING_INTERIOR_MIRROR" => __("Dimming interior mirror", "eurostocks"),
    "DISABLED_ACCESSIBLE" => __("Disabled accessible", "eurostocks"),
    "DISTANCE_WARNING_SYSTEM" => __("Distance warning system", "eurostocks"),
    "E10_ENABLED" => __("E10 enabled", "eurostocks"),
    "ELECTRIC_ADJUSTABLE_SEATS" => __("Electric adjustable seats", "eurostocks"),
    "ELECTRIC_BACKSEAT_ADJUSTMENT" => __("Electric backseat adjustment", "eurostocks"),
    "ELECTRIC_EXTERIOR_MIRRORS" => __("Electric exterior mirrors", "eurostocks"),
    "ELECTRIC_HEATED_REAR_SEATS" => __("Electric heated rear seats", "eurostocks"),
    "ELECTRIC_HEATED_SEATS" => __("Electric heated seats", "eurostocks"),
    "ELECTRIC_TAILGATE" => __("Electric tailgate", "eurostocks"),
    "ELECTRIC_WINDOWS" => __("Electric windows", "eurostocks"),
    "EMERGENCY_CALL_SYSTEM" => __("eCall / SOS system", "eurostocks"),
    "ESP" => __("ESP", "eurostocks"),
    "FATIGUE_WARNING_SYSTEM" => __("Fatigue warning system", "eurostocks"),
    "FOLD_FLAT_PASSENGER_SEAT" => __("Fold flat passenger seat", "eurostocks"),
    "FOUR_WHEEL_DRIVE" => __("Four wheel drive", "eurostocks"),
    "FRONT_FOG_LIGHTS" => __("Front fog lights", "eurostocks"),
    "FULL_SERVICE_HISTORY" => __("Full service history", "eurostocks"),
    "GLARE_FREE_HIGH_BEAM" => __("Glare-free high beam", "eurostocks"),
    "HANDS_FREE_PHONE_SYSTEM" => __("Hands-free phone system", "eurostocks"),
    "HEADLIGHT_WASHER_SYSTEM" => __("Headlight washer system", "eurostocks"),
    "HEAD_UP_DISPLAY" => __("Head-up display", "eurostocks"),
    "HEATED_STEERING_WHEEL" => __("Heated steering wheel", "eurostocks"),
    "HEATED_WINDSHIELD" => __("Heated windshield", "eurostocks"),
    "HIGH_BEAM_ASSIST" => __("High beam assist", "eurostocks"),
    "HILL_START_ASSIST" => __("Hill start assist", "eurostocks"),
    "HYBRID_PLUGIN" => __("Hybrid plugin", "eurostocks"),
    "IMMOBILIZER" => __("Immobilizer", "eurostocks"),
    "ISOFIX" => __("Isofix", "eurostocks"),
    "KEYLESS_ENTRY" => __("Keyless entry", "eurostocks"),
    "LANE_DEPARTURE_WARNING" => __("Lane departure warning", "eurostocks"),
    "LIGHT_SENSOR" => __("Light sensor", "eurostocks"),
    "NAVIGATION_SYSTEM" => __("Navigation system", "eurostocks"),
    "NONSMOKER_VEHICLE" => __("Non-smoker vehicle", "eurostocks"),
    "POWER_ASSISTED_STEERING" => __("Power assisted steering", "eurostocks"),
    "SOUND_SYSTEM" => __("Sound system", "eurostocks"),
    "SUNROOF" => __("Sunroof", "eurostocks"),
    "SPEED_LIMITER" => __("Speed limiter", "eurostocks"),
    "START_STOP_SYSTEM" => __("Start stop system", "eurostocks"),
    "TIRE_PRESSURE_MONITORING" => __("Tire pressure monitoring", "eurostocks"),
    "TRAFFIC_SIGN_RECOGNITION" => __("Traffic sign recognition", "eurostocks"),
    "TV" => __("TV", "eurostocks"),
    "VEGETABLEOILFUEL_SUITABLE" => __("Vegetable oil fuel suitable", "eurostocks"),
    "WARANTY" => __("Warranty", "eurostocks"),
    "WINTER_TIRES" => __("Winter tires", "eurostocks"),
    "SPORT_PACKAGE" => __("Sport package", "eurostocks"),
    "SPORT_SEATS" => __("Sport seats", "eurostocks"),
    "PERFORMANCE_HANDLING_SYSTEM" => __("Performance handling system", "eurostocks"),
    "PANORAMIC_GLASS_ROOF" => __("Panoramic glass roof", "eurostocks"),
    "DAB_RADIO" => __("DAB radio", "eurostocks"),
    "TUNER_RADIO" => __("Tuner / Radio", "eurostocks"),
    "TRAILER_COUPLING" => __("Coupling", "eurostocks"),
  );

  // sort caroptions by key
  asort($caroptions);


  ?>