[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date
][Minivend by thread
]
Re: shipping by price _and_ weight
****** message to minivend-users from "Alan Curry" <pacman-mvend@cqc.com> ******
No takers on this one, eh?
>So the shipping.asc I want will be something like:
>
>overseas Overseas price 201 9999999 f 7 + (.06 * @@TOTAL@@) + (12 * @@HEAVY_TOTAL@@)
>
>i.e. I want to be able to use both price total and the total of a special
>field called "heavy" in my shipping formula. Can this be done?
I'm going to make it simpler. I'm using the `s' method in shipping.asc. In
order to compute the shipping charge, I need to know what items are in the
cart. I tried to get at them with @{$Safe{items}} but that array seems to be
empty.
Here's a sample of what I need to be able to do:
--- catalog.cfg ---
Sub <<EOF
sub myship {
my ($method,$pricetotal)=@_;
my $shipping;
# This counts unique items rather than total, but you get the idea
if(scalar @{$Safe{items}} > 10) {
$shipping=$pricetotal * .05;
} else {
$shipping=$pricetotal * .06;
}
}
EOF
--- ---
--- shipping.asc ---
default USA price 0 9999999 s wolfship ;usa, ;@@TOTAL@@
--- ---
-
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