|
RE: Calculating quantity of items: msg#00522web.interchange.users
At 05:38 PM 6/13/01 , you wrote: >Hi Mike: > >Thanks, that's not so hard after all! The only thing is, however, I would >like to put items with the same SKU on a different line UNLESS they have the >same options. My options each have their own unique code, is there a way to >do this? > You could use a custom usertag like the one below. Set seperateitems to yes in catalog.cfg and add the tag [basket_combine] at the top of the basket page. Note: this worked with MV 3 and 4, have not tried with IC, but I believe it should work. UserTag basket_combine Order quantity UserTag basket_combine Routine <<EOR sub { my $cart = $Vend::Items; # Combine all similar products if attributes match for (my $x=0;$x < @$cart;$x++) { REMAIN: for (my $y=$x+1;$y < @$cart;$y++) { # now check if 'code' (sku) matches next REMAIN unless ($$cart[$x]{code} eq $$cart[$y]{code}); foreach (keys %{ $$cart[$y] }) { # now check that all attributes match (except qty of course) next REMAIN unless ($_ =~ /quantity/i || $$cart[$x]{$_} eq $$cart[$y]{$_}); } # we have checked all atb's match, so combine item qty's $$cart[$x]{quantity} += $$cart[$y]{quantity}; # now remove this duplicate splice(@$cart, $y, 1); } } return ''; } EOR Kyle Cook |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | RE: Re: Interchange-users digest, Vol 1 #602 - 4 msgs: 00522, Rene Hertell |
|---|---|
| Next by Date: | login problems: 00522, Shawn Hamzee |
| Previous by Thread: | RE: Calculating quantity of itemsi: 00522, Tim Mirecki |
| Next by Thread: | RE: Calculating quantity of items: 00522, Tim Mirecki |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |