[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date
][Minivend by thread
]
Using item-fields in CommonAdjust f
Ok, i asked a week or two ago and am going to try again, i really need a solution. I am
using a modified version of the CommonAdjust routine mikeh posted a while back (found it in
the archive). My problem is i need to access a field I have in products.asc called
"defweight." $Vend::Interpolate::item only contains code, price, quantity (i think thats
it). I put in catalog.cfg UseModifier defweight but when i put:
...
my $item = $Vend::Interpolate::item;
return $item->{defweight};
it returns 0.00. My code looks like this:
########### CommonAdjust
CommonAdjust <<EOF
"[tag touch products][/tag][price-mod][/price-mod]"
products:price
EOF
########### UserTag
UserTag price-mod HasEndTag
UserTag price-mod Interpolate
UserTag price-mod Routine <<EOR
sub {
my $s = $Vend::Interpolate::s;
my $item = $Vend::Interpolate::item;
my $adj=0;
# Do whatever you want to price here
if ( $item->{code} eq "01-001" ) {
return $Global::Variable->{SVALUE}/31.1035;
#the above works fine howver i'd like to be able to do:
#return ( $Global::Variable->{SVALUE} / 31.1035 ) * $item->{defweight};
#this returns 0
}
return $adj;
}
EOR
########### UseModifier
UseModifier defweight
How can I access item fields for use in my pricing scheme?
Thanks,
Ezra