I actually goot it working now!
I made an extra if part in the "if all fails" part according to the following code:
} else { // default
if ($customer_id == '0') {
$customer_payment_query = tep_db_query("select cg.group_payment_allowed as payment_allowed from " . TABLE_CUSTOMERS_GROUPS . " cg where cg.customers_group_id = '0'");
if ($customer_payment = tep_db_fetch_array($customer_payment_query) ) {
if (tep_not_null($customer_payment['payment_allowed'])) {
$temp_payment_array = explode(';', $customer_payment['payment_allowed']);
$installed_modules = explode(';', MODULE_PAYMENT_INSTALLED);
for ($n = 0; $n < sizeof($installed_modules); $n++) {
// check to see if a payment method is not de-installed
if ( in_array($installed_modules[$n], $temp_payment_array ) ) {
$payment_array[] = $installed_modules[$n];
}
} // end for loop
$this->modules = $payment_array;
}
}
} else {
$this->modules = explode(';', MODULE_PAYMENT_INSTALLED);
}
}
// EOF Separate Pricing Per Customer
if ($customer_id == '0') The customers of PWA always have the customer Id 0.
As the first $customer_payment_query is set to the payment allowed for customer group #0 (the not trusted group) I will probaby make a new group #2 that is the PWA group and change + to 2 in the code. In this way I will be able to set payment modules and other criterias for this group only...
Do you think this will be stable?
/Martin