Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


These support forums are now closed for new topics and comments.
Please head on over to http://eureka.ucommerce.net/ for support.

  • Girish Khadse 52 posts 132 karma points
    Aug 28, 2013 @ 13:19
    Girish Khadse
    0

    How to ask user to login before placing order.

    Hi all, I have webshop, where user can place order without login into system. But when he is a registered user, I want him to login into system before proceeding with placing order (preferably by showing small login screen as a popup window..)
    So far...

    1. I have created partial view for login..
    2. When finding out that it is an existing user, I redirect him to login.. which is shown as a pop up.. on the same page. (Note that I am using same page- place order page, only login partial form is rendered as a pop up using some css)
    3. When user clicks on login post action is called up, which validates user credentials and if validation fails,renders same form again.
    4. Now I want when crendentials are correct, I want to submit that form. But the problem is, I dont get the old model of Place order which is overridden by model of login. When I try submitting the form after user successfully logs in, empty form is being submitted, causing validation errors to be thrown up.

    Is mine approach correct? Is there any alternate approach to solve this issue?

  • Lars Horne-Mortensen 40 posts 184 karma points
    Aug 30, 2013 @ 13:09
    Lars Horne-Mortensen
    0

    Hi Girish,

    If you are having problems with different forms on the same page, maybe it would be better to use a separate login page, that just redirects your users back to the order page, after they log in.

    You could also try to do the user login asynchronously, via web services and javascript.

    Hope that helps,

    Lars

  • Girish Khadse 52 posts 132 karma points
    Sep 02, 2013 @ 14:20
    Girish Khadse
    0

    Hi Lars,

    Thanks for the reply.

    I managed to get through issue. I had thought about using 2 different login pages, but still I had some problems with managing the information which user has entered in the place order form as it would have lost when user is switched to login view. Tempdata can store the data between controller to controller calls, so in this case I would have to go with Sessions.

    So to manage all this things, I used the single form with 2 submit buttons (buy and login buttons). Login controls container were hidden in normal case, but when needed they were shown using css. As now all the data is enclosed in single form, it would post all the data including place order and login data.
    So it was easier to manage.

    In the controller side, I had to manage code as per which button caused the action to be called up. But finally approach working fine.
    I am not sure if it is a best approach, but hope it would help someone.

     

    Regards
    Girish.

Please Sign in or register to post replies

Write your reply to:

Draft