[ic] UPSE Online, special handling charge, adder

Rick Bragg lists at gmnet.net
Sat Aug 22 22:23:15 UTC 2009


On Thu, 2009-08-20 at 20:43 -0400, DB wrote:
> > On Wednesday 19 November 2008 12:33:48 pm Steve Graham wrote:
> >> Hello,
> >>
> >> We have a few items in our inventory that require a large/irregular box,
> >> and causes a surcharge from UPS due to box size.
> >>
> >> I am considering adding a field to the products file to flag these items,
> >> and if there is at least one item on an order that requires the special
> >> box size then add on a flat surcharge to the shipping fee.  I don't want
> >> to add the surcharge per item, just 1 time if any flagged items are on
> >> the order.
> >>
> >> Has anyone done something like this, any suggestions?
> >> I was thinking  the adder in shipping.asc might work, but not sure.
> > 
> > Steve,
> > 
> > An adder in shipping.asc is a good idea, but would require modification to 
> > every shipping method. You could build it into the handling system, and 
> > that would only have to be defined one time, but that's not something I 
> > would find desirable.
> > 
> > The way I've done this before is to use SpecialSub shipping_callout. This 
> > feature allows you to build a GlobalSub that takes the existing shipping 
> > amount, checks the cart for applicable items, then adds the fee. Whatever 
> > customizations you need will automatically apply to every shipping method. 
> > For example (untested):
> > 
> > # A perly true value in 'products.oversized' field adds UPS fee.
> > AutoModifier oversized
> > 
> > Variable UPS_OVERSIZED_FEE 25.00
> > 
> > Sub custom_shipping <<EOS
> > sub {
> >     my ($final, $mode, $opt, $o) = @_;
> >     
> >     $final += $Variable->{UPS_OVERSIZED_FEE}
> >         if grep {$_->{oversized}} @$Items;
> > 
> >     return $final;
> > }
> > EOS
> > 
> > SpecialSub shipping_callout custom_shipping
> > 
> > --
> > Daniel Browning
> > End Point Corporation
> > http://www.endpoint.com/
> 
> I finally got around to trying this and it indeed works. Thanks!
> 
> I'm now wondering how this could be modified to add the
> UPS_OVERSIZED_FEE for each item in the cart which has products.oversized
> set to 1. For example if the cart contains qty 2 of one such item and
> qty 3 of another, then add  5 * UPS_OVERSIZED_FEE
> 
> I'm no perl guru as you'll now see, but maybe something like this (no
> laughing please)
> 
> ================
>  AutoModifier oversized
> 
>  Variable UPS_OVERSIZED_FEE 25.00
> 
>  Sub custom_shipping <<EOS
>  sub {
>      my ($final, $mode, $opt, $o) = @_;
> 
> # start my hack
> my $oversize_qty=0;
> foreach my $item (@$Items)
>  {
>  $current_quantity = $item->{quantity};
>  $oversize_qty=$oversize_qty + $current_quantity;
>  }
> 
>     $final += $Variable->{UPS_OVERSIZED_FEE} * $oversize_qty
> # end my hack
> 
>          if grep {$_->{oversized}} @$Items;
> 
>      return $final;
>  }
>  EOS
> 
>  SpecialSub shipping_callout custom_shipping
> ===================
> 
> All comments are welcome
> 
> DB


All this seems difficult and strange to me.  There should be a way to
REALLY get the correct price for UPS and other shipping methods.   I
would like to say, my cart weighs X, I am aggregating at Y.  There is an
item or two that are oversized, etc...  As far as I can tell, there is
no way to get real prices at all and we are just guessing and tossing
numbers around which always come back to get us.  query-ups returns
strange lowball prices that have nothing to do with reality at all.  

However, I'm not sure what the problem is though.  Is it that UPS does
not give out real price data in tables?  If not, maybe we should just
wright a simple screen scraper to do it via their website and cache
it...

thoughts?
rick





-- 
This message has been scanned for viruses and
dangerous content by Green Mountain Network, and is
believed to be clean.




More information about the interchange-users mailing list