in reply to Splitting a scalar variable problem

In the add item routine
.. $cart_ref->{$item_id}->{qty} = 1; } ## $cart_ref->{item_id}->{qty} = $qty; ## missing $ $cart_ref->{$item_id}->{qty} = $qty; # correct $cart_ref->{$item_id}->{color} = $color;
poj

Replies are listed 'Best First'.
Re: Re: Splitting a scalar variable problem
by hbradshaw (Novice) on Feb 18, 2003 at 20:27 UTC
    Poj, Hi! Thanks for the help. The missing $ was definately the problem. Thanks again.
Re: Re: Splitting a scalar variable problem
by hbradshaw (Novice) on Feb 18, 2003 at 23:54 UTC
    Poj, Hi.

    I made another modification to my code. Instead of having a popup menu, I changed to a multiple scroll list. So, people can choose more than one color.

    When I try to select to select multiple colors for an item, only the first color of the list appears in the cart.

    Here is the modified code for the multiple scroll list...

    td ({-colspan => "3", -align => "right"}, "Colors:", scrolling_list( - +name => "color", -size => 2, -multiple => 1, -values => \@color))),
    This is the only change I made to the code. Can you give me a hand in figuring out why choosing more than one color results in printing of only one color? The rest of the code is in the original node. Thanks for your help.
Re: Re: Splitting a scalar variable problem
by hbradshaw (Novice) on Feb 19, 2003 at 13:23 UTC
    Poj, Good Morning....

    Please disregard my last entry to this node about selecting multiple items.

    I want to go another way. I would like to have a person place an item in the cart with one color and then place the same item in the cart with another item. The result in the view cart would be an item appearing twice but with different color entries.

    Right now, my code does not allow that. If I place an item in the cart with a color and try to place the same item with a different color, the previous choice is updated. My cart only shows the item once with the most recent color chosen.

    Would you have any thoughts on how I can fix my code to accomplish my goal? All the code is still in this node that deals with adding items to the cart. Thanks for your help.
Re: Re: Splitting a scalar variable problem
by JamesNC (Chaplain) on Feb 18, 2003 at 18:23 UTC
    + you da man! :)