In that case it would be more efficient, and code-friendly, if you put it near the bottom of that function instead. ie: directly above the line that says ```
$this->notify('NOTIFY_ORDER_CART_FINISHED');
Or let's scramble that omelet even more ... Far better yet would be to make it into a notifier/observer function call which fires when the NOTIFY_ORDER_CART_FINISHED notifier is triggered, so that you don't have to alter any core code in orders.php at all.
Two parts to that:
/includes/classes/observers/class.international_order_status.php
<?php
/**
* @package plugins
* @copyright Copyright 2003-2012 Zen Cart Development Team
* @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
*
* Designed for v1.5.0
*/
class international_order_status extends base {
function __construct() {
$this->attach($this, array('NOTIFY_ORDER_CART_FINISHED'));
$this->order_status_for_international_customers = 5;
}
function update(&$class, $eventID, $paramsArray = array())
{
global $db;
// CHECK IF SHIPPING ADDRESS IS OUTSIDE THE STORE'S COUNTRY, AND OVERRIDE ORDER-STATUS TO PENDING REGARDLESS OF DEFAULTS
$sql = "select ab.entry_country_id, ab.entry_zone_id
from " . TABLE_ADDRESS_BOOK . " ab
where ab.customers_id = '" . (int)$_SESSION['customer_id'] . "'
and ab.address_book_id = '" . (int)$_SESSION['sendto'] . "' LIMIT 1";
$result = $db->Execute($sql);
if ($result->RecordCount() > 0 && $result->fields['entry_country_id'] != STORE_COUNTRY) { // or might use SHIPPING_ORIGIN_COUNTRY
$class->info['order_status'] = $this->order_status_for_international_customers;
}
}
}
```and
/includes/auto_loaders/config.international_order_status.php:```
<?php
/**
*
* @package plugins
* @copyright Copyright 2003-2012 Zen Cart Development Team
* @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
*/
/**
* Designed for v1.5.0
*/
if (!defined('IS_ADMIN_FLAG')) {
die('Illegal Access');
}
$autoLoadConfig[190][] = array('autoType'=>'class',
'loadFile'=>'observers/class.international_order_status.php');
$autoLoadConfig[190][] = array('autoType'=>'classInstantiate',
'className'=>'international_order_status',
'objectName'=>'international_order_status');
```