[ic] Setting basket fields (description, title, etc...)

Mike Heins interchange-users@lists.akopia.com
Wed Jul 4 09:14:01 2001


Quoting Ron Phipps (rphipps@reliant-solutions.com):
> I have the need to dynamically change the title and price of an item in the
> cart.  I have tried using the following code:
> 
> [perl]
>   foreach my $item (@$Items) {
>    if ($item->{'code'} eq $Scratch->{sku})
> 
>     $item->{mv_price} = $Scratch->{case_sub};
>     $item->{'title'} = "blah blah blah";
>    }
>   }
>   return;
>  [/perl]
> 
> The price is set correctly - [item-subtotal] returns the correct value.
> The title is not set to "blah blah blah"
> [item-field price] does not show the correct price even though
> [item-subtotal] is computed correctly.
> 
> Any idea's why the mv_price would be set correctly,  but the title would
> not?  How can I set [item-field price] to show the correct value as well?

You can't unless it is an on-the-fly item, or at least it has no value in
the "title" field in the database.

You *can* access what you set with:

    [either][item-modifier title][or][item-field title][/either]

And [item-price] should return the right thing.

-- 
Red Hat, Inc., 3005 Nichols Rd., Hamilton, OH  45013
phone +1.513.523.7621      <mheins@redhat.com>

I don't want to get to the end of my life and find I have just
lived the length of it. I want to have lived the width of it as
well. -- Diane Ackerman