[ic] Help with simple User tag

Ed LaFrance interchange-users@icdevgroup.org
Tue Feb 11 17:05:00 2003


At 04:01 PM 02/11/2003 -0500, you wrote:
>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

That's because price is not typically stored in the item hash - you'll want 
to use $Tag->price() or Vend::Interpolate::tag_price() instead.

- Ed L.


===============================================================
New Media E.M.S.              Technology Solutions for Business
463 Main St., Suite D         eCommerce | Consulting | Hosting
Placerville, CA  95667        edl@newmediaems.com
(530) 622-9421                http://www.newmediaems.com
(866) 519-4680 Toll-Free      (530) 622-9426 Fax
===============================================================