[ic] Multiple Carts

Carl Bailey carl at endpoint.com
Fri Dec 12 15:04:16 UTC 2008


On Dec 11, 2008, at 11:17 AM, Hariharan Gopalan wrote:

> Hi Everyone!
>
> I found interchange when I was looking for a shopping cart that can  
> maintain multiple carts for a single user.
>
> IC is such an awesome product, thanks so much to people who  
> contributed to this.
>
> Was wondering if someone could please give some code example os the  
> CART tag where I can have a user select products and place in  
> separate carts.
> Need to setup the products in groups so products in a group end up  
> in their own cart and when checking out will create an order for  
> each group...
>
> any ideas / tips will be very helpful
>
> Thanks a bunch
>
> Hari

Hari,

Here's some simple code that adds to a cart that the user chooses:

<form action="[process]">
<input type=hidden name=mv_session_id value="[data session id]" />
<input type=hidden name=mv_nextpage   value="@_MV_PAGE_@" />
<input type=hidden name=mv_todo       value="refresh" />
<input type=hidden name=mv_order_item value="SKU_NUMBER_HERE" />
<input type=text   name=mv_quantity   value=1  size=3 style="text- 
align: right; margin: 2px 10px; 2px 0;" />
<select name=mv_cartname>
    [perl]
       $html = '';
       foreach my $cartname (sort keys %$Carts)
       {
          $html .= qq{<option value="$cartname">$cartname</option>\n};
       }
       return $html;
    [/perl]
</select
<input type=submit value="Add to Cart" />
</form>

To group your products you could simply set mv_cartname = [item-field  
prod_group] or any grouping field of your choice from the database.

However, creating a separate order for each cart at checkout is an  
altogether different matter.  You may well need to handle address  
collection, shipping, tax, payment, emails and order-logging for each  
cart separately, and that's too big a topic for me to address here.

Good luck!

Regards,
Carl
. . . . . . . . . . . . . . . . . . .
Carl Bailey
t: 919-323-8025
carl at endpoint.com
. . . . . . . . . . . . . . . . . . .

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.icdevgroup.org/pipermail/interchange-users/attachments/20081212/ad8a0329/attachment.htm 


More information about the interchange-users mailing list