Hi,
The problem here is we cannot just run the process function before the pre_confirmation as that would then set in stone all discounts, and then calculations would take place based on the reduced order totals.
I did however come up with a fix, based solely on changing the pre_confirmation_check routine in the order_total class
PHP Code:
function pre_confirmation_check() {
global $order, $credit_covers;
if (MODULE_ORDER_TOTAL_INSTALLED) {
$total_deductions = 0;
reset($this->modules);
$orderInfoSaved = $order->info;
while (list(, $value) = each($this->modules)) {
$class = substr($value, 0, strrpos($value, '.'));
if ( $GLOBALS[$class]->credit_class ) {
$order_total = $GLOBALS[$class]->get_order_total();
if (is_array($order_total)) $order_total = $order_total['total'];
$total_deductions = $total_deductions + $GLOBALS[$class]->pre_confirmation_check($order_total);
}
else
{
$GLOBALS[$class]->process();
$GLOBALS[$class]->output = array();
}
}
$difference = $order->info['total'] - $total_deductions;
if ( $difference <= 0.009 ) {
$credit_covers = true;
}
$order->info = $orderInfoSaved;
}
}
So although I have run the process function, i've restricted it to non Credit Class modules, and reset order totals after pre_confirmation_check finishes.
This works on my up to date v1.3.8. Would appreciate some testing/feedback before I commit that as a bug fix.