Hi again,

Have managed to get a code that appears to work during the account creation stage - it will check the users input against the fastway_zones to see if the postcode entered is in the database.

add the following code to create_account.php (includes/modules/your_template)

// existing code

if (strlen($postcode) < ENTRY_POSTCODE_MIN_LENGTH) {
$error = true; $messageStack->add('create_account',ENTRY_POST_CODE_ERROR);

// add this code to check postcode

} else {
// check Zen Cart for duplicate postcode
$sql = "select * from " . TABLE_FASTWAY_ZONES . "
where f_postcode = :postcode:";
$check_postcode_query = $db->bindVars($sql, ':postcode:', $postcode, 'string');
$check_postcode = $db->Execute($check_postcode_query);
if ($check_postcode->RecordCount() < 1 ) {
$error = true;
$messageStack->add('create_account', ENTRY_POST_CODE_ERROR2);
}

You will also need to define the TABLE_FASTWAY_ZONES and ENTRY_POST_CODE_ERROR2 for this to work.

I haven't tested this on a live shop yet, but it appears to work on my localhost.

The only issue now is trying to keep the database up to date with any changes NZ Post make to the postcodes.

Regards,

Mike.