Here's the smart (I hope) solution:
in includes/modules/payment/cod.php:
PHP Code:
$cod_excluded_customers_ids=array(15,391);
if (in_array($_SESSION['customer_id'], $cod_excluded_customers_ids, false)) { ?>
<?php
$messageStack->add_session('disabled_cod', MY_CUSTOMERS_DISABLED_COD , 'warning');
$this->enabled = false;
}
in templates/MY_TEMPLATE/templates/tpl_checkout_payment_default.php change:
PHP Code:
<?php
$radio_buttons = 0;
for ($i=0, $n=sizeof($selection); $i<$n; $i++) {
?>
to:
PHP Code:
<?php if ($messageStack->size('disabled_cod') > 0) echo $messageStack->output('disabled_cod'); ?>
</br>
<?php
$radio_buttons = 0;
for ($i=0, $n=sizeof($selection); $i<$n; $i++) {
?>
in includes/languages/MY_TEMPLATE/english.php add:
PHP Code:
define('MY_CUSTOMERS_DISABLED_COD', 'Sorry but COD payment for this account has been disabled');
So finally we have this: