View Single Post
  #8  
Old 11-12-2012, 10:12 PM
 
carpeperdiem carpeperdiem is offline
 

X-Guru
  
Join Date: Jul 2006
Location: New York City, USA
Posts: 5,399
 

Default Re: After login Stay on Current page

Quote:
Originally Posted by cherie
Here's an old code sample for 4.0/4.1 that might get you started:


In include/login.php, replace:
PHP Code:
if (!func_is_cart_empty($cart)) { 
with:
PHP Code:
if ($login_type == "C") {
    
func_header_location($redirect_to."/pages.php?pageid=29");
} elseif (!
func_is_cart_empty($cart)) { 

Works great in 4.5.4 -- except it fails on checkout page (OPC w/ajax)

What I did:
include/login.php

find:
PHP Code:
if (!func_is_cart_empty($cart)) { 

replace:
PHP Code:
// EDIT Redirect to account page on login
//if (!func_is_cart_empty($cart)) {
if ($login_type == "C") { 
        
func_header_location($redirect_to.'register.php?mode=update'); 
    } elseif (!
func_is_cart_empty($cart)) {
// END Redirect to account page on login 

On any page except OPCajax, a link to /login.php goes to /login.php and provides a form. After the customer logs in, customer is redirected to /register.php?mode=update -- exactly what I want.

However, if the login process starts on the OPCajax checkout page, the link to login makes a popup -- and then the login happens, but the popup hangs. If the customer closes the popup and reloads the page, the login was successful -

Anyone have a suggestion as to how to get this code working with the OPCajax login popup?

Thx
J
__________________
xcart 4.5.4 gold+ w/x-payments 1.0.6; xcart gold 4.4.4
Reply With Quote