[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date
][Minivend by thread
]
Re: [mv] loading carts
****** message to minivend-users from cfm@maine.com ******
On Wed, Mar 15, 2000 at 05:28:48PM -0800, Bill Randle wrote:
> ****** message to minivend-users from "Bill Randle" <billr@exgate.tek.com> ******
>
>
> OK, I've spent most of today and half of yesterday trying to figure
> this out and I'm at wits end!
>
> What I'm trying to do is load a new or temporary cart with data from
> another, pre-existing cart. This is happening in a different (later)
> session and with a different user than when the orignal cart was
> created. Because of this, I can't use the standard [userdb get-cart]
> function.
>
> I've got a handle to the cart info from the userdb of the cart creator
> and can even print out the contents of all the carts. I have
> $Values->{user_carts} containing the contents of the 'carts' field
> of the userdb. Printing $Values->{user_carts} shows:
>
> { 'C_A004198' => [ #0 { 'mv_price' => '35', 'code' => 'PU10000065', 'size' =>
> undef, 'mv_ip' => 0, 'mv_ib' => 'products',
> 'quantity' => 1, 'color' => undef } ]
>
> (I have only one cart at the moment.) My problem is how to get a specific
> cart loaded into $Vend::Items. It appears that $Vend::Items is actually
> a reference to a cart. I've tried all sorts of assignments and dereferencing
> but $Vend::Items always ends up empty by the time it gets to the submit
> sub in minivend.
If you are comfortable with complex perl structures you could make that
work. A day and a half might not be enough for me. ;^) You would
want to replace the old $Vend::Session or at least the cart with the new
one as you are trying. That gets into other issues: what sort of persistency?
How about the easy way out, writing the session variables you want to
some sort of frozen structure and then reading that in when you need
it? That would not interfere with expiring sessions. That might be something
like just loading an sql table with the items and then reading them out
on start of new session. Key it on the session; then you could read that
prebuilt cart as often as you want.
It gets messy conceptually. How long does the cart live? Does it go away
when order? Cookies? How do you end the first session?
>
> I apologize if this is confusing. It's confusing to me, which makes it hard
> to explain, also. I'd sure appreciate any suggestions, pointers, hints, etc.
>
> -Bill Randle
> billr@exgate.tek.com
> -
> To unsubscribe from the list, DO NOT REPLY to this message. Instead, send
> email with 'UNSUBSCRIBE minivend-users' in the body to Majordomo@minivend.com.
> Archive of past messages: http://www.minivend.com/minivend/minivend-list
--
Christopher F. Miller, Publisher cfm@maine.com
MaineStreet Communications, Inc 208 Portland Road, Gray, ME 04039
1.207.657.5078 http://www.maine.com/
Database publishing, e-commerce, office/internet integration, Debian linux.
-
To unsubscribe from the list, DO NOT REPLY to this message. Instead, send
email with 'UNSUBSCRIBE minivend-users' in the body to Majordomo@minivend.com.
Archive of past messages: http://www.minivend.com/minivend/minivend-list