Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

delivery_country check


peter222

Recommended Posts

Posted

hi,

 

I'm a novice to osCommerce, php, mysql,.. but I can search and read, which I have done for a long while now.

But now I got a problem to which I need help, so I finally registered myself here :)

 

I want an if / else construction in admin/orders.php, something like:

 

<?php 
if ($delivery_country == "English')  {

some php_function  }

else  {

some other php_function  }

 

How can I make this delivery_country_check to work?

 

thanks!

Posted

have a look at the order class and you will find its available in the delivery array, and could be referred to in the orders.php as, eg, $order->delivery['country'], depending on your osc site.

 

Ken

commercial support - unProtected channel, not to be confused with the forum with same name - open to everyone who need some professional help: either PM/email me, or go to my website (URL can be found in my profile).

over 20 years of computer programming experience.

Posted

I think this is the closest I got so far, but I am doing something wrong here:

 

	$customer_country_query = tep_db_query("select delivery_country from " . TABLE_ORDERS . " where orders_id = '". (int)$HTTP_GET_VARS['order_id'] . "'");
$customer_country = tep_db_fetch_array($customer_country_query); 
if ($customer_country['delivery_country'] == 'English') {
<php .... ?>
  }
else {
<php .... ?>
  }

 

anybody?

Posted
I think this is the closest I got so far, but I am doing something wrong here:

 

	$customer_country_query = tep_db_query("select delivery_country from " . TABLE_ORDERS . " where orders_id = '". (int)$HTTP_GET_VARS['order_id'] . "'");
$customer_country = tep_db_fetch_array($customer_country_query); 
if ($customer_country['delivery_country'] == 'English') {
<php .... ?>
  }
else {
<php .... ?>
  }

 

anybody?

 

I live in

 

United Kingdom

 

not

 

English

Need help installing add ons/contributions, cleaning a hacked site or a bespoke development, check my profile

 

Virus Threat Scanner

My Contributions

Basic install answers.

Click here for Contributions / Add Ons.

UK your site.

Site Move.

Basic design info.

 

For links mentioned in old answers that are no longer here follow this link Useful Threads.

 

If this post was useful, click the Like This button over there ======>>>>>.

Posted
I live in

 

United Kingdom

 

not

 

English

you are right, this code is a mix of things, sorry ;)

 

but put the code between <?php en ?> and loose the <?php .. ?> inside, done!

Archived

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

×
×
  • Create New...