MiniVend Akopia Services

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

[Fwd: Pricing Routines to perform Unit Price conversions before used in sub/totaling]



Could never get Chris's routine call suggestion to work, I suspect that
the routine was not correctly exporting as a global routine, but it did
move me in a direction that was helpful and I appreciate that once I
realized that I could just embed an equation in the CommonAdjust
statement, something that Mike H or good documentation could have
resolved weeks ago.

CommonAdjust   pricing:q10,q25,q50,q100,q200,q500,q1000:,
;products:price, &$s*1.12/1.6+70-$s

Barry


>>From the little that I have learned about Perl, this routine from
>>Data.pm:
>>
>>sub item_price {
>>        &{$Vend::Cfg->{ItemPriceRoutine}}(@_);
>>}
>>
>>is being passed parameters, the item-code and the item-quantity as well
>>as an optional pricing database.  I've also learned that the & in Perl
>>is a reference pointer to a procedural routine entry point.  So it would
>>seem that calls to item_price is just a generic dispatch to a
>>configurable pricing routine.
>>
>
>Barry,
>
>        My word, you're way over my head!

Duh.  I'm not too proud to admit that, that is why I've asked for help!  I can accomplish what I want by hacking
the Data.pm file, but that limits what I need to do to a single catalog per source and I'd like to run more than
one catalog with different pricing from the same source.

>I'm confused because lib/Vend/Config.pm
>declares itself (package) as Vend::Config not Vend:Cfg.  Have you stumbled
>onto something that is deprecated?

I don't think so, look at Data.pm and the snippet of the item_pricing routine I included in the post!  As for
Vend::Cfg, these are defined and used throught the system, but yes, ItemPriceRoutine doesn't appear to be
defined and that was one of my questions, what internal routine does item_pricing call then?  and how do you
redefine ItemPriceRoutine on a catalog basis?

>I can't even find ItemPriceRoutine in
>Config.pm.
>

Christopher Miller's message this morning made reference to a subroutine call from CommonAdjust.  Chris, can you
post a sample of your ClientPricing code?  This may be a method that is more flexible than my hardcode hack...

Thanks...

Barry




Search for: Match: Format: Sort by: