2

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?

Kostis
  • 953
  • 9
  • 21

2 Answers2

3

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>';
Kostis
  • 953
  • 9
  • 21
1

You can achieve this like,

First the order confirmation page of VM2.x is order_done.php 
the file you can find in the path : components/com_virtuemart/view/cart/tmpl/order_done.php

second thing.

The order placed in VM storing in the order table #__virtuemart_orders

with order id you can find all the amounts. with tax without tax etc.
(order_number,order_pass,order_total,order_subtotal,order_tax)
Jobin
  • 8,238
  • 1
  • 33
  • 52
  • Is it right to add it there? I see that it calls $html which is in /plugins/vmpayment/standard/standard.php. I tried to add the script code at the $html before $html.='' but then i get a 500 error in the page. – Kostis Nov 07 '12 at 06:23
  • The Vm thank you page is order_done.php if u want to place the things any other place like shipping or payment section then you can find those in plugin path – Jobin Nov 07 '12 at 14:37
  • I finally did it within standard.php file! The output shows up at the thank you page! When i go home i'll post here the solution. Thanks for your answers. – Kostis Nov 07 '12 at 14:46