[ic] how to find weight for items in cart for shipping criteria
Akash Shah
ic_user at hotmail.com
Tue Aug 17 01:06:53 EDT 2004
hi,
IC 5.2.0 - foundation based catalog
I'm trying to add an offset to my shipping calculation. The reason to add
the offset is to calcualte the weight for the shipping box. The reason to do
this is because there are some items which ship for free and so have weight
0 and I don't want to add the offset to them. Here is the code I have in my
shipping.asc
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
USPSROLLED: USPS Priority Mail
criteria <<EOF
[perl]
my $total = 0;
my $tmp_weight = 0;
foreach my $item (@$Items) {
$tmp_weight = $Tag->field('weight', $item->{code} );
next unless $tmp_weight > 0;
$total += $item->{quantity} * $tmp_weight ;
}
if ($total > 0) {
$total += 1.0;
}
return $total;
[/perl]
EOF
min 0
max 0
cost e Free Shipping!
min 0
max 5
cost u
table USPSPriority
geo zip
default_geo xxxxx
adder 1
min 5
max 9999999
cost e Error!
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
The issue here is that, I cannot access the weight for each individual item.
It is not stored in the cart along with each item and trying to call [data]
or [field] is throwing errors.
/cgi-bin/xxx/admin/test_code.html Safe: no access for database products at
/usr/local/interchange-5.2.0/lib/Vend/Data.pm line 1036.
Any suggestions on how to get weight of each item in the code segment above
?
Thx
-Akash
_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today - it's FREE!
hthttp://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
More information about the interchange-users
mailing list