[ic] Set minimum shipping weight

Kevin Old interchange-users@icdevgroup.org
Mon Apr 14 16:40:01 2003


Hello everyone,

I am trying to set the minimum shipping weight for the total order. 
Each of my items are 1/2lb in weight.  If the user has a total weight of
less than 1 in their cart, I need the total weight of the cart to be
rounded up to 1.  Sounds simple, but I've tried the following:

Tried the suggestions here:
http://www.icdevgroup.org/pipermail/interchange-users/2001-June/009223.html

Modified them a little like this:

[seti total_weight][summary format="%s" total=1][/seti]
[if scratch total_weight <= 1]
        [seti name=weight value="1"][/seti]
[/if]

and tried it via Perl:

[perl]

if($Scratch->{weight} < '1') {
        return $Scratch->{weight} = 1;
}

[/perl]


Any ideas?  You might ask why I'm doing this....well, I've written a
user tag for USPS to query their rates (just like UPS and Fedex) and
they don't accept anything lower than a pound.  Once I get all the kinks
worked out, I'll post the USPS tag.  It actually works quite nice, but
the weight issue is a big bug.

Thanks,
Kevin
-- 
Kevin Old <kold@carolina.rr.com>