[ic] Help with simple User tag

DB interchange-users@icdevgroup.org
Tue Feb 11 16:02:00 2003


I'm trying to modify an existing and working user tag that I found 
online. I want to define some variables based on the list of items in 
the cart. All of them get defined correctly except for the price which 
always comes up empty. I'm new at this user tag stuff... can someone help?

#---- begin atv  stuff ------------

UserTag atv Routine <<EOR
sub {

         my $atvtot = 0;
foreach my $atvindex (0 .. $#$Vend::Items) {
         my $atvcode = $Vend::Items->[$atvindex]{code};

# this is the one that doesn't get defined as I'd like
         my $atvprice =$Vend::Items->[$atvindex]{price};

         my $atvqty = $Vend::Items->[$atvindex]{quantity};
         my $atvbase = $Vend::Items->[$atvindex]{mv_ib};
         my $isatv = 1           if $atvcode =~ m/^MS/;


         my $atvmessage = <<EOM;
         <br>
         <p style="color: red ; font-size: 10px">
         isatv:  $isatv
         <br> atvqty: $atvqty
         <br>
         atvprice: $atvprice

         </p>
EOM

         $Vend::Items->[$atvindex]{atvmessage} = $atvmessage;
}}
EOR

#----  end atv stuff ------------


DB