[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date
][Minivend by thread
]
RE: [mv] Shipping cost drops to zero beyond a certain amount... <- I have a problem like this one
****** message to minivend-users from "Greg Jaman" <greg@dpmg.com> ******
Kyle - your Amazing! thanks
-----Original Message-----
From: owner-minivend-users@minivend.com
[mailto:owner-minivend-users@minivend.com]On Behalf Of kyle@invisio.com
Sent: Wednesday, May 31, 2000 10:56 AM
To: minivend-users@minivend.com
Subject: RE: [mv] Shipping cost drops to zero beyond a certain amount...
<- I have a problem like this one
****** message to minivend-users from "kyle@invisio.com"
<kyle@invisio.com> ******
At 08:00 AM 5/31/00 -0500, you wrote:
>****** message to minivend-users from "Greg Jaman" <greg@dpmg.com>
>******
>
>I have a similar problem to this one..
>I have only 2 products (0001,0002) and am giving free shipping for just
>product 1 (sku=0001) if the user purchases 5 or more of this item,
otherwise
>shipping is calculated on the total weight (item 1 + item 2).
>I think my solution involves a chained look up, but how do I separate the
>products in the shipping table?? can you use a criteria like sku? if so
>how?
>
Greg,
I think the best way to handle this would be a user-tag so that if you
ever add items or want to change the discounts it could be done in
the database easily.
The user tag assumes you have a field called weight, and another field
(called whatever you want) for exception quantities.
In products.asc (or whatever your database type) add a field called
free_ship_quantity or f_s_q (or any other name) and set each record
you want treated special with a number (blank entries will calculate
as normal weight)
if the order quantity of that item is equal to or greater than this number
then the weight won't be calculated for it.
IE (products.asc):
code ... weight free_ship_quantity
0001 4 5
0002 6
in shipping.asc use the user tag (passing the special field name)
to get the weight:
(USE tabs instead of pipes)
yourmode|yourdescrip|[calc_weight f_s_q]|0|0|e Free Shipping!
yourmode|yourdescrip|[calc_weight f_s_q]|0|150|u (YOUR UPS STUFF)
yourmode|yourdescrip|[calc_weight f_s_q]|150|999999|e Too Heavy!
here is the user tag (place in catalog.cfg):
UserTag calc_weight Order exception_field
UserTag calc_weight Routine <<EOR
sub {
my ($exception_field) = @_;
my $cart = $Vend::Items || return 0;
my ($item_q, $item_w, $item_e);
my $total = 0;
foreach my $item (@$cart) {
$item_q = $item->{quantity};
$item_w = Vend::Interpolate::tag_data(
'products',
'weight',
$item->{code},
);
$item_e = Vend::Interpolate::tag_data(
'products',
$exception_field,
$item->{code},
);
unless ($item_e && $item_q >= $item_e) {
$total += $item_w * $item_q;
}
}
return $total;
}
EOR
Kyle (KC)
-
To unsubscribe from the list, DO NOT REPLY to this message. Instead, send
email with 'UNSUBSCRIBE minivend-users' in the body to
Majordomo@minivend.com.
Archive of past messages: http://www.minivend.com/minivend/minivend-list
-
To unsubscribe from the list, DO NOT REPLY to this message. Instead, send
email with 'UNSUBSCRIBE minivend-users' in the body to Majordomo@minivend.com.
Archive of past messages: http://www.minivend.com/minivend/minivend-list