On 02/06/2008 11:03 AM, Matthew Dell wrote:
I have been trying to set a handling charge depending on how many items arein 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
_______________________________________________
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.