[ic] Shipping soft goods with subtotal cost criteria
Chen Naor
chen at lilux.co.il
Fri Jan 2 02:18:44 EST 2004
>> I have a catalog that use shipping calculation according to the
>> total cost of the order.
>> It gives the customer a choice when the order is between 0-200,
>> 201-800 is only fast shipping,
>> 801 - over it free fast shipping.
>> Here is my shipping,asc:
>> I need to add soft goods, that have no shipping charge, the soft
>> goods should have no effect on
>> the shipping calculation.
>> I saw some examples on do it with weight criteria & quantity
>> criteria but this is a bit
>> different.
>> Any idea or directions?
>
> Here is a snippet from my shipping.asc file:
>
> USPS: USPS Ground
> criteria <<EOF
> [perl]
> my $total = 0;
> foreach my $item (@$Items) {
> next unless $item->{weight} > 0;
> $total += $item->{quantity} * $item->{weight};
> }
> return $total;
> [/perl]
> EOF
> min 0
> max 3
> cost x .0001
>
> min 3
> max 10
> cost x 2.4
>
> min 10
> max 20
> cost x 1.7
>
> min 20
> max 30
> cost x 1.2
>
>
> For my USPS Group method, you can see it "skips" items with a weight
> of '0', which my downloads have a weight of zero. So, the calc ends
> up only letting weighted items through to the shipping method.
> HTH
>
> Paul
Cool,
It can even solve the discount & dealer price with some modification.
maybe something like this:
[perl]
my $total = 0;
foreach my $item (@$Items) {
next unless $item->{weight} > 0;
$total += $item->{quantity} * $item->{price};
}
return $total;
[/perl]
It will check the weight field (for soft goods = 0) and if not will use the 'real' price for
the total field.
Thanks
Chen
More information about the interchange-users
mailing list