Conversion code not working on succes page

ThemeBurn SupportForumsOpenCart ThemesPavilion OpenCart ThemeConversion code not working on succes page

This topic has been marked as not resolved.

Hi,

I’m installing a TradeTracker conversion pixel but the code won’t execute on the succes page.

I’ve tried to add it with the page builder but it doesn’t execute php scripts. Can you advice how to make this work?

Code for the succes page:

<?php
  include_once DIR_APPLICATION . '/model/TradeTracker.php';
  $ttConversion = new TradeTrackerConversion(
      empty($ttOrderID) ? '' : $ttOrderID,
      empty($ttSubtotal) ? '' : $ttSubtotal,
      'XXXXX',
      'XXXXX',
      null
    );
  ?>
</div>

Thanks!

February 25, 2015 at 3:32 pm #38702
You will need to register in order to post topics and read replies in the ThemeBurn.com support forums!
March 2, 2015 at 7:00 pm #38842

Hi,

It isn’t working. I have an alternative methode (script) but that also isn’t working. Point is that I can paste it in page builder but then the php echo commands won’t work and are not sending the order information to the affiliate.

This is the alternative script we can use, could you assist how to make it work in page builder or manualy?

<script type="text/javascript">
 var ttConversionOptions = ttConversionOptions || [];
 ttConversionOptions.push({
  type: 'sales',
  campaignID: 'XXXXXX',
  productID: 'XXXXXX',
  transactionID: '<?php echo $order_id; ?>',
  transactionAmount: '<?php echo $order_total; ?>',
  quantity: '1',
  email: '',
  descrMerchant: '',
  descrAffiliate: '',
  currency: ''
 });
</script>
<noscript>
 <img src="//ts.tradetracker.net/?cid=XXXXX&amp;pid=XXXXX&amp;tid=<?php echo $order_id; ?>&amp;tam=<?php echo $order_total; ?>&amp;data=&amp;qty=1&amp;eml=&amp;descrMerchant=&amp;descrAffiliate=&amp;event=sales&amp;currency=EUR" alt="" />
</noscript>
<script type="text/javascript">
 (function(ttConversionOptions) {
  var campaignID = 'campaignID' in ttConversionOptions ? ttConversionOptions.campaignID : ('length' in ttConversionOptions && ttConversionOptions.length ? ttConversionOptions[0].campaignID : null);
  var tt = document.createElement('script'); tt.type = 'text/javascript'; tt.async = true; tt.src = '//tm.tradetracker.net/conversion?s=' + encodeURIComponent(campaignID) + '&t=m';
  var s = document.getElementsByTagName('script'); s = s[s.length - 1]; s.parentNode.insertBefore(tt, s);
 })(ttConversionOptions);
</script>

March 2, 2015 at 9:53 pm #38847

Hi,

PHP wont work in Page Builder, so you will have to either use a pure JS solution or modify the template directly.

Can you try to put the second code snippet in the place we’ve suggested in our first post?

BR,
ThemeBurn team

March 6, 2015 at 4:38 pm #39026

In this case PHP doesn’t work in the template either. Thanks for your advise. I’ll look at a JS solution.

BR
John

April 15, 2015 at 10:41 am #40010

Hi,

Please, post your JS solution here after you are done.

Thanks,
ThemeBurn team

April 20, 2015 at 6:41 pm #40222
Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.