[ic] Overriding [item-subtotal] in Data.pm

Kevin Walsh interchange-users@interchange.redhat.com
Sat Mar 30 13:02:01 2002


> On Sat, Mar 30, 2002 at 03:06:34PM +0100, Stefan Hornburg (Racke) wrote:
> > "Tim Nelson" <nelsonx@earthlink.com> writes:
> > 
> > > I have custom code in "sub item_subtotal" in Data.pm.
> > > I'd rather not have the code in Data.pm in order to keep the
> > > Interchange install as pristine as possible.  
> > 
> > Why didn't you tell us what custom code you are using ?
> > This makes the answer unnecessarily difficult.
> > 
> > > 
> > > Is there another way to override this function without actually
> > > modifying Data.pm ?
> 
> Just a guess, maybe something like this might work in a perl module
> of your own.
> 
> package Vend::Interpolate;
> *read_shipping=\&MY::Patch::read_shipping;
> 
I wouldn't do that if I were you.

  1) read_shipping ref is in the Vend::Data package. :-)

  2) The assignment may or may not take effect, depending upon the
     module load order, assuming your module is read at all.

  3) Changing that ref would change the shipping routine for all of
     the Interchange sites on the server.  If you only have one site
     then its not a problem, of course.

  4) Yuck.

-- 
   _/   _/  _/_/_/_/  _/    _/  _/_/_/  _/    _/
  _/_/_/   _/_/      _/    _/    _/    _/_/  _/   K e v i n   W a l s h
 _/ _/    _/          _/ _/     _/    _/  _/_/    kevin@cursor.biz
_/   _/  _/_/_/_/      _/    _/_/_/  _/    _/