Home Integration Methods OpenCart 2

OpenCart 2

This is integration method for open source shopping cart OpenCart. The integration is done by integrating files of thank you page.

You can track per product orders, lifetime commissions and also coupons.
1
Edit confirm action
Navigate to your cart directory catalog\controller\checkout\ and open confirm.php for editing. Find this line: 
$data['totals'] = array();
Put this code below that line:
Save these files and continue with next step.
2
Edit success action
Open file catalog/controller/checkout/success.php and find this line (first occurrence):
if ($this->customer->isLogged()) {
Place the following code above that line:
Again, do not forget to save the changes and continue to the next integration step.
3
Whole cart as one transaction - Edit success view
If you want to process the whole payment as one transaction in PAP, follow this step. If you want to create one transaction for every product, continue to step 4.

Open file catalog/view/theme/default/template/common/success.tpl

Add these lines before the last line which says "echo $footer;":
Save the file and your shop is integrated.

Note:
The values of  'Coupon' and 'Voucher' are negative, that is why we are directly adding it to the subtotal value.
4
One transaction per product - Edit success view
This step is not necessary if you already used step 3.

Open file catalog/view/theme/default/template/common/success.tpl

Add these lines before the last line which says "echo $footer;":
This will register a commission per each ordered product.
Do not forget to integrate your cart with the click tracking to make the sale tracking work. You can place the click tracking code to the theme footer file:
catalog/view/theme/YOUR_THEME/template/common/footer.tpl