Announcement

Collapse
No announcement yet.

Login Redirect to Referer Page

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Login Redirect to Referer Page

    Hi all
    How can I redirect my users to the very exact page they were viewing before they decided to login?

    Lets say a customer is looking at a particular product page and they decide to login,
    after the login process they should get sent to the same product page they came from,
    however they're sent to the store-front instead...

    As an attempt to do this in the LOGN page I changed the
    value of the statement below from SFNT to PROD

    <input type="hidden" name="Screen" value="PROD">

    however this will take me to a generic blank product page
    where the product name, description and price are undefined
    and not back to the same product I was viewing before hand.

    How can I accomplish this?
    Last edited by BenMirkhah; 04-04-06, 06:48 PM.

    #2
    That gets a little complicated.

    You would have to set a variable to track what screen they were on prior to clicking on the login button, then call that variable in your Screen= action in the login page template.

    Since you wont know where exactly the customer may click on Login, this could become very complicated.

    You could set a cookie to track and update which screen they are on, or you could pass the screen code via a hidden variable through every screen using the global header.

    You'd also have to add a conditional to check if the screen is CTGY or PROD, and if it is, also set and pass the variable for the Category_Code or Product_Code to refer to the specific product or category they were viewing.

    Comment


      #3
      Yes, I contemplated doing that however with MM5 gone are the days of MvAssign,
      or at least I don't know the syntax to assign variables in MV5 and I don't have the
      compiler for MM5 to get down and dirty...

      What's frustrating is that when we planed our upgrade to MM5 I called and specificly
      asked the techies at Miva for such a functionality and they said that it's simple and
      has been done before and documented in their forum, little things like that make
      Zen Cart look like a smarter choice! *sigh*

      Comment


        #4
        On the form post or link to the login page, you need to pass the product code. Then in the Login form, you need to add the hidden input value of the product code...now, what happens if they are on a category page?
        Bruce Golub
        Phosphor Media - "Your Success is our Business"

        Improve Your Customer Service | Get MORE Customers | Edit CSS/Javascript/HTML Easily | Make Your Site Faster | Get Indexed by Google | Free Modules | Follow Us on Facebook
        phosphormedia.com

        Comment


          #5
          The user will be on a product page since I have placed an actual login box for them in there to make it easier (courtesy of the Lynda Freeman's code in this post
          http://extranet.miva.com/forums/show...ighlight=login ), how do I pass the product code to the login page, do you know the exact name of that hidden input you mentioned?

          Comment


            #6
            Change:
            Code:
            <a href="&mvt:global:secure_sessionurl;Screen=LOGN&Or der=0&Store_Code=&mvt:global:Store_Code;">
            to:

            Code:
            <a href="&mvt:global:secure_sessionurl;Screen=LOGN&Or der=0&Store_Code=&mvt:global:Store_Code;&Product_Code=&mvt:g.global:product_code">
            that will pass the product code to the login page...then just use:

            <input type=hidden name=Product_code value=mvt:g.global:Product_Code
            Bruce Golub
            Phosphor Media - "Your Success is our Business"

            Improve Your Customer Service | Get MORE Customers | Edit CSS/Javascript/HTML Easily | Make Your Site Faster | Get Indexed by Google | Free Modules | Follow Us on Facebook
            phosphormedia.com

            Comment


              #7
              Took me an hour to make it fully functional, but I LOVE YOU MANNNN!!! =)
              Thanks a lot, this solved a huge UI hurdle

              Comment

              Working...
              X