[ic] commissions

Cameron interchange-users@icdevgroup.org
Sun Jan 12 13:17:01 2003


yeah, i did this.

it was all fairly simple. just use the standard affiliates stuff, and when
an order is placed, it'll get tagged with the appropriate affiliate's code.
Then, in pages/affiliates/index.html stick this lump of code:

<TR>
        <TH ALIGN=RIGHT VALIGN=top>
        Your sales statistics
        </TH>
        <TD>
[perl tables="products orderline"]
my $affiliate = $Session->{values}{mv_username};
my @OUT, %totals;
my $results = $Tag->query({sql => 'select * from orderline'});
for (@{$results}) {
        if ($_->[19] =~ /$affiliate/) {
                $a = substr ($_->[15], 0, 6);
                $totals{$a} += $_->[9];
        }
}
my $month;

foreach $month ( keys %totals ) {
    undef $string;
    my $string .= "Total for $month ";
    my $sold = $totals{$month};
        $string .= '$' . "$sold";
        my $com = $sold * .05;
   $string .= " Commission earnt " . '$' . "$com<br>";
   push @OUT,$string;
}

return join '',@OUT;
[/perl]
        </TD>
</TR>

It's a long way from perfect, but it'll show you what you need to know.


----- Original Message -----
From: "Avi Mozes" <amozes@hotmail.com>
To: <interchange-users@icdevgroup.org>
Sent: Wednesday, December 18, 2002 9:40 PM
Subject: [ic] commissions


> Hi all,
> I'm just getting acquainted with Interchange and I am loving it!  I was
> wondering if there's anyone out there who has written a hook for using and
> calculating commissions for the sales.  If you have, I would appreciate
> either some pointers on doing this and/or code for this :)
>
> Thank you so much in advance.
>
> Avi
> amozes@hotmail.com
>
>
>
>
>
> _________________________________________________________________
> Tired of spam? Get advanced junk mail protection with MSN 8.
> http://join.msn.com/?page=features/junkmail
>
> _______________________________________________
> interchange-users mailing list
> interchange-users@icdevgroup.org
> http://www.icdevgroup.org/mailman/listinfo/interchange-users