Home Integration Methods osCommerce

osCommerce

Integration with osCommerce is made by placing sale tracking script into the confirmation page. To obtain the values of OrderID and TotalSale, snippet connects to osCommerce database and retrieves the values from there.
1
Find file checkout_success.php
Find and open file checkout_success.php in osCommerce source files.
2
Locate right place for integration
Inside the file find this line if ($global['global_product_notifications'] != '1') { ...
it should be somewhere after  <! DOCTYPE ........> line.
3
Add integration code
insert the following code just above that line

4
Integration is finished
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.
5
Another integration
If you plan to divide products into more campaigns, you will probably need another integration, that will divide the whole sale into single product sales.

6
Direct PayPal integration with osCommerce
If you want to rely on PayPal IPN (as this is secure and 100% sure that the transaction will be recorded), you can directly edit the PayPal button template in osCommerce. Login to your FTP and navigate to
catalog/includes/modules/payment/
and edit file paypal_standard.php
Find function process_button and scroll down to end of it. You should find this block of code:
This will add tracking script directly to the paypal button and insert proper value into custom parameter.

Now, you have to resend the IPN from osCommerce to PAP too. See the next step.
7
PayPal redirect to PAP
When there is a sale, PayPal sends IPN to your osCommerce. You have to resend it to PAP to save the transaction. Navigate to catalog/ext/modules/payment/paypal/ in your FTP and modify file standard_ipn.php . Insert the following code to the beginning of the file:
The last step is to modify customer ID saved in custom field, to the the value without PAP4 visitor ID. Find line
if ($result == 'VERIFIED') {
and add the following code above the line:
$separator = '||';
    if ($_POST['custom'] != '') {
      $explodedCustomValue = explode($separator, $_POST['custom'], 2);
          if (count($explodedCustomValue) == 2) {
            $_REQUEST['custom'] = $_POST['custom'] = $explodedCustomValue[0];
            $HTTP_POST_VARS['custom'] = $explodedCustomValue[0];
      }
    }

Integration doubt

3 years ago Anandkumar
Hi,

I am finding the "if ($global['global_product_notifications'] != '1')" link two places on the checkout_success.php" file, could you please advice me where i need to place the script exactly.

Thanks,
Anand

Re-Visitor

3 years ago sTu
What happens, when a customer, who was once registered as an affiliate custumer returns to the confirmation page without clicking on the affiliate link before.

Two occurrences of code from step 2

3 years ago Martin Pullmann, Q.U.
If you can see two occurrences, then it should be enough to insert integration code only once there. If it will not work, then please contact us and we will revise it.

When customer is back

3 years ago Martin Pullmann, Q.U.
When cookies are saved then customer - as a registered affiliate - will not get commissions, but the original referrer.

Second occurrence of line

3 years ago Martin Pullmann, Q.U.
I revised it and it have to be the second occurrence - the one that is somewhere after <! DOCTYPE ........> line.

Is the fix also applicible to OSC Merchant 2.3 ?

1 years ago David
I have Merchant 2.3 .. just wondering if the fix is the same ?