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:


//------------------------------- WEBGAINS CODE ----------------------------
$wgOrderReference = rawurlencode(ORDER NUMBER HERE);
$wgComment= ''; // optional
$wgMultiple=1; // optional - should contain pipe separated list of shopping basket items. Fields for each item are seperated by double colon.
// 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 */
$wgCustomerID= ''; // please do not use without contacting us first
$wgProductID= ''; // please do not use without contacting us first
$wgSLang = 'php'; // string, used to identify the programming language of your online systems. Needed because url_encoding differs between platforms.
$wgEventID=1111; // this identify's the commission type (in account under Program Setup (commission types))
$wgLang = 'en_GB';// string, used to identify the human language of the transaction
$wgOrderValue = number_format(($order[0]['total'] - $order[0]['shipping']), 2);
$wgPin = 1111; // pin number provided by webgains (in account under Program Setup (program settings -> technical setup))
$wgProgramID = 111; // int, used to identify you to webgains systems
$wgItems= rawurlencode($wgItems);
$wgVoucherCode = rawurlencode(?DISCOUNT CODE USED); // string, used to store the voucher code used for transaction
$wgVersion = '1.2';
$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";
$wgCheckSum=md5($wgPin.$wgCheckString); # make checksum
$wgQueryString = $wgCheckString."&wgchecksum=$wgCheckSum";
$wgUri = '://'.$wgSubDomain.".webgains.com/transaction.html?".$wgQueryString;


Any help would be appreciated.




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?