Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Interchange: users

UPSE Online, special handling charge, adder

 

 

Interchange users RSS feed   Index | Next | Previous | View Threaded


DB at M-and-D

Aug 20, 2009, 5:43 PM

Post #1 of 4 (753 views)
Permalink
UPSE Online, special handling charge, adder

> 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

_______________________________________________
interchange-users mailing list
interchange-users [at] icdevgroup
http://www.icdevgroup.org/mailman/listinfo/interchange-users


db at endpoint

Aug 20, 2009, 5:59 PM

Post #2 of 4 (661 views)
Permalink
Re: UPSE Online, special handling charge, adder [In reply to]

On Thursday 20 August 2009 5:43:49 pm DB wrote:
> I finally got around to trying this and it indeed works. Thanks!

You're welcome!

> I'm now wondering how this could be modified to add the
> UPS_OVERSIZED_FEE for each item in the cart

Here's one (untested) suggestion:

Sub custom_shipping <<EOS
sub {
my ($final, $mode, $opt, $o) = @_;

my $additional_fees = 0;
my $oversized_fee = $Variable->{UPS_OVERSIZED_FEE};

for my $item (@$Items) {
next unless $item->{oversized};
my $quantity = $item->{quantity} || 1;
my $item_fee = $quantity * $oversized_fee;
$additional_fees += $item_fee;
}

$final += $additional_fees;

return $final;
}
EOS

--
Daniel Browning
End Point Corporation
http://www.endpoint.com/

_______________________________________________
interchange-users mailing list
interchange-users [at] icdevgroup
http://www.icdevgroup.org/mailman/listinfo/interchange-users


peter at pajamian

Aug 20, 2009, 6:16 PM

Post #3 of 4 (650 views)
Permalink
Re: UPSE Online, special handling charge, adder [In reply to]

On 08/20/2009 05:43 PM, DB wrote:
> 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
> ===================

That will result in the oversized fee being applied to all items
regardless of whether they have the oversized flag set or not if at
least one of them is oversized. If this is what you want, then fine,
otherwise see Daniel's reply.


Peter


_______________________________________________
interchange-users mailing list
interchange-users [at] icdevgroup
http://www.icdevgroup.org/mailman/listinfo/interchange-users


lists at gmnet

Aug 22, 2009, 3:23 PM

Post #4 of 4 (634 views)
Permalink
Re: UPSE Online, special handling charge, adder [In reply to]

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.


_______________________________________________
interchange-users mailing list
interchange-users [at] icdevgroup
http://www.icdevgroup.org/mailman/listinfo/interchange-users

Interchange users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.