Hi,
i have got a problem w/ VM202.
When a shopper tries to checkout his order, he will get: Catchable fatal error: Object of class JDate could not be converted to string in /administrator/components/com_virtuemart/models/orders.php on line 997
What is going wrong?
No order or mail is generated.
regards
kaiman
I am having exactly the same problem.....at the same point
I also have this problem,
Im using an offline credit card plugin baught from VM extensions and its giving the same error when click confirm order.
I tried switching the file orders.php to the one from virtuemart 2.00 and the checkout works but still does not send confirmation email
update 997 string in /administrator/components/com_virtuemart/models/orders.php:
$data['invoice_number'] = str_replace('-', '', substr(JFactory::getDate(),2,8)).substr(md5($orderDetails['order_number'].$orderDetails['order_status']),0,3).'0'.$count;
on
$data['invoice_number'] = str_replace('-', '', substr(date("H:i:s Y-m-d"),2,8)).substr(md5($orderDetails['order_number'].$orderDetails['order_status']),0,3).'0'.$count;
:)
Quote from: Frantishik on March 08, 2012, 15:53:32 PM
update 997 string in /administrator/components/com_virtuemart/models/orders.php:
$data['invoice_number'] = str_replace('-', '', substr(date("H:i:s Y-m-d"),2,8)).substr(md5($orderDetails['order_number'].$orderDetails['order_status']),0,3).'0'.$count;
:)
It was before
$data['invoice_number'] = str_replace('-', '', substr(date("Y-m-d"),2,8)).substr(md5($orderDetails['order_number'].$orderDetails['order_status']),0,3).'0'.$count;
and others had trouble
Seems related to j1.5 or j1.6+ or to the php version
Quote from: Milbo on March 08, 2012, 16:21:27 PM
It was before $data['invoice_number'] = str_replace('-', '', substr(date("Y-m-d"),2,8)).substr(md5($orderDetails['order_number'].$orderDetails['order_status']),0,3).'0'.$count;
and others had trouble
Seems related to j1.5 or j1.6+ or to the php version
Hi, in the line 993 (models/orders.php)
str_replace('-', '', substr(JFactory::getDate(),2,8)).substr(md5($orderDetails['order_number'].$orderDetails['order_status']),0,3).'0'.$count; the term
JFactory::getDate() computes a reference to the class object JDate!
So it is definitely wrong - and the PHP throws an information or error...
Sometimes the md5 function calculates a pure number too, so I changed the line and added some stuff too; no errors, no information any more:
File: administrator/components/com_virtuemart/models/orders.php (line 991)
if(empty($data['invoice_number'])) {
//$variable_fixed=sprintf("%05s",$num_rows);
$_date = JFactory::getDate();
$data['invoice_number'] = str_replace('-', '', substr($_date->toISO8601(),2,8)).substr((string)md5($orderDetails['order_number'].$orderDetails['order_status']),0,3).'0'.$count;
//$data['invoice_number'] = str_replace('-', '', substr(JFactory::getDate(),2,8)).substr(md5($orderDetails['order_number'].$orderDetails['order_status']),0,3).'0'.$count;
}
tested with J1.5, VM2.02, PHP 5.3.10-2, debian
Best regards,
Thomas
It worked for me. Thank you tkuschel.