[ic] [add-item] problem

Grant emailgrant at gmail.com
Tue Nov 16 14:35:08 EST 2004

> >I'm having some trouble with the add-item usertag.  I'm using it to
> >add an item to the shopping cart based on user input before anything
> >else is in the cart.  If the same item is then added to the cart
> >through normal IC means, it is added as a new line instead of
> >incrementing the original line item.  I do have "SeparateItems No" in
> >my catalog.cfg and it works great otherwise.  Here's a link to the
> >posted tag:
> >
> >http://www.icdevgroup.org/pipermail/interchange-users/2001-January/003506.html
> >
> >Adding more of the item via a normal form increments the second line,
> >and adding more of the item via [add-item] increments the first line.
> >
> >The whole thing does work properly if an item is added to the cart via
> >normal IC means first and then added via [add-item].  Any ideas?
> >
> >- Grant
> There is probably something different in the hash structure of each of the
> entries in question. I suggest you take a look at a dump of the cart data
> in your test condition to determine what that might be. I have not touched
> the [add-item] tag in some time but I would not be at all surprised if it
> is missing something...
> - Ed

Thanks for the tip Ed.  I changed the following line in [add-item]:

push (@{$Carts->{$cart}}, { code => $code, quantity => $qty }) if $notfound;

to this:

push (@{$Carts->{$cart}}, { mv_ib => 'products', code => $code,
quantity => $qty }) if $notfound;

and all is well.

- Grant

More information about the interchange-users mailing list