Order Completion Page : Help!?¿

Hey Guys,

On my site we have a afiliate program that is managed by a third party called Webgains, they have a script that needs to be put on the order completion page so that they can track orders, however I cant seem to get it to work on the completion page.

Was wondering if someone/anyone could tell me where im going wrong. Here is the source code that they gave me:

<br />
<?<br />
    //------------------------------- WEBGAINS CODE ----------------------------<br />
	$wgOrderReference = rawurlencode(ORDER NUMBER HERE);<br />
	$wgComment= ''; // optional<br />
	$wgMultiple=1; //  optional - should contain pipe separated list of shopping basket items. Fields for each item are seperated by double colon.<br />
				   //  First field is commission type ,  second field is price of item, third field (optional) is name of item, fourth field (optional) is product code/id, fifth field (optional) is voucher code. Example for two items; items=1::54.99::Harry%20Potter%20dvd::hpdvd93876|5::2.99::toothbrush::tb287::voucher1    */<br />
	$wgCustomerID= ''; // please do not use without contacting us first<br />
	$wgProductID= '';  // please do not use without contacting us first<br />
	$wgSLang = 'php';  // string, used to identify the programming language of your online systems. Needed because url_encoding differs between platforms.<br />
    $wgEventID=1111;   // this identify's the commission type (in account under Program Setup (commission types))<br />
	$wgLang = 'en_GB';// string, used to identify the human language of the transaction<br />
	$wgOrderValue = number_format(($order[0]['total'] - $order[0]['shipping']), 2);<br />
	$wgPin = 1111;	  // pin number provided by webgains (in account under Program Setup (program settings -> technical setup))<br />
	$wgProgramID = 111; // int, used to identify you to webgains systems<br />
	$wgItems= rawurlencode($wgItems);<br />
	$wgVoucherCode = rawurlencode(?DISCOUNT CODE USED); // string, used to store the voucher code used for transaction<br />
	$wgVersion = '1.2';<br />
	$wgSubDomain="track";<br />
	$wgCheckString ="wgver=$wgVersion&wgsubdomain=$wgSubDomain&wglang=$wgLang&wgslang=$wgSLang&wgprogramid=$wgProgramID&wgeventid=$wgEventID&wgvalue=$wgOrderValue&wgorderreference=$wgOrderReference&wgcomment=$wgComment&wgmultiple=$wgMultiple&wgitems=$wgItems&wgcustomerid=$wgCustomerID&wgproductid=$wgProductID&wgvouchercode=$wgVoucherCode";<br />
	$wgCheckSum=md5($wgPin.$wgCheckString); # make checksum<br />
	$wgQueryString = $wgCheckString."&wgchecksum=$wgCheckSum";<br />
	$wgUri = '://'.$wgSubDomain.".webgains.com/transaction.html?".$wgQueryString;<br />
?><br />
<script language="javascript" type="text/javascript"><br />
if(location.protocol.toLowerCase() == "https:") wgProtocol="https";<br />
else wgProtocol="http";<br />
wgUri = wgProtocol + "<?php echo($wgUri);?>" + "&wgprotocol=" + wgProtocol + "&wglocation=" + location.href;<br />
document.write('<sc'+'ript language="JavaScript"  type="text/javascript" src="'+wgUri+'"></sc'+'ript>');<br />
</script><br />
<noscript><br />
<img src="https://<?php echo($wgSubDomain);?>.webgains.com/transaction.html?wgver=<?php echo($wgVersion);?>&wgrs=1&wgsubdomain=<?php echo($wgSubDomain);?>&wglang=<?php echo($wgLang);?>&wgslang=<?php echo($wgSLang);?>&wgprogramid=<?php echo($wgProgramID);?>&wgeventid=<?php echo($wgEventID);?>&wgvalue=<?php echo($wgOrderValue);?>&wgorderreference=<?php echo($wgOrderReference);?>&wgcomment=<?php echo($wgComment);?>&wgmultiple=<?php echo($wgMultiple);?>&wgitems=<?php echo($wgItems);?>&wgcustomerid=<?php echo($wgCustomerID);?>&wgproductid=<?php echo($wgProductID);?>&wgvouchercode=<?php echo $wgVoucherCode; ?>&wgchecksum=<?php echo($wgCheckSum);?>&wgprotocol=https" alt="" width="1" height="1"/><br />
</noscript><br />

```<br />
<br />
Any help would be appreciated.<br />
<br />
Thank, <br />
<br />


Insert this code after "

{assign var=system_confirmation value=$confirmation}
{assign var=system_controller value=$controller}
{assign var=system_mode value=$mode}

$system_confirmation = $this->get_template_vars('system_confirmation');// GRAB ORDER CONFIRMATION (Y / N)
$system_controller = $this->get_template_vars('system_controller');// GRAB SMARTY CONTROLLER VALUE ($controller)
$system_mode = $this->get_template_vars('system_mode');// GRAB SMARTY MODE VALUE ($mode)


if ($system_controller == “orders” && $system_mode == “details” && $system_confirmation == “Y”)






Thanks for that.

Is there a different way of referencing the hooks from within the PHP code or can it still be done with “$order_info.display_subtotal” etc?