If PMA is used with a discount module lilke uc_discounts_alt and in the mean time it's chosen a payment method whit the PMA Adjustment field leaved blank, it returns the following warning:

"warning: number_format() expects parameter 1 to be double, string given in C:\XAMPP\htdocs\drupal\sites\cosmeticaduepuntozero.com.store\modules\ubercart\contrib\uc_pma\uc_pma.module on line 203."

So I solved substituting the following code:

$ret['value'] = number_format(str_replace(variable_get('uc_currency_dec', '.'), ".", $ret['value']), 2);


$clean_str = str_replace(variable_get('uc_currency_dec', '.'), ".", $ret['value']);

if ($clean_str == '') {
$ret['value'] = 0;
else {
$ret['value'] = number_format($clean_str, 2);

It works for me.

#2 964156.patch653 bytesroderik
Members fund testing for the Drupal project. Drupal Association Learn more


keesje’s picture

The fix can be much simpler. I had the same problem here: Kerstbomen winkel. No discount module installed. Just put a 0 (zero) in every "adjustment" field that is left blank for active payment methods. Works for me ;).

roderik’s picture

653 bytes

True, but when we're patching the module anyway... let's make it more robust.

roderik’s picture

Status: Patch (to be ported) » Needs review


loparr’s picture

Thank you for this patch. warning message no longer appears.

chinita7’s picture

My error is also gone. Thanks.

GiorgosK’s picture

Status: Needs review » Reviewed & tested by the community

patch works great

kopeboy’s picture

Issue summary: View changes

This is not right, cause now I see the line item even if adjustment is not present.

Example with COD (I want to apply a fee):

Subtotal: 100
Discount 1: -10
COD fee: 5
Order total: 95

+ Errors in the log.

Example with paypal (I apply no fee):

Subtotal: 100
Discount 1: -10
Order total: 90

+ Errors in the log.

Example with paypal (I apply no fee):
Subtotal: 100
Discount 1: -10
PayPal Website Payments Standard fee: 0
Order total: 90

No errors in the log, but HORRIBLE for the user.

jimi’s picture

Same warning today (after release drupal 6.33)
The patch apparently fixes the problem

(but new error with the paybox cgi module :
CGI error: order , path: ../[path]/module[paybox].cgi
I am in touch with the hotline paybox to solve it)