[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date
][Minivend by thread
]
[mv] Scaleable Mall Shipping Solution
****** message to minivend-users from 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]
"gen_hash" creates the info the shipd server needs.
"send_message" writes the info to the server and waits for the reply
The shipping.asc file is only two lines long. ie very scalable over many
shops,countries and delivery buisnesses.
The minivend mv_shipping variable is alwasy set to default. When a shopper
chooses the destination they define mv_ship_mode instead.
The server ( i've called it shipd.pl) does all the work, talking to databases,
working out weight etc.
Because I'm using a separate server and database I can have minivend on one
machine, postgresql on another and the shipd on a third.
I could even have two machines with shipd.pl on them and use round-Robin DNS to
share the load.
shipd.pl uses the forking server code from the camel book!
I know that TIMTOWTDI, but this is proving to be pretty robust. How have other
people approached it?
--
____
\__/ Murray Gibbins murray@scotweb.ltd.uk
/ \ Programmer
_ \__/ _ ================================================
\\ || // Scotweb Limited, info@scotweb.ltd.uk
\\||// 13a Albert Terrace, http://www.scotweb.ltd.uk
\||/ Edinburgh EH10 5EA Tel: +44 (0) 131 270 82 33
|| Scotland. Europe. Fax: +44 (0) 7020 93 49 04
-
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