News:

Looking for documentation? Take a look on our wiki

Main Menu

Get shipment table data for an order

Started by sandomatyas, September 24, 2021, 17:46:42 PM

Previous topic - Next topic

sandomatyas

There is an order which I fetched via $ordersModel->getOrder( $virtuemart_order_id );
The object does not contain any data from #__virtuemart_shipment_plg_mypluginname table
How should I receive it with using VM's core methods instead of a direct SQL query?

Milbo

call the trigger yourself

$returnValues = vDispatcher::trigger('plgVmOnShowOrderBEShipment',array(  $this->orderID,$this->orderbt->virtuemart_shipmentmethod_id, $this->orderdetails));

foreach ($returnValues as $returnValue) {
if ($returnValue !== null) {
echo $returnValue;
}
}


I may change this one against a directTrigger.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

sandomatyas

Thanks Milbo, but if I check plgVmOnShowOrderBEShipment in weight_countries.php it calls getOrderShipmentHtml() which returns a html table.
There is a code part:
$q = 'SELECT * FROM `' . $this->_tablename . '` '
. 'WHERE `virtuemart_order_id` = ' . $virtuemart_order_id;
$db->setQuery ($q);
$shipinfo = $db->loadObject ();

I'd like to access this $shipinfo object whithout mofifying the shipping plugin