#1007 Embedding affiliate code into the success page

Posted in ‘Technical Support / Bugs’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

J2Commerce

Version
J2Commerce v6

Latest post by Adam Melcher on Sunday, 06 September 2026 20:12 UTC

Richard Gosler

I need to embed the following affiliate code into the order success page:

<script type="text/javascript">
window.goaffpro_order = {
number : "#1001",
total: 1000
}
if(typeof window.goaffproTrackConversion !== "undefined"){
window.goaffproTrackConversion(window.goaffpro_order)
}
</script>

1. which template do need to edit to create an override on to do this ?

2a. what values do i insert for the order number? (currently #1001)

2b. what values do i insert for the order total? (currently 1000)

 

 

Olivier

Hi Richard,

I believe you should do this in the success/thank you page. That is, the confirmation view. For instance, if you were using Bootstrap, it would be

components/com_j2commerce/tmpl/confirmation/bootstrap5/default.php

You would then use the code

<?php if (!$isCancelled) : ?>
    <script type="text/javascript">
        window.goaffpro_order = {
            number : "#<?php echo (int) $order->order_id; ?>",
            total: <?php echo (float) $order->order_total; ?>
        }
        if(typeof window.goaffproTrackConversion !== "undefined"){
            window.goaffproTrackConversion(window.goaffpro_order)
        }
    </script>
<?php endif; ?>

Olivier.

Growing Together

Help us get back to #1 in the Joomla Extension Directory by leaving us a 5-Star review here.

Richard Gosler

I tried to create an override through Joomla's override engine but it's blocked. And the overrides accessible through J2C are only for product and category templates. Is there a way to create the override without it being overwritten during the next update ?

I get the following error message when i try to access it: 20 Joomla\Filesystem\Path::check() - Snooping out of bounds @ com_j2commerce/app_bootstrap5

Thanks.

Richard Gosler

Template overridden now.  Bug in J6.1.3 but there's a fix until J6.1.4.

 

 

Adam Melcher

Richard,

Yes, that was a bug I passed along to Brian the first day it was released... very annoying to have to do anything by hand these days... lol

 

Adam

Growing Together

Help us get back to #1 in the Joomla Extension Directory by leaving us a 5-Star review here.

Stay Updated

Subscribe for free and be the first to know about the latest features, updates, and new additions.