X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   After login Stay on Current page (https://forum.x-cart.com/showthread.php?t=61893)

xtech 12-03-2011 03:25 AM

After login Stay on Current page
 
I have a x cart Pro 4.4.2 based store.I have added login link in one of my static page by adding login.php.But after login I want to stay on that current page.Currently after login it goes to cart page if some product added in cart or in home page.

I want to stay current page after login.How to achieve that in 4.4.x version?

Thanks to all.

cflsystems 12-03-2011 07:06 AM

Re: After login Stay on Current page
 
You need to modify the login php script and change the redirect to current page instead. There will be at least 2 places in the file to modify - one for if anythign in cart and one if nothing in cart on successful login

xtech 12-03-2011 09:03 PM

Re: After login Stay on Current page
 
Hi Steve,

Thank you for your quick reply.But how to achieve that? What exactly to be change can you help me?

Thanks.

cflsystems 12-04-2011 06:37 AM

Re: After login Stay on Current page
 
Yes I can help you with this, contact me at the email in my signature

xtech 12-04-2011 07:10 AM

Re: After login Stay on Current page
 
Hi,
Can you help me here?

Thanks.

xtech 12-06-2011 04:26 AM

Re: After login Stay on Current page
 
Hi,
Anyone in the forum to solve the issue !!! I want help.

Thanks to all.

cherie 12-14-2011 01:43 PM

Re: After login Stay on Current page
 
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)) { 


carpeperdiem 11-12-2012 10:12 PM

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

carpeperdiem 12-02-2012 07:52 AM

Re: After login Stay on Current page
 
Update:

I bailed on OPC and am back using CheckoutOne so I can use this code -- except in CheckoutOne, it redirects the customer to the account page regardless of cart or checkout status.

So I need to edit the code to only redirect to account page IF not in checkout or if cart is empty.

Any ideas? Thanks.
J


All times are GMT -8. The time now is 04:05 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.