Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Billing And Delivery Address Without Country


Guest

Recommended Posts

Hi everybody,

 

I only deliver within Germany and don't want "Deutschland" to be displayed in the delivery and billing addresses.

 

I've deleted something from general.php, but I still get the country displayed in any address.

 

The function looks like this now:

 

  function tep_address_format($address_format_id, $address, $html, $boln, $eoln) {
$address_format_query = tep_db_query("select address_format as format from " . TABLE_ADDRESS_FORMAT . " where address_format_id = '" . (int)$address_format_id . "'");
$address_format = tep_db_fetch_array($address_format_query);

$company = tep_output_string_protected($address['company']);
if (isset($address['firstname']) && tep_not_null($address['firstname'])) {
  $firstname = tep_output_string_protected($address['firstname']);
  $lastname = tep_output_string_protected($address['lastname']);
} elseif (isset($address['name']) && tep_not_null($address['name'])) {
  $firstname = tep_output_string_protected($address['name']);
  $lastname = '';
} else {
  $firstname = '';
  $lastname = '';
}
$street = tep_output_string_protected($address['street_address']);
$suburb = tep_output_string_protected($address['suburb']);
$city = tep_output_string_protected($address['city']);
$state = tep_output_string_protected($address['state']);

/*  if (isset($address['country_id']) && tep_not_null($address['country_id'])) {
  $country = tep_get_country_name($address['country_id']);

  if (isset($address['zone_id']) && tep_not_null($address['zone_id'])) {
	$state = tep_get_zone_code($address['country_id'], $address['zone_id'], $state);
  }
} elseif (isset($address['country']) && tep_not_null($address['country'])) {
  $country = tep_output_string_protected($address['country']['title']);
} else { */
  $country = '';
//  }
$postcode = tep_output_string_protected($address['postcode']);
$zip = $postcode;

if ($html) {
// HTML Mode
  $HR = '<hr>';
  $hr = '<hr>';
  if ( ($boln == '') && ($eoln == "\n") ) { // Values not specified, use rational defaults
	$CR = '<br>';
	$cr = '<br>';
	$eoln = $cr;
  } else { // Use values supplied
	$CR = $eoln . $boln;
	$cr = $CR;
  }
} else {
// Text Mode
  $CR = $eoln;
  $cr = $CR;
  $HR = '----------------------------------------';
  $hr = '----------------------------------------';
}

$statecomma = '';
$streets = $street;
if ($suburb != '') $streets = $street . $cr . $suburb;
if ($state != '') $statecomma = $state . ', ';

$fmt = $address_format['format'];
eval("\$address = \"$fmt\";");

if ( (ACCOUNT_COMPANY == 'true') && (tep_not_null($company)) ) {
  $address = $company . $cr . $address;
}

return $address;
 }

 

Did I forget something??

Link to comment
Share on other sites

I've noticed that this part of the code was placed wrong:

	  $country = '';

I've put it right after this line now:

	$state = tep_output_string_protected($address['state']);

But it still doesn't work. :(

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...