News:

Support the VirtueMart project and become a member

Main Menu

getDataByOrderId() returns nothing?

Started by ruudjonk, January 11, 2012, 20:32:28 PM

Previous topic - Next topic

ruudjonk

Hello All,

I'm currently working on a new plugin but somehow this->getDataByOrderId($correct_vm_order_id); returns nothing. Does anyone know why this is happening?

Here is the code I currently use:



$virtuemart_order_id = VirtueMartModelOrders::getOrderIdByOrderNumber($data['orderID']);
if (!$virtuemart_order_id) {
   $this->sendEmailToVendorAndAdmins(JText::_('VMPAYMENT_ERROR_EMAIL_SUBJECT'), JText::_('VMPAYMENT_UNKNOW_ORDER_ID'));
   exit;
}

$vendorId = 0;
$payment = $this->getDataByOrderId($virtuemart_order_id);



With this code $payment stays empty although I'm using the correct order_id.



ruudjonk

Hello All,

Got this one fixed using:

$db =& JFactory::getDBO();
$query = "SELECT * FROM #__virtuemart_orders WHERE virtuemart_order_id =".$virtuemart_order_id;
$db->setQuery($query);
$payment = $db->loadObject();