Ubercart integration
An exciting open source e-commerce shopping cart that fully integrates your online store with Drupal.
Integration of Ubercart by integration of Thank you page and also a solution for Ubercart using PayPal.
Locate the settings
Go to Administer > Store administration > Configuration > Checkout settings > Edit > Checkout messages
Integration code for thank you page
Add this code to Checkout completion message header:
<script id="pap_x2s6df8d" src="https://URL_TO_PostAffiliatePro/scripts/trackjs.js" type="text/javascript"></script>
<script type="text/javascript">
var sale = PostAffTracker.createSale();
sale.setTotalCost('[uc_order:subtotal]');
sale.setOrderID('[uc_order:order-id]');
sale.setProductID('[uc_order:products]');
PostAffTracker.register();
</script>
Change Input format in ‘Checkout completion message header‘ to Full HTML.
Do not forget to save your changes.
Using PayPal in Ubercart
If you are using PayPal as a payment gateway in your Ubercart, it is better to integrate it directly.
Edit file sites/all/modules/ubercart/payment/uc_paypal/uc_paypal.module – find the function uc_paypal_wps_form() and put this code just after the line with code:
‘notify_url’ =>
'custom' => $_COOKIE['PAPVisitorId'],
Now, edit the file sites/all/modules/ubercart/payment/uc_paypal/uc_paypal.pages.inc and find the function uc_paypal_ipn() - put the following code below the function line:
/* Post Affiliate Pro integration snippet */
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://URL_TO_PostAffiliatePro/plugins/PayPal/paypal.php");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $_POST);
curl_exec($ch);
/* /Post Affiliate Pro integration snippet */
Do not forget to save your changes.