Hi there. I have a Joomla 3.10.4 and Virtuemart 3.8.8. Inside orderdone.php I would like to get order's product ids.
What was inside orderdone.php
$db = JFactory::getDBO();
$query = "SELECT * FROM #__virtuemart_orders ORDER BY virtuemart_order_id DESC LIMIT 0, 1";
$db->setQuery($query);
$res_obj = $db->LoadObject();
What I did is this:
$productquery = "SELECT virtuemart_product_id FROM #__virtuemart_order_items WHERE virtuemart_order_id='".$res_obj->virtuemart_order_id."'";
$db->setQuery($productquery);
$res_obj2 = $db->LoadObject();
print_r($res_obj2);
So If i run query of what I did in phpMyAdmin with my latest order id, then query works (if I have 2 items in order I see the 2 items). In my php code, inside the print_r, I get only 1 product from the order and not all.
Any ideas?
Thank you in advance