Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

What is the code to call the customer COUNTRY information


basketmen

Recommended Posts

Posted

Guys, i want to put or add the customer COUNTRY information in checkout_shipping.php page,

 

 

i know there is address that can containing country in that page, but i want to put just country information in other place in that page

 

 

 

 

what is the code to call it there

 

 

 

i had try this, but no one working

 

 

 

 

 

$country

 

 

or

 

 

' . $country . '

 

 

or

 

 

<?php $country ?>

 

 

or

 

 

<? ' . $country . ' ?>

 

 

 

 

 

 

please help guys what is the right code to get customer COUNTRY

Deadline always

Posted

<?php
echo tep_get_country_name($customer_country_id);
?>

It worked for me, no runs, no drips, no errors.

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Posted

i have one question again,

 

i want to insert that code to change the Third text below, so showing customer COUNTRY in that line

 

 

 

$this->types = array('ONE' => 'First',

'TWO' => 'Second',

'THR' => 'Third',

'FOU' => 'Fourth');

 

 

 

 

 

 

 

 

 

 

 

 

 

i had try these but still not working

 

 

 

 

$this->types = array('ONE' => 'First',

'TWO' => 'Second',

'THR' => '<?php

echo tep_get_country_name($customer_country_id);

?>',

'FOU' => 'Fourth');

 

 

 

 

 

 

 

 

 

$this->types = array('ONE' => 'First',

'TWO' => 'Second',

'THR' => <?php

echo tep_get_country_name($customer_country_id);

?>,

'FOU' => 'Fourth');

 

 

 

 

 

 

 

 

 

 

 

$this->types = array('ONE' => 'First',

'TWO' => 'Second',

'THR' => tep_get_country_name($customer_country_id),

'FOU' => 'Fourth');

Deadline always

Posted

To load it into the array:

 

  $this->types = array('ONE' => 'First',
							'TWO' => 'Second',
							'THR' => tep_get_country_name($customer_country_id),
							'FOU' => 'Fourth');

To display it:

 

  echo  $this->types['THR'];

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

  • 2 weeks later...
Posted
<?php
echo tep_get_country_name($customer_country_id);
?>

 

It worked for me, no runs, no drips, no errors.

 

 

 

 

 

 

hi jim

 

i have a minor problem

 

the code is working to call the original customer COUNTRY information in checkout_shipping.php page, for example france

 

but sometime member want to change the country when checkout in checkout_shipping_address.php page, for example change to spain, but after go back to checkout_shipping.php page its still showing the original customer COUNTRY, that is france

 

 

 

is there conditional to showing the updated country there?

Deadline always

Posted

On the page in question there is this code:

 

	  $country = tep_db_prepare_input($HTTP_POST_VARS['country']);

Your code would need to appear ANYWHERE AFTER that code and look something like this:

 

echo tep_get_country_name($country);

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

  • 3 weeks later...
Posted

<?php
echo tep_get_country_name($customer_country_id);
?>

 

 

the code is working in store pages

 

but its not working in admin/orders.php page, its just blank

 

 

i want to change billing address with customer country information

Deadline always

Posted

Try:

 

<?php
echo $order->customer['country'];
?>

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

  • 2 weeks later...
Posted
<?php
echo tep_get_country_name($customer_country_id);
?>

It worked for me, no runs, no drips, no errors.

 

It work for me too, even though I put the code on "account edit" page....thanks

Posted

Hi Jim,

 

Can I ask a question, please?

 

What if I like to put the State on account edit page? I did tried to modified your code by change the word "country" to "state"...but it doesn't work.

Thanks for your help!

 

Jason,

Posted
Hi Jim,

 

Can I ask a question, please?

 

What if I like to put the State on account edit page? I did tried to modified your code by change the word "country" to "state"...but it doesn't work.

Thanks for your help!

 

Jason,

 

Hi Jim,

 

I found the answer, as shown below;

 

<?php echo tep_get_zone_name($account['entry_country_id'], $account['entry_zone_id'], ''); ?>

 

Thanks anyway

 

Jason,

Archived

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

×
×
  • Create New...