[ic] Add products to cart for users

Kevin Walsh kevin at cursor.biz
Wed Mar 31 16:13:36 EST 2004


Michael Hess [mhess at greenhillsschool.org] wrote:
> > You could create a "saved cart", for each of your users, containing
> > your 1,000 recommended items.  The logged-in users could then load the
> > saved cart if they choose to do so.
> > 
> This is being done for a school book sale, each person will only come to
> the site once, and by items they need.  What table do the saved carts get
> saved to?  Can I import and export to it?
> 
Saved carts are written to the "carts" column in the "userdb" table by
default.  The default data type column is BLOB (MySQL and Oracle) or
TEXT (PostgreSQL).

The data can be imported and exported as usual, but the data will be
in a particular format (an unevaluated Perl data structure).  For
instance, a saved cart with two items might look a bit like this:

{
    'my-saved-cart' => [
        {
            'mv_ib' => 'products',
            'quantity' => '1',
            'code' => 'bond'
        },
        {
            'mv_ib' => 'products',
            'quantity' => '30',
            'code' => '007'
        },
    ],
}

You'll notice that I keep saying "by default";  You can re-implement
this in any way you see fit.

-- 
   _/   _/  _/_/_/_/  _/    _/  _/_/_/  _/    _/
  _/_/_/   _/_/      _/    _/    _/    _/_/  _/   K e v i n   W a l s h
 _/ _/    _/          _/ _/     _/    _/  _/_/    kevin at cursor.biz
_/   _/  _/_/_/_/      _/    _/_/_/  _/    _/



More information about the interchange-users mailing list