Integration with 1ShoppingCart is made by placing sale tracking script into the thank you page.

1.

Edit your thank you page

In case you are using the built-in thank you page, please continue to step 4.

1ShoppingCart allows you to have your own custom thank you page. To set it up, navigate to Setup > Orders and set the "Thank You URL" field to the full URL address leading to your custom url page.

E.g.:
http://www.domain.com/thankyou/ will not work
http://www.domain.com/thankyou/index.php does work

2.

Sale tracking

Put the following code (in case that your page is in PHP) right before row with text </body> (or somewhere at the end of page body).


<script type="text/javascript">
var sale = PostAffTracker.createSale();
sale.setTotalCost('<?php echo $_POST['Total']; ?>');
sale.setOrderID('<?php echo $_POST['orderID']; ?>');

PostAffTracker.register();
</script>

3.

Per product tracking

Put the following code (in case that your thank you page is in PHP) right before line with text &lt;/body&gt;


<script type="text/javascript">

<?php
$i = 0;
foreach($_POST as $key=>$value){
  if(preg_match('/product(d )/',$key)){
    $i  ;
  }
}

for($j = 1; $j<= $i; $j  ){
  echo "var sale" . $j . " = PostAffTracker.createSale();n";
  echo "sale" . $j . ".setTotalCost('" . ($_POST['price'.$j] * $_POST['quantity'.$j]) . "');n";
  echo "sale" . $j . ".setOrderID('" . addslashes($_POST['orderID']) ."');n";
  echo "sale" . $j . ".setProductID('" . addslashes($_POST['product'.$j]) ."');n";
}
?>
PostAffTracker.register();
</script>

If you want to track product ID as SKU numbers, you can call it as $_POST['sku'.$j]

If you want to track customer email (for lifetime commissions) you can use $_POST['email1']

4.

Recurring commissions tracking

Using 1ShoppingCart notifications it is possible to track recurring commissions as well. To do so, you have to activate the 1ShoppingCart plugin in your Post Affiliate Pro and then set this URL in your 1ShoppingCart admin panel:

http://URL_TO_PostAffiliatePro/plugins/OneShoppingCart/oneshoppingcart.php

Do not forget to configure the plugin based on your 1ShoppingCart API details.

5.

Integration of built in Thank you page

In case you use the built-in Thank You page, you have to use Third-Party Integrations section (Setup> Third-Party Integrations) which allows you to insert a custom code to the Thank You page. Just copy the following code and use it in HTML Body Section Bottom:


<script type="text/javascript">
var papOrderObject = SecureCartOrders[0];
var sale = PostAffTracker.createSale();
sale.setTotalCost(papOrderObject.Total);
sale.setOrderID(papOrderObject.orderID);

PostAffTracker.register();
</script>

Save your work and you are done.

It is now integrated. Every time customer enters the order confirmation page, the tracking code is called, and it will register a sale for referring affiliate.

Do not forget to integrate your site with the click tracking code.