[ic] handling charges
Matthew Dell
mdell at inthesuntech.com
Mon Feb 11 20:08:35 EST 2008
On 02/06/2008 11:03 AM, Matthew Dell wrote:
> I have been trying to set a handling charge depending on how many items
are
> in the cart. But when I set
>
> [if]
> [item-quantity > 4]
> [assign handling="20.00"]
> [else]
> [tmp my_handling]5[/tmp]
> [tmp][perl]
> $Scratch->{"total_handling"} = $Scratch->{"my_handling"} * $Items ;
> [/perl]
> [/tmp]
>
> [assign handling="[scratch total_handling]"]
> [/else]
> [/if]
>
> It doesn't work and I cannot figure out why. I did set [assign
> handling="20.00"] without the other stuff, but that would not add into the
> order total.
>
> There are really two issues, getting the handling charge to calculate and
> adding the handling charge to the order total.
>
> Any suggestions are appreciated.
Lots of problems that I see, first off, $Items is an array reference,
and does not contain an integer that you can just multiply by, secondly
you have to set the mv_handling value to a true value for handling to
work, and thirdly that code is crap, try ...
[calcn]
$Values->{mv_handling} = 1;
my $handling = scalar @$Items * 5;
$handling = 20 if $handling < 20;
$Tag->assign({ handling => $handling });
return;
[/calcn]
Peter
Actually Peter, this gives me only $20 for handling no matter how many items
there are in the cart. It should be $5 per item up to $20.
I will keep looking and working on this.
Thanks
M Dell
Orlando, FL 32868
mdell at inthesuntech.com
http://www.inthesuntech.com
More information about the interchange-users
mailing list