![]() |
Login - Stay on Page |
Post Reply ![]() |
Author | |
joshs ![]() Newbie ![]() Joined: 07-April-2009 Location: Utah Status: Offline Points: 14 |
![]() ![]() ![]() ![]() ![]() Posted: 06-June-2011 at 11:29am |
Using 4.1a.
I am trying to set up a login with redirect back to the current page. I don't want the customer to be directed away from what they are looking at. How can I login customers in and keep them on the current page? I noticed in the checkout.asp page code this exists: But it doesn't always work. dim pcRequestRedirect pcRequestRedirect=getUserInput(request("redirectUrl"),250) if Session("SFStrRedirectUrl")<>"" AND pcRequestRedirect="" then else Session("SFStrRedirectUrl")=pcRequestRedirect end if Thanks for any ideas. Josh 801 906-8396 |
|
Josh Shirley
josh@windsurfutah.com |
|
![]() |
|
macleather ![]() Newbie ![]() Joined: 23-June-2008 Location: Los Angeles Status: Offline Points: 3 |
![]() ![]() ![]() ![]() ![]() |
Hi Josh,
Here's the link to the WIKI. Scroll down to "stay on page.." http://wiki.earlyimpact.com/productcart/settings-misc?s[">=stay&s[">=page Alan |
|
![]() |
|
joshs ![]() Newbie ![]() Joined: 07-April-2009 Location: Utah Status: Offline Points: 14 |
![]() ![]() ![]() ![]() ![]() |
the link doesn't work.
|
|
Josh Shirley
josh@windsurfutah.com |
|
![]() |
|
macleather ![]() Newbie ![]() Joined: 23-June-2008 Location: Los Angeles Status: Offline Points: 3 |
![]() ![]() ![]() ![]() ![]() |
Josh,
Sorry, try this. http://wiki.earlyimpact.com/productcart/settings-misc?s[%22%3E=stay&s[%22%3E=page |
|
![]() |
|
joshs ![]() Newbie ![]() Joined: 07-April-2009 Location: Utah Status: Offline Points: 14 |
![]() ![]() ![]() ![]() ![]() |
Humm, maybe I am missing something or I haven't asked the question clearly.
I want my login form to allow a customer to login and stay on the current page, instead of being redirected to custpref.asp. |
|
Josh Shirley
josh@windsurfutah.com |
|
![]() |
|
macleather ![]() Newbie ![]() Joined: 23-June-2008 Location: Los Angeles Status: Offline Points: 3 |
![]() ![]() ![]() ![]() ![]() |
Ooops, I did misunderstand. I'm afraid I can't help on that one.
|
|
![]() |
|
Greg Dinger ![]() Certified ProductCart Developers ![]() ![]() Joined: 23-September-2006 Location: United States Status: Offline Points: 238 |
![]() ![]() ![]() ![]() ![]() |
Josh - have a look at atc_instprd.asp - the module that redirects from instprd.asp back to some page for the "stay on page" feature. I authored the bulk of that code and had to achieve a similar goal. What it does is to make decisions based on the originating URL as to what sort of page the request came from. Then it eventually forms a URL to return to.
Your case will differ. You still need to determine where you came from, and thereby know where to return to. But it's a little trickier since the current login already performs the custpref.asp redirect that you now need to overcome. If you have some time and need this done for you, we could take it on. But I have a suspicion that this is a large enough task that it's going to be tough to tackle here in the forum with a hint one way or another.
|
|
![]() |
|
joshs ![]() Newbie ![]() Joined: 07-April-2009 Location: Utah Status: Offline Points: 14 |
![]() ![]() ![]() ![]() ![]() |
Looks like Session("SFStrRedirectUrl")= "whatever page redirecting to"
seems to do it. Although AJAX would be smoother. Can I establish sessions with AJAX? I will post up the form after I finalize it. |
|
Josh Shirley
josh@windsurfutah.com |
|
![]() |
|
joshs ![]() Newbie ![]() Joined: 07-April-2009 Location: Utah Status: Offline Points: 14 |
![]() ![]() ![]() ![]() ![]() |
Finally had a chance to re-engage this. This seems to work. Add this to the login link. onclick="return false;" id="LG" so it would look like: <a href="Checkout.asp?cmode=1" onclick="return false;" id="LG">Log In</a> This needs to be added to the inc_footer.asp file before the '// Restore Cart line. <% if session("idCustomer")="0" or session("idCustomer")="" then %> <div id="LGMsgDialog" title="Login" style="display:none"> <div id="LGMsg" style="width: 80%;"> <div class="ui-main"> <form name="login" method="post" action="checkout.asp?cmode=1"> <table width="100%"> <tbody style="text-align:left;"> <tr> <td>Email</td><td><input type="text" size="35" name="LoginEmail"></td> </tr> <tr> <td>Password </td><td><input type="password" name="LoginPassword"></td> </tr> </table> <input name="PassWordExists" type="hidden" value="YES" > <input type="hidden" name="SubmitCO.y" value="1"> <input type="hidden" name="redirectUrl" value="" id="location"/> <script type="text/javascript"> document.getElementById('location').value=(location.href); </script> </form> </div> </div> </div> <script type="text/javascript"> $(document).ready(function() { $("#LGMsgDialog").dialog({ bgiframe: true, autoOpen: false, resizable: false, width: 400, modal: true, buttons: { ' Close ': function() {$(this).dialog('close');}, ' Open New Account ': function() {location='<%=tempFooterURL%>checkout.asp?cmode=1'; $(this).dialog('close'); }, ' Submit ': function() {document.login.submit(); $(this).dialog('close');} } }); $('#LG').click(function(){ $("#LGMsgDialog").dialog('open'); return ; }); }); </script> <% end if %> The "redirecturl" needs to be generated correctly and VB requests pull in long url with the 404 SEO errors. Javascript generates the 'location.href' after the page is rendered so the redirecturl is correct.
|
|
Josh Shirley
josh@windsurfutah.com |
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |