Post by puccibox73 » Thu Jan 28, 2016 12:49 am

i need to insert in OpenCart 2.X a tracking code (an <img src="http://xxxxxx" ... > html tag of 1x1 pixels) for a third party "price collector" in "Thank You" or "Success" page...

For what I see (I'm not an OpenCart expert) i need to edit or success.php or success.tpl , but my main problem is that I have to insert in my tracking url an unique ID (i was thinking to the order id) and the sub total price, without any tax or shipping cost ...

How can I achieve this ?

Thanks in advance



Thu Jan 28, 2016 12:44 am

Post by puccibox73 » Thu Jan 28, 2016 11:50 pm

How can I keep these variables (that i have in checkout page) , before they are unset in success page?



Thu Jan 28, 2016 12:44 am

Post by puccibox73 » Fri Jan 29, 2016 7:18 pm

Hallo again... i see a lot of person seeing my posts, but no answer... I'm not a complete newbie, maybe for opencart, but not for everything... maybe someone is thinking this ... so i give you more details, that i omitted because i was considering you more expert than me ...

i edited success.php ( i've tried with checkout.php because there's no "unset" of variables in checkout page and i was thinking it was easier to try there before, but results are moreover the same ) and i've added two variables

before the

i've tried as well

$this->data['ORDID'] = $this->session->data['order_id'];
$this->data['ORDTOT'] = $this->cart->getSubTotal();

and also i've tried with global variables

$GLOBALS['ORDID'] and $GLOBALS['ORDTOT'] (set to same system variables as before)

The bahaviour is very strange... (i've tried as guest because the site not made by me)

when i refer to this variables in related tpl files i see strange things...

in checkout.tpl(php) on first attempt i get the sub_total, but the order_id is shown as undefined variable (a notice 'cause i've put my php ini with display_error on ) if i refresh the page normally i get all the values i need....

in the success.tpl(php) more over the same things, but the only difference is that is not so on every attempt .... sometimes i get values, sometimes i get both variables undefined ...

What i see is that the notice are often related to vqcache files and not to the files edited by me, but opening them the content is the same...

I don't know Opencart so well, i'm studying it to achieve this goal for a friend/customer that has lost his developer ...

Any suggestion?



Thu Jan 28, 2016 12:44 am

Post by artgarcia » Thu Jun 30, 2016 10:24 am

Hi puccibox73!

I'm not by any means an expert. I use opencart and make a little mods here and there. I don't have the solution but maybe this may help you a little.

Go to the confirm order pager and keep the subtotal price in a temporal field, wait for the thanks you page and then when and only when this thank you page has been called, get the value of the subtotal field and asign a subtotal aproved order status field and use it to do whatever you need.

I found this bits of info in other related posts:


Re: Is there a 'Thank You Page' after Purchasing?
Postby josephisidor » Tue Aug 27, 2013 12:44 am

The last page visitors will get after a successful purchase is:

Make sure you select "Begins with" match type and do not use "%2f" in the goal url instead of "/" while setting up Goals.

You can also setup the Goal funnel using below two URLs.

Shopping Cart:

Goals and funnel are successfully tested in


The last page visitors will get after a successful purchase is:

You can edit the success.tpl and/or associated language files any way that you want.

I know my help is limited but it's all I can bring with my short knowladge.



Mon Dec 05, 2011 8:59 am
Who is online

Users browsing this forum: No registered users and 6 guests