Matthew,
[calcn]
$Values->{mv_handling} = 1;
my $handling = scalar @$Items * 5;
$handling = 20 if $handling < 20;
$Tag->assign({ handling => $handling });
return;
[/calcn]
Actually Peter, this gives me only $20 for handling no matter how many itemsthere are in the cart. It should be $5 per item up to $20.
It looks like there's a minor typo in the code; it should be:
$handling = 20 if $handling > 20;
Cheers, David Christensen -- David Christensen End Point Corporation suppressed On Feb 11, 2008, at 7:08 PM, Matthew Dell wrote:
On 02/06/2008 11:03 AM, Matthew Dell wrote:I have been trying to set a handling charge depending on how many itemsarein 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 [assignhandling="20.00"] without the other stuff, but that would not add into theorder total.There are really two issues, getting the handling charge to calculate andadding 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, secondlyyou have to set the mv_handling value to a true value for handling to work, and thirdly that code is crap, try ... I will keep looking and working on this. Thanks M Dell Orlando, FL 32868 suppressed http://www.inthesuntech.com _______________________________________________ interchange-users mailing list suppressed http://www.icdevgroup.org/mailman/listinfo/interchange-users
_______________________________________________ interchange-users mailing list suppressed http://www.icdevgroup.org/mailman/listinfo/interchange-users
Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.