[ic] Shipping soft goods with subtotal cost criteria
Paul Jordan
paul at gishnetwork.com
Thu Jan 1 12:27:47 EST 2004
interchange-users-bounces at icdevgroup.org wrote:
> Hello,
>
> 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:
>
> fast FAST_MAIL [subtotal noformat=1] 0 0 e
> Nothing to ship!
> {'ui_ship_type' => "_subtotal",'ups' => "0",'at_least' =>
> "0",'PriceDivide' => "1",} fast FAST_MAIL [subtotal noformat=1]
> 0 800 25 {'PriceDivide' => "1",}
> fast FAST_MAIL [subtotal noformat=1] 801 9999999 0
> {'PriceDivide' => "1",}
> normal MAIL [subtotal noformat=1] 0 0 e Nothing
> to ship! {'ui_ship_type' => "_subtotal",'ups' => "0",'at_least' =>
> "0",'PriceDivide' => "1",} normal MAIL [subtotal noformat=1]
> 0 200 10 {'PriceDivide' => "1",}
>
> 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?
>
> Thanks,
>
> Chen Naor
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
More information about the interchange-users
mailing list