After updating to 4.0.7 order status isn't updated after payment

Started by m.davide82, September 19, 2022, 16:29:51 PM

Previous topic - Next topic

m.davide82

Hi,

after updating VM from 3.4.3, doing it step by step, to 4.0.7 the order status isn't updated.

Any idea on how can I solve it?


Thanks.
Davide

jenkinhill

Which payment method?  Updating OK for me using VM4.0.7.10701 J3.10.11
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

m.davide82

Hi jenkinhill,

I was investigating and the problem is a custom plugin did for me.

In this moment I have that code:



function get_order($id)
{
defined('DS') or define('DS', DIRECTORY_SEPARATOR);
if (!class_exists( 'VmConfig' )) require(JPATH_ROOT .'/administrator/components/com_virtuemart/helpers/config.php');
if(!class_exists('VmModel'))require(JPATH_VM_ADMINISTRATOR.DS.'helpers'.DS.'vmmodel.php');
$order_model = VmModel::getModel('orders');
return $order_model->getOrder($id);
}

function plgVmOnUpdateOrderPayment($virtuemart_order,$status)
{
$products = $this->get_order_products($virtuemart_order->virtuemart_order_id);
$status   = $this->get_oderstatus($virtuemart_order->order_status);

$order_details =   $this->get_order($virtuemart_order->virtuemart_order_id);
}



But the $order_details gives this error:

0 Object of class stdClass could not be converted to string

Any idea on how can I solve this?


Thanks a lot.

Regards.
Davide

Milbo

Hello David, do you use a vmplugin? then you do not call the vmconfig stuff. If you need it, then use either loadConfig or the class vmdefines to load the classes.
But I think the error is not in this part of the code, what about a dumptrace?

use vmTrace, it will be logged so you can see what happens. You could also use vmEcho::$logDebug=1; and vmdebug('my debug',$var1, $var2, $var3, ....);
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/