Akopia Akopia Services

[Date Prev][Date Next][Thread Prev][Thread Next][Interchange by date ][Interchange by thread ]

Re: [mv] Saved Cart Question?



At 12:32 AM 03/25/2001 -0700, you wrote:
>hello,
>
>Does anyone know how to remove an item from a cart that has been
>'saved'?  It appears that MV3.14 saves the cart in userdb.gdbm, but I do
>not know how to get directly at the cart in the database.
>
>I am trying to do this with a perl script that runs as a special
>process.
>
>The problem is this. If someone puts an item in their cart and saves the
>cart, there is a record (I believe in userdb.gdbm and maybe
>session.gdbm) of this saved cart.  Then if a store owner removes one of
>the items in the saved cart from the store before the customer has had a
>chance to process the items in the saved cart, when the customer comes
>back and 'recalls' the cart, the removed item will be in it.
>
>I wnat to write a script that will go through the 'saved' carts in
>userdb.gdbm (and session.gdbm if necessary) to remove these unavailable
>items from the carts.
>
>Does anyone know how this can be done?
>

Rather than scanning the carts field in userdb, you could place a [perl] 
block on the basket page to detect extinct items and remove them from the 
basket - something like this (UNTESTED):

[perl tables=products]
         my $counter = 0;
         do {
                 if ($Tag->data('products', 'sku', 
$Carts-{'main'}[$counter]{'code'})) {
                         splice @{$Carts->{'main'}}, $counter--, 1;
                 }
         ++$counter;
         } until $counter > $#{$Carts->{'main'}};
         return '';
[/perl]

- Ed L.



===============================================================
**** Virtual Hosting w/private IC Installation, $65/month! ****
---------------------------------------------------------------
New Media E.M.S.               Software Solutions for Business
463 Main St., Suite D          eCommerce | Consulting | Hosting
Placerville, CA  95667         edl@newmediaems.com
(530) 622-9421                 http://www.newmediaems.com
(866) 519-4680 Toll-Free       (530) 622-9426 Fax
===============================================================


_______________________________________________
Minivend-users mailing list
Minivend-users@minivend.com
http://www.minivend.com/mailman/listinfo/minivend-users


Search for: Match: Format: Sort by: