> ## Documentation Index
> Fetch the complete documentation index at: https://support.tapfiliate.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Integrating with OpenCart

> Learn how to integrate Tapfiliate with OpenCart.

November 9, 2026

Integrating Tapfiliate with OpenCart lets you track conversions and commissions based on order amounts for your online store.\
\
To get started:

1\. Log in to your OpenCart admin panel, navigate to **Design > Theme Editor > Common > header.twig**. Just before the closing **`</head>`** tag, insert the provided code snippet below and click the "**Save**" button.

```html theme={null}
<script src="https://script.tapfiliate.com/tapfiliate.js" type="text/javascript" async></script>
<script type="text/javascript">
    (function(t,a,p){t.TapfiliateObject=a;t[a]=t[a]||function(){
    (t[a].q=t[a].q||[]).push(arguments)}})(window,'tap');

    tap('create', 'YOUR ACCOUNT ID', { integration: "opencart" });
    tap('detect');
</script>
```

Be sure to replace '**YOUR ACCOUNT ID**' with your actual account ID.

2\. Next, proceed to **Design > Theme Editor > Common > success.twig**. Place the following code after **`#{{ header }}`**.

```html theme={null}
<script src="https://script.tapfiliate.com/tapfiliate.js" type="text/javascript" async></script>
{% if orderDetails %}
<script type="text/javascript">
    (function(t,a,p){t.TapfiliateObject=a;t[a]=t[a]||function(){
    (t[a].q=t[a].q||[]).push(arguments)}})(window,'tap');

    tap('create', 'YOUR_ACCOUNT_ID_HERE', { integration: "opencart" });
    tap('conversion', "#{{ orderDetails.id }}", #{{ orderDetails.amount }});
</script>
{% endif %}
```

Make sure to replace '**YOUR ACCOUNT ID'** with your actual account id.

3\. Lastly, on your server, locate **catalog/controller/checkout/success.php**. Insert the provided code snippet right after **`$this->load->language('checkout/success');`**

```php theme={null}
    if (isset($this->session->data['order_id'])) {
        $this->load->model('checkout/order');
        $order_id = $this->session->data['order_id'];

        $order_data = $this->model_checkout_order->getOrder($order_id);
        $sub_total = '0';
        foreach ($this->model_checkout_order->getOrderTotals($order_id) as $total) {
            if ($total['code'] == 'sub_total') {
                $sub_total = $total['value'];
            }
        }

        $orderDetails = array(
            "id" => $order_data['order_id'],
            "amount" => $sub_total,
            "currency" => $order_data['currency_code'],
        );

        $data['orderDetails'] = $orderDetails;
    }
```

4\. **Save** your changes, and you're all set!

Please remember to conduct a conversion test before launching your program. This step will help you confirm that tracking has been correctly established. You can create a test conversion by following the steps [described here](https://support.tapfiliate.com/integrations/test-your-integration/how-to-validate-your-tracking.md).

## Which version of OpenCart does your integration support?

This integration only supports Opencart 3. Prior versions are not supported.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.