cart->virtuemart_order_id))
{
$tt_db->setQuery('
SELECT virtuemart_order_id
FROM #__virtuemart_orders
ORDER BY virtuemart_order_id DESC
');
$orders_ids = $tt_db->loadObjectList();
$this->cart->virtuemart_order_id = (int) $orders_ids[0]->virtuemart_order_id;
}
$tt_db->setQuery('
SELECT
o.order_number,
i.product_quantity,
i.order_item_name, i.order_item_sku,
i.product_final_price, i.product_subtotal_with_tax, i.product_subtotal_discount, i.product_tax
FROM #__virtuemart_order_items AS i
LEFT JOIN #__virtuemart_orders AS o ON (o.virtuemart_order_id = i.virtuemart_order_id)
WHERE i.virtuemart_order_id = ' . (int) $this->cart->virtuemart_order_id
);
$tt_order_items = $tt_db->loadObjectList();
$tt_campaignID = isset($tt_campaignID) ? $tt_campaignID : null;
$tt_productID = isset($tt_productID) ? $tt_productID : null;
$tt_trackingGroupID = isset($tt_trackingGroupID) ? $tt_trackingGroupID : null;
// Now loop through the products to display a pixel per product from the basket.
$tt_scriptData = '';
foreach ($tt_order_items as $index => $tt_order_item)
{
$tt_order_amount = ((float) $tt_order_item->product_final_price - (float) $tt_order_item->product_tax) * $tt_order_item->product_quantity;
$tt_order_descrMerchant = 'Internal ID: ' . $this->cart->virtuemart_order_id . ' | Product name: ' . $tt_order_item->order_item_name . ' | SKU: ' . $tt_order_item->order_item_sku;
$tt_scriptData .= "
" . PHP_EOL;
}
$tt_scriptData .= "
" . PHP_EOL;
// Return the combined transaction data.
return $tt_scriptData;