VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: kratzi on February 02, 2016, 00:59:46 AM

Title: Login redirects to profile instead of cart
Post by: kratzi on February 02, 2016, 00:59:46 AM
I am running a testversion on J 3.4.8 and VM 3.0.12.
When a customer is already a registered user and goes to checkout and wants to login he is not redirected to the checkout process but to his profile. This is actually confusing as the customer wants to checkout and not go to his profile. Also in my earlier version J 2.5.28 and VM 2.6.14 the customer is redirected to the cart as it should be.

Is this  wanted and how can I solve this.???

Thank you

kratzi
Title: Re: Login redirects to profile instead of cart
Post by: kratzi on February 03, 2016, 12:16:59 PM
I have yesterday installed a fresh version of VM 2.6.14 and J.2.5.28 and the login feature works good.
This means that there were some changes which however are not customer friendly at all. It does not make any sence why a customer who wants to checkout and is already a customer is redirected to login instead of the cart.

Why is this working in the old VM but not in the new VM 3 any more.

Title: Re: Login redirects to profile instead of cart
Post by: jenkinhill on February 03, 2016, 13:12:58 PM
Quote from: kratzi on February 02, 2016, 00:59:46 AM
When a customer is already a registered user and goes to checkout and wants to login he is not redirected to the checkout process but to his profile.

That is not the default action in VM3 - it is still the same as in VM2, if all the shopper fields are filled already then the address details are displayed in the cart and the shopper continues to checkout.

Are you using the default VM templates?
Title: Re: Login redirects to profile instead of cart
Post by: GJC Web Design on February 03, 2016, 13:40:38 PM
on a clean install standard protostar template the login from the cart page login form works perfectly..

you stay on the cart page

Title: Re: Login redirects to profile instead of cart
Post by: kratzi on February 03, 2016, 16:02:36 PM
Ok I have a clean installation of J 2.5.28 & VM 2.6.14 and J 3.4.8 & VM 3.0.12. In both versions I even do not have installed another template than the original ones.

In both versions when I have a new customer and he goes to checkout and enters data for registration including username and password everything is perfect.
The user finishes the shopping and logs out. But now when the same customer (who is already registered from before) puts products into the cart and clicks on checkout he is redirected to the page where he can either register again or login. When the customer now logs in with username and password he is redirected back to cart in  2.5.28 & VM 2.6.14 but to profile page in J 3.4.8 & VM 3.0.12.

At the moment I only have the installations on my localhost but in case you can not reproduce this I will surely install both versions on a public webspace.

Regards

Kratzi


Title: Re: Login redirects to profile instead of cart
Post by: Jörgen on February 03, 2016, 16:13:22 PM
Hello

i am not sure if this is the solution. But you could always try. I use the slick vm login module for my login and I expetrienced exactly the same thing. When in checkout I was redirected to the account page. I saw that this was the setting for slick login after login. I changed this to checkout and i now have what i want. Check you login module, maybe you have the same issue.

regards

Jörgen @ kreativ fotografi
Title: Re: Login redirects to profile instead of cart
Post by: jenkinhill on February 03, 2016, 16:34:17 PM
Which leads to the question. Are you using ther Joomla login module instead of VM login? If so then set  Login Redirection Page in module config to Cart - I assume you have a menu link to the cart?

But best is never to use Joomla's mod_login.
Title: Re: Login redirects to profile instead of cart
Post by: Spiros Petrakis on February 04, 2016, 11:17:13 AM
Hi kratzi,

this is fixed for the upcoming vm version, open the user/tmpl/edit_address.php file (or your template override for this file) and replace


$url = JRoute::_ ('index.php?option=com_virtuemart&view='.$rview.$task, $this->useXHTML, $this->useSSL);


with


$url = 'index.php?option=com_virtuemart&view='.$rview.$task;


Title: Re: Login redirects to profile instead of cart
Post by: kratzi on February 05, 2016, 22:34:56 PM
Thank you Spyros,

This was the solution. It works awesome. You are my hero :D
Title: Re: Login redirects to profile instead of cart
Post by: Spiros Petrakis on February 06, 2016, 09:53:36 AM
Hi Kratzi,

good to know that the fix works for you also, all credit should go to Valérie Isaksen that provided the actual fix.

Afaik a new version will be available soon (3.0.13 or 3.0.14 probably) that will include this fix also.