VirtueMart Forum

VirtueMart 2 + 3 + 4 => Installation, Migration & Upgrade => Topic started by: m.davide82 on September 19, 2022, 16:29:51 PM

Title: After updating to 4.0.7 order status isn't updated after payment
Post by: m.davide82 on September 19, 2022, 16:29:51 PM
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
Title: Re: After updating to 4.0.7 order status isn't updated after payment
Post by: jenkinhill on September 20, 2022, 11:30:35 AM
Which payment method?  Updating OK for me using VM4.0.7.10701 J3.10.11
Title: Re: After updating to 4.0.7 order status isn't updated after payment
Post by: m.davide82 on September 20, 2022, 22:11:15 PM
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
Title: Re: After updating to 4.0.7 order status isn't updated after payment
Post by: Milbo on October 05, 2022, 23:17:34 PM
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, ....);