Results 1 to 8 of 8

Hybrid View

  1. #1
    Join Date
    Dec 2006
    Location
    Tokyo, Melbourne, Shanghai
    Posts
    102
    Plugin Contributions
    0

    Default Return to Same Page after Log In

    Pullin' a long shift this evenin' but goin' well. Nonetheless have this small query/ problem.
    Setting: I have my shop set to a user must be logged in to see prices.
    Picture this: User is NOT logged In and is browsing. He see's a product he likes and clicks on "log in" because he wants to know the price. He is directed to Log in page and after filling in details and pressing the "log in" button he is not returned to the product he is interested in but rather pushed to the main page! oh whoops. Major inconvenience becasue now he has ta find the product all over again.
    Absolutely wanting: Is it possible that somehow the user is returned back to the previous page that he was on prior to log in rather than always being sent to the main page? Possibly by somehow setting up a "memory" variable (only guessing!!) or some other ingenious mechanism which zencart seems to be abounding with?

    Thank you very much in advance,

    Arpeggio

  2. #2
    Join Date
    Sep 2004
    Posts
    1,388
    Plugin Contributions
    4

    Default Re: Return to Same Page after Log In

    Yes, but it's gonna take some work...
    • The link to your login page has to become a form submission, with a hidden field containing the current page. You need to get fancy here because it's not just a file, but a get variable as well (index.php?main_page=[something])
    • On login page load, you need to look for that hidden variable and store it somewhere, a $_SESSION variable would probably be best.
    • Run the usual login stuff, and append some new code at the end to redirect the user to the page you previously stored.
    Frank Koehl
    "Cleverly Disguised as a Responsible Adult"

    frankkoehl.com

  3. #3
    Join Date
    Dec 2006
    Location
    Tokyo, Melbourne, Shanghai
    Posts
    102
    Plugin Contributions
    0

    Default Re: Return to Same Page after Log In

    Holy Moly!! Well that's it for me then dear BlindSide. It is Strike 3 for me mate! I have 3 posts out there & all of them are requiring a technical programming skill well beyond my present and near future ability! I'm gonna have ta leave it like it is for now, make the changes absolutely needed for a "live" store, hopefully find customers and make the changes as my experience and self study progresses. Thank you for outlining the procedure to me. btw like ya caption "cleverly disguised as an adult" !! Thanks again. Arpeggio.

  4. #4
    Join Date
    Sep 2004
    Posts
    1,388
    Plugin Contributions
    4

    Default Re: Return to Same Page after Log In

    LOL

    It may not exactly be basic stuff, but it doesn't require an uber-coder either. It's probably easier than you think.

    Getting the site up and running should definitely be your primary focus. You'll learn a lot just in doing so. Then you'll go and tweak something, then tweak a little more...you'll be writing mods in no time.

    I was named "Least Likely to Grow Up" in college.
    Frank Koehl
    "Cleverly Disguised as a Responsible Adult"

    frankkoehl.com

  5. #5
    Join Date
    Dec 2006
    Location
    Tokyo, Melbourne, Shanghai
    Posts
    102
    Plugin Contributions
    0

    Default Re: Return to Same Page after Log In

    well ya gonna "lol" again dear Blindside 'cause i didn't know the meaning of "lol" so had ta look that up too!! ya got me lolling now too!
    Thanks for ya vote of confidence. Incidently I did a search for "last page return php" etc on the net but no luck in getting some remotely related code. Yes, slowly does it and i'll get a'tweakin' after the page is up 'n runnin'. (the tweakin' is actually good fun!!)

    "Least likely to grow up", ey?! Way ta go! What a compliment!! Reminds me of what the headmaster told Richard Branson" when he left school:
    "You'll either be a criminal or a millionaire." !! LOL x 5!!
    Another good one is:
    "Parents fail when they try to be adults". oooh yeah!
    Hai....jya...Tonikaku kore kara log in shimasu. oHanashi arigato. (Yes...well....Anyway gonna log in now. Thanks for chatting.)
    Arpeggio.

  6. #6
    Join Date
    Sep 2004
    Posts
    1,388
    Plugin Contributions
    4

    Default Re: Return to Same Page after Log In

    ROFL!

    (now go find that one )
    Frank Koehl
    "Cleverly Disguised as a Responsible Adult"

    frankkoehl.com

 

 

Similar Threads

  1. Replies: 11
    Last Post: 24 Jul 2013, 03:56 PM
  2. Replies: 2
    Last Post: 18 Jul 2012, 08:54 AM
  3. Return to search page after adding products to cart
    By CapitalC in forum General Questions
    Replies: 0
    Last Post: 19 Sep 2010, 11:37 PM
  4. How to return to product page after login?
    By dbabbage in forum Templates, Stylesheets, Page Layout
    Replies: 25
    Last Post: 10 Sep 2007, 10:55 AM
  5. How do I make the Add to cart return to the same page?
    By misspot in forum Templates, Stylesheets, Page Layout
    Replies: 8
    Last Post: 3 Jul 2007, 05:54 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg