I want to add an affiliate tracker code to my Joomla based website using VirtueMart. They told me to add the code on the thank you page but I couldn't figure it out. The VirtueMart version is 2.0.12 and the code is
<script src="http://network.clickbanner.gr/i_sale_third/10566/SALE_AMOUNT/TRANSACTION_ID
/OPTIONAL_INFORMATION&sale_status=P"></script>
<noscript><img src="http://network.clickbanner.gr/i_track_sale/10566/SALE_AMOUNT/TRANSACTION_ID
/OPTIONAL_INFORMATION&sale_status=P"></noscript>
Ι have to replace SALE_AMOUNT
with the order's price excluding tax and the transaction_id
with the order id. Any ideas how to achieve this?
Solution:
The output of thank you page can be edited in /plugins/vmpayment/standard/standard.php (for standard payment method) or /plugins/vmpayment/paypal/paypal.php. Find the $html
variable in plgVmConfirmedOrder($cart, $order)
function and add the code you want after the line $html .= '</table>' . "\n";
(line 135). In my case the code is:
$html .= '<script src="http://network.clickbanner.gr/i_sale_third/10566/'.$order['details']['BT']->order_subtotal.'/'.$order['details']['BT']->order_number.'
/OPTIONAL_INFORMATION&sale_status=P"></script><noscript><img src="http://network.clickbanner.gr/i_track_sale/10566/'.$order['details']['BT']->order_subtotal.'/'.$order['details']['BT']->order_number.'/OPTIONAL_INFORMATION&sale_status=P"></noscript>';