Any comments, suggestions, or mistakes: smiles@groundbreak.com

Integrating Ultimate Affiliate with older versions of Modernbill

Before you begin, it's always best to be running the most current version of modernbill as older versions might not have the ability to integrate with Ultimate Affiliate as described below.

Also, this integration method hasn't had a thorough testing with modernbill, so there may be some changes to it in the future. If you have any comments or techniques, please send them to smiles@groundbreak.com so I can include them on this page. Thanks - Steve

Editing ModernBill

In your modernbill directory, you'll edit the php script:

/order/include/cases/step_submit_process.case.php

In that script, you'll find these lines:

<!-- REMOVE THIS LINE WHEN ACTIVE
<tr>
<td colspan=2 bgcolor=<?=$tablebgcolor?>>
<?
// INSERT AFFILIATE CODE HERE
// $invoice_amount
// $invoice_id
// $order_totals['sub_total']
// $order_totals['pre_tax']
// $order_totals['tax_due']
// $order_totals['post_tax']
?>
</td>
</tr>
REMOVE THIS LINE WHEN ACTIVE -->

While it seems that this tag is in most of the versions of ModernBill I've seen, sometimes the $order_totals variables don't seem to work. You should try them first, and then if all else fails, use: $cart[order_total]

if you own your own secure server certificate, meaning you can have https://www.yoursite.com, you can use the image tag method and change the entire chunk of code above to:

<tr>
<td colspan=2 bgcolor=<?=$tablebgcolor?>>
<?
print<<<EOF
<img src="https://www.yoursite.com/cgi-bin/affiliates/sale.cgi?secret=SECRET
&cashflow=$cart[order_total]&goods=$invoice_id" border=0>
EOF;
?>
</td>
</tr>


If you don't have your own secure certificate, you might have to use the javascript popup method:

 

<tr>
<td colspan=2 bgcolor=<?=$tablebgcolor?>>
<?
print<<<EOF
<script language="JavaScript">
<!--start
function noelPopup()
{
var popupURL = "http://www.yoursite.com/cgi-bin/affiliates/sale.cgi?secret=SECRET
&cashflow=$cart[order_total]&goods=$invoice_id";
var popup = window.open(popupURL,"Popup",'toolbar=0,location=0,directories=0,status=0,
menubar=0,scrollbars=0,resizable=0,width=300,height=100');
if( navigator.appName.substring(0,8) == "Netscape" )
{
popup.location = popupURL;
}
}
noelPopup();
// -->
</script>
EOF;
?>
</td>
</tr>

Make sure you connect some of the lines above that are split on multiple lines for the sake of fitting into this web page.


Note that right now the script will be calculating this commission on the INITIAL PURCHASE. It doesn't have any connection with ModernBill for recurring commissions so you will have to have the affiliate script recur the commission if need be. In later versions of Modernbill you can have their system trigger the recurring commissions, but in older versions the only access you have to triggering a commission is ONCE on the INITIAL sale...


Another tip is a little trick to let you "reload" the final ModernBill page that triggers the commission. This is the page that will give the buyer the paypal, 2checkout, etc...buttons to finish the order - but realize that the commission is triggered on that page too. (View the source of the page and you'll find the code you added).

If you try to reload that page, it will normally say "order already finished" and won't let you do anything. However, in the file if you comment out these lines:

if ($order_completed) {
vortech_HTML_start(7);
display_error(DUPLICATEORDER);
vortech_HTML_stop(7);
if (!$debug) { exit; }
}

by putting a // in front of each line it will let you reload that page over and over to test commissions.



© 1998 - present Groundbreak.com, All Rights Reserved