[ic] Strange behaviour when ordering multiple items w/options

marc.brevoort interchange-users@icdevgroup.org
Fri Aug 30 06:26:03 2002


Hello group,

> Hmm. I think that the ability to accept separate mv_sku variables for
> the "separate widgets" prevents ordering multiple matrix items. My guess
> is you can't do what you want to do.

Below a 'diff' showing what I changed in Order.pm (4.8.5) to allow ordering
multiple items with matrix options.

As I haven't given myself the time to get really deep into the code, I 
suppose I've broken a thing or two, although for now it *seems* things 
are working OK. Mike, could you shed your light on this? Thanks again for 
having helped me out!

To all group members: This patch is not official! Use at your own risk!

Regards,

Marc Brevoort

====

1713a1714,1716
> # Patch: Added my (@sku);
> 	my(@sku);
> # Patch end
1760c1763,1766
< 		my @sku = split /\0/, $CGI::values{mv_sku}, -1;
---
> # Patch: To make sku array available in a broader scope
> #		my @sku = split /\0/, $CGI::values{mv_sku}, -1;
> 		@sku = split /\0/, $CGI::values{mv_sku}, -1;
> # Patch end
1765c1771,1773
< 		$items[0] = join '-', @sku;
---
> # Patch: Do not modify the sku of any item.
> #		$items[0] = join '-', @sku;
> # Patch end
1803a1812,1814
> # Patch: To get correct sku from sku array.
> 	my $loopcount = 0;
> # Patch end
1804a1816
> 
1805a1818,1822
> # Patch: To get correct un-extended sku from sku array
> 		my $currentsku=$sku[$loopcount] if defined $sku[$loopcount];
> 		logError("Adding item $currentsku to cart, loopcount=$loopcount.\n");
> 		$loopcount=$loopcount+1;
> # Patch end
1883,1884c1900,1903
< 			$item->{mv_sku} = $skus[$i] if defined $skus[$i];
< 
---
> # Patch: This allows ordering multiple items with options.
> #			$item->{mv_sku} = $skus[$i] if defined $skus[$i];
> 			$item->{mv_sku} = $currentsku if defined $currentsku;
> # Patch end
èd5