[ic] multiple carts on one checkout transaction

Mike Heins mike at perusion.com
Fri Oct 5 13:12:47 EDT 2007

Quoting Rick Bragg (lists at gmnet.net):
> On Fri, 2007-10-05 at 14:13 +0000, Rick Bragg wrote:
> > Hi,
> > 
> > I know how to set up multiple carts within one catalog, I have done that
> > many times, however, each cart requires a separate checkout.  I would
> > like to allow the customers to have more than one cart, yet run only one
> > transaction with their credit card.  My problem is getting all the carts
> > to sum together and checkout at the same time with only one transaction.
> > Is there a way to do this?
> > 
> > thanks
> > Rick
> > 
> Back to my original question. Is there any way to do this?  I still need
> some way of summing up multiple carts on one transaction checkout...

You could create a routine or a usertag which creates a combination
cart of all of the separate carts.

UserTag combine-cart Routine <<EOS
sub {
	my $carts = $Vend::Session->{carts}
		or return;
	delete $carts->{omnibus};
	my $omni = [];
	for(keys %$carts) {
		next if /^mv_/;
		next unless ref($carts->{$_}) eq 'ARRAY';
		push @$omni, @{$carts->{$_}};
	$carts->{omnibus} = $omni;
	return scalar(@$omni);

Then just use the omnibus cart for your checkout.

Mike Heins
Perusion -- Expert Interchange Consulting    http://www.perusion.com/
phone +1.765.647.1295  tollfree 800-949-1889 <mike at perusion.com>

Fast, reliable, cheap.  Pick two and we'll talk.  -- unknown

More information about the interchange-users mailing list