Shawn.

The first argument in StartForm() should be the screen you want them to wind
up at.  The third should be the action the form performs on its way to the
screen.

If I understand what you want to do now you want to log them in on the way
to check out.  Since there are more than one roads to check out you need to
see what they all have in common.  Both checkout and express checkout reach
their respective screens via CREATE_INVOICE, so lets look there.

The flow through CREATE_INVOICE is pretty simple.  If there is no invoice
start one, if you can not send an error (via $ActionResults[]).  Next update
the new row in the invoice table and update session (would be nice to have a
session class btw).  If you already have a invoice started keep going.  Next
add the users cart into the invoice, if that fails send an error.  Next you
empty the basket or send an error if emptying fails.  (This last bit of code
is the part that perhaps should be moved to later in check out.)

At no time does CREATE_INVOICE change $SCREEN.  So we are either going to
order_info or order_express from here.  So unless we want to change both
those screen we have to check for log in before we leave the action.
Besides if you require login before checkout you can't wait that long
anyhow.  I am certain there are a few ways to do this.  This is the way I
would suggest while sitting here eating french toast.

Wrap everything that is currently in CREATE_INVOICE in a conditional.  A
while $UserInfo['ID'] is greater than zero or a if($UserInfo['ID]) or
something.  If user is logged in let the action continue.  If not logged in
kick them out to the log in screen.  I would suggest either copying login
and having a separate login for this step (i.e. login_checkout) or altering
your current login to allow different login cases.  Either way... you want
them to login in during checkout with a form which begins:

StartForm($SCREEN, 'post', 'LOGIN_USER', TRUE, '', '', '', 'loginForm'));

Use screen as long as $SCREEN has not been changed since it was set to
order_info or order_express.  If $SCREEN was changed then you will have to
pass which screen you are heading to and replace $SCREEN with that variable.

You probably will not be able to get anything working by just doing what I
wrote above.  Like I said, I am in the middle of breakfast.  What you should
be able to do go through your code step by step and figure out how to change
the flow.  This seems to be where your problem is.  You claim to be reading
the source and I believe you are.  I do not think you are seeing the flow
though.  This is not a flame, just an observation.  You need to follow the
code where ever it goes, line by line, escaping out with the code or looking
up message constants in the language inc. and so on.

Good luck

Chuck
www.chaosmailorder.com
www.project27.com

> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On Behalf Of Shawn Honeychurch
> Sent: Saturday, November 04, 2000 6:36 AM
> To: FreeTrade
> Subject: Re: [FreeTrade] Need help with $Screen command
>
>
> Hi;
>
> What i am trying to do is to have the customer sent to the start of the
> checkout process as soon as they are logged in.  I have a dupplicate login
> screen that activates when someone with an item in there basket clicks on
> checkout.
>
> Here is the StartForm() from the login screen.
>  print(StartForm("contents", 'post', 'CREATE_INVOICE', TRUE, '', '', '',
> 'loginForm'));
>
> Here is the screen command from the action module.
>  $SCREEN = "order_info";
>
> When I use these two I don't get logged in but the basket gets emptied.
>
> Shawn
>
>
> ----- Original Message -----
> From: "Chuck Gartland" <[EMAIL PROTECTED]>
> To: "FreeTrade" <[EMAIL PROTECTED]>
> Sent: Friday, November 03, 2000 8:32 PM
> Subject: RE: [FreeTrade] Need help with $Screen command
>
>
> >
> >
> > > -----Original Message-----
> > > From: [EMAIL PROTECTED]
> > > [mailto:[EMAIL PROTECTED]]On Behalf Of Shawn Honeychurch
> > > Sent: Friday, November 03, 2000 4:56 PM
> > > To: FreeTrade
> > > Subject: Re: [FreeTrade] Need help with $Screen command
> > >
> > >
> > > SCREEN is being passed but does not want to do both a screen
> url and an
> > > action, if I remove it then i default to the contents screen.  If
> > > i add the
> > > action in then I dont get logged in, or i get logged in and
> sent to the
> > > welcome screen.
> > >
> > > Shawn
> > >
> > >
> >
> > Where is it you are trying to go after log in?  It should
> probably be the
> > first thing passed in the StartForm() function in the log in screen.  Or
> are
> > you asking something else?
> >
> > Chuck
> >
> > chaosmailorder.com
> >
> >
> >
> > ------------------------------------------------------------
> > To subscribe:    [EMAIL PROTECTED]
> > To unsubscribe:  [EMAIL PROTECTED]
> > Site:            http://www.working-dogs.com/freetrade/
> > Problems?:       [EMAIL PROTECTED]
> >
>
>
>
> ------------------------------------------------------------
> To subscribe:    [EMAIL PROTECTED]
> To unsubscribe:  [EMAIL PROTECTED]
> Site:            http://www.working-dogs.com/freetrade/
> Problems?:       [EMAIL PROTECTED]
>



------------------------------------------------------------
To subscribe:    [EMAIL PROTECTED]
To unsubscribe:  [EMAIL PROTECTED]
Site:            http://www.working-dogs.com/freetrade/
Problems?:       [EMAIL PROTECTED]

Reply via email to