Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Recommended Posts

Posted

Does anyone here tried integrating post affiliate pro sales tracking to their oscommerce website? I have tried integrating and it doesn't seem to work. I've followed all the instructions but it seems that their integration code doesn't run at all.

 

this is the code i get from my merchant panel

 

 

 

//--------------------------------------------------------------------------

// integration code

//--------------------------------------------------------------------------

// get order id

$sql = "select orders_id from ".TABLE_ORDERS.

" where customers_id='".(int)$customer_id.

"' order by date_purchased desc limit 1";

$pap_orders_query = tep_db_query($sql);

$pap_orders = tep_db_fetch_array($pap_orders_query);

$pap_order_id = $pap_orders['orders_id'];

 

// get total amount of order

$sql = "select value from ".TABLE_ORDERS_TOTAL.

" where orders_id='".(int)$pap_order_id.

"' and class='ot_subtotal'";

$pap_orders_total_query = tep_db_query($sql);

$pap_orders_total = tep_db_fetch_array($pap_orders_total_query);

$pap_total_value = $pap_orders_total['value'];

 

//get product ids

$sql = "select products_id from " .TABLE_ORDERS_PRODUCTS.

" where orders_id=".(int)$pap_order_id;

$pap_orders_products_query = tep_db_query($sql);

$pap_orders_products = '';

while ($row = tep_db_fetch_array($pap_orders_products_query)) {

$pap_orders_products .= $row['products_id'] . ',';

}

$pap_orders_products = substr($pap_orders_products, 0, -1);

 

// draw invisible image to register sale

if($pap_total_value != "" && $pap_order_id != "")

{

print '<script type="text/javascript">

document.write(unescape("%3Cscript id=%27pap_x2s6df8d%27 src=%27" + (("https:" == document.location.protocol) ? "https://" : "http://") + "mydomain.com/partners/scripts/trackjs.js%27 type=%27text/javascript%27%3E%3C/script%3E"));

</script>

'."<script type=\"text/javascript\">PostAffTracker.setAccountId('default1');

 

var sale = PostAffTracker.createSale();

sale.setTotalCost('$pap_total_value');

sale.setOrderID('$pap_order_id');

sale.setProductID('$pap_orders_products');

 

PostAffTracker.register();

</script>";

}

//--------------------------------------------------------------------------

// END of integration code

//--------------------------------------------------------------------------

  • 4 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...