MiniVend Akopia Services

[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date ][Minivend by thread ]

Re: Shipping _syntax_ proposal (Was Re: UPS Shipping Returns $0.00(Continue))







On Tue, 24 Aug 1999 mikeh@minivend.com wrote:

> ******    message to minivend-users from mikeh@minivend.com     ******
> 
> Quoting Kyle Hayes (kyle540@quicknet.net):
> >[snip]
> 
> I am afraid I don't see where this helps the average user.
> I believe the beauty of the MV scheme is this one:
> 
> expert_shipping	Shipping	[my-criteria]	0	99999999	f [my-shipping]

Hmm, this is simpler...

> Now a usertag can implement anyone's scheme, while the ones that
> many people use, the simple table-based ones, are covered.

Actually, it looks like you need two tags above.  One ([my-criteria]) to
return true or false (I assume) based on some checking and another to
calculate the shipping cost.

> Perhaps the focus should be a library of UserTags like:
> 
> 	[dhl-shipping weight="@@TOTAL@@"].

This is probably the best thing.  Each shipper is so !@#^$%@&$% different,
that there probably isn't any single scheme that is flexible enough to
encode all those differences other than separate tags.

> As for add-on modules, they can be added at any time:
> 
> AddDirective YourLookUp lookups
> GlobalSub  <<EOS
> sub custom_shipping {
> 	use MyShippingModule;
> 	CODE: {
> 	}
> 	return $cost;
> }
> EOS

Oh.  I forgot about the AddDirective directive :-(

How would shipping get called?  I.e. it would be nice to be able to call
[shipping] and have that work regardless of which end
UserTag/GlobalSub/Tarot deck was used to generate the cost.

How about a shipping.asc that looks like this:

code	value

default	You lose homeboy.
error	Houston, we have a problem
upsg	[ups type=Ground weight="@@TOTAL"]
upsgi	[ups_insured type=Ground weight="@@TOTAL@@"]
dhl	[dhl state=[value state] country=[value country]]
...


Look up the shipping type.  If not found, use default.  If found,
interpolate the "value" column.  

I am not sure about the @@TOTAL@@ stuff.  It would probably be better to
be able to specify tags that do this:

[sum-items field="weight"]
[sum-items field="quantity"]
...

I have equivalent code in some of my UserTags and GlobalSubs, but not
broken out separately.

The implementations could either be in the minivend.cfg, the catalog.cfg
or perhaps as Perl libs in the MVHOME/lib/shipping directory...  I rather
like the last one as it keeps the config files down a bit in size.

Best,
Kyle (KH)




Search for: Match: Format: Sort by: