[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date
][Minivend by thread
]
Re: [mv] Scaleable Mall Shipping Solution
****** message to minivend-users from Mike Heins <mikeh@minivend.com> ******
Quoting Murray Gibbins (murray@scotweb.ltd.uk):
>
> I've just got minivend 4.04 set up with a scalable mall shipping solution.
>
> Here how I did it.
>
>
> In minivend.cfg define a subroutine that uses datadumper to create an array of
> information.
> Then define a subroutine that writes this information to a server using TCP.
>
> Define all my shipping databases in Postgresql, ie all my shipping destinations
> and scale, prices for all the buisnesses that ship items around the world.
> Define one shipping.asc file that is used for all the shops in the mall.
>
> this is it...
>
> code description criteria min max formula
> default United Kingdom quantity 0 99999999 f [perl subs=1 global=1 ]my $null =
> gen_hash($Scratch->{present_cart},$Carts->{$Scratch->{present_cart}},$Tag); my
> $cost =
> send_message([$null,$Scratch->{present_cart},$Values->{mv_ship_mode}]);return
> $cost;[/perl]
You can make this a bit easier to read:
default United Kingdom quantity 0 99999999 f <<EOF
[perl subs=1 global=1 ]
my $null =
gen_hash(
$Scratch->{present_cart},
$Carts->{$Scratch->{present_cart}},
$Tag,
);
my $cost = send_message( [$null,
$Scratch->{present_cart},
$Values->{mv_ship_mode}]
);
return $cost;
[/perl]
EOF
With the one line format, you have to be careful of is TAB in the Perl,
which will be read as the next field and terminate the code. A zero cost
and the error log would key you into that. But better yet:
default: United Kingdom
min 0
max 150
crit quantity
cost f <<EOF
[perl ....] etc.
etc.
[/perl]
EOF
I do wonder why you include the $Tag object at the end.....
This is a good example of how you can use Minivend to glue things
together.
--
Akopia, Inc., 131 Willow Lane, Floor 2, Oxford, OH 45056
phone +1.513.523.7621 fax 7501 <heins@akopia.com>
Light travels faster than sound. This is why some people appear bright
until you hear them speak. -- unknown
-
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