Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Error 1366 During Checkout


sialivi

Recommended Posts

One of the payment methods cause an error during checkout_process.php

 

1366 - Incorrect decimal value: '' for column 'value' at row 1

insert into orders_total (orders_id, title, text, value, class, sort_order) values ('5988', 'Postförskott:', 'SEK.50,00', '', 'ot_postforskott', '23')

 

Is it normal for 'value' to be blank at this stage? Is that column updated later?

 

Any ideas about what might be wrong?

 

Thanks

Link to comment
Share on other sites

That means one of the $order_totals[$i]['value'] is empty. Have you checked the orders total modules installed? (the process member function of each)

Link to comment
Share on other sites

Looks like value is being set in the process function:

 

// display the output price in the total

$this->output[] = array('title' => $this->title . ':',

'text' => $currencies->format($order->info['postforskott']+$p_cost, true, $order->info['currency'], $order->info['currency_value']),

'value' => $order->info['postforskott']);

Link to comment
Share on other sites

It's possible for $order->info['postforskott'] element to be blank. Have you checked it's contents? Is it set in the orders class? You may have to check the order class file

Link to comment
Share on other sites

This is a bit weird. If I'm reading this correctly, the value is actually supposed to be null at this stage, the value is then updated in the after_process function. And it all worked fine on the old server.

 

Could there be some difference in settings between the old and the new server? Either PHP settings or MySQL settings? Something that seems to apply in this particular case where the above sql statement used to work but doesn't anymore?

Link to comment
Share on other sites

On line 68 in database.php there's a switch statement that does the following test:

 

case 'null':

 

But what if the $value actually is NULL, shouldn't that be handled as well?

Link to comment
Share on other sites

It's possible for $order->info['postforskott'] element to be blank. Have you checked it's contents? Is it set in the orders class? You may have to check the order class file

 

It is indeed blank, well, NULL. This is the var_dump from checkout_process.php

 

array(6) { ["orders_id"]=> int(6025) 
["title"]=> string(13) "Postförskott:" 
["text"]=> string(9) "SEK.50,00"
["value"]=> NULL
["class"]=> string(15) "ot_postforskott" 
["sort_order"]=> string(2) "23" } 

 

The postforskott.php then updates the value to 50 in it's after_process() function.

 

I don't understand how this has worked on the old server, but it did. I'm really stuck at this point, don't know how to proceed.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...