Home Integration Methods Wordpress ecommerce Plugin

Wordpress ecommerce Plugin

This integration was successfully tested on WP ecommerce plugin v 3.5 RC9. For integration follow these easy steps:
1
Click tracking code
First of all, you need to insert click tracking code into wp-content/themes/Your_Theme/footer.php

Insert your click tracking code before </body>  (click tracking code can be found inside merchant panel > tools > integration > click tracking code)
2
Edit template
In your wordpress installation, open and edit the file: wp-content/plugins/wp-e-commerce/transaction_result_functions.php

If you cannot find this file, try searching it in wp-content/plugins/wp-e-commerce/wpsc-theme/functions/wpsc-transaction_results_functions.php
3
Edit the file transaction_result_functions.php
Find this line of code:
4
Integration
Put following integration code ABOVE the line:
5
Newer version
In newer versions you have to use another approach. If you want to integrate Post Affiliate Pro search for the following:

echo "<br />" . nl2br(str_replace("$",'$',$message_html));

And then insert the following directly ABOVE that line:
6
Per product integration
If you want to track commissions per product, you can do it in the same file, but you have to follow these steps:
1. Find the line with code foreach ( $cart as $row ) {
2. Insert this code over it:
$id = 0;
echo '<script type="text/javascript">
      document.write(unescape("%3Cscript id=%27pap_x2s6df8d%27 src=%27" +
      (("https:" == document.location.protocol) ? "https://" : "http://") +
      "www.yoursite.com/affiliate/scripts/trackjs.js%27 type=%27text/javascript%27%3E%3C/script%3E"));
      </script>'."
      <script type=\"text/javascript\">
      ";


3. Insert this code below the line foreach ( $cart as $row ) {:
$id++;
echo "var sale".$id." = PostAffTracker.createSale();
        sale".$id.".setTotalCost('".($row['price']*$row['quantity'])."');
        sale".$id.".setOrderID('".$purchase_log['id']."_".$id."');
        sale".$id.".setProductID('".$row['prodid']."');";

The last step is to find line } // closes foreach cart as row
and to insert this code below that line:
echo "PostAffTracker.register();\n</script>";

This integration method is out of date.

2 years ago Doug Hardester
This method is out of date for the current version of WP E-Commerce.

If you want to integrate Post Affiliate Pro into the most recent version search for the following:

echo "<br />" . nl2br(str_replace("$",'$',$message_html));

And then insert the following directly ABOVE that line:

echo '<script id="pap_x2s6df8d" src="http://www.yoursite.com/affiliate/scripts/salejs.php" type="text/javascript"> </script>';
echo '<script type=\"text/javascript\">var sale = PostAffTracker.createSale();';
echo 'sale.setTotalCost('.$total.');';
echo 'sale.setOrderID('.$purchase_log['id'].');';
echo 'PostAffTracker.register();';
echo '</script>';

WP e-commerce

3 months ago on
This method is outdated - do you have instructions on integrating with the latest WP E-commerce release?

Any requests

3 months ago Martin Pullmann
In case you have any request or a question about the integration method, please send it to our support, so we can help you. We will need your personal details and access to your site to check the issue.