Open mgutt opened 6 years ago
Search for:
<td class="fieldValue"><?php echo tep_get_country_list('country') . ' ' . (tep_not_null(ENTRY_COUNTRY_TEXT) ? '<span class="inputRequirement">' . ENTRY_COUNTRY_TEXT . '</span>': ''); ?></td>
replace with:
<?php // try to get users default country $country = tep_db_fetch_array(tep_db_query("select countries_id from " . TABLE_COUNTRIES . " where countries_iso_code_2 = '" . tep_db_input(strtoupper(substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2))) . "' OR countries_iso_code_3 = '" . tep_db_input(strtoupper(substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 3))) . "' LIMIT 1")); ?> <td class="fieldValue"><?php echo tep_get_country_list('country', $country['countries_id']) . ' ' . (tep_not_null(ENTRY_COUNTRY_TEXT) ? '<span class="inputRequirement">' . ENTRY_COUNTRY_TEXT . '</span>': ''); ?></td>
Search for:
replace with: