
[Date Prev][Date Next][Thread Prev][Thread Next][Interchange by date
][Interchange by thread
]
[ic] Totally items in cart
I have added a 'shipping' field to the standard demo products table. I am
attempting to total the shipping values of all the items in the cart when a
person views their shopping cart. This is my code:
<snip>
[perl arg="carts"]
$ship_total = 0;
# Loop over all items in the main cart
foreach my $item ( @{$Safe{'carts'}->{'main'}} )
{
# Total up all the shipping costs
$ship_total = $ship_total +
$item->{'shipping'};
}
return ("Shipping: $ship_total");
[/perl]
</snip>
This returns 'Shipping: 0'. Am I doing something wrong with my calculation?
Any help is greatly appreciated.
Chad
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
____
| | |\ | || Chad M. Wittrock (Chad.Wittrock@uni.edu)
\__/ | \| _||_ University of Northern Iowa
_______________________________________________
interchange-users mailing list
interchange-users@interchange.redhat.com
http://interchange.redhat.com/mailman/listinfo/interchange-users