VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: fenilananinicar on December 12, 2011, 19:12:49 PM

Title: How to redirect "Register and checkout" button in VM2
Post by: fenilananinicar on December 12, 2011, 19:12:49 PM
Hi,

question:How to redirect "Register and checkout" button in VM2

I looked in com_virtuemart/views/user but there's noting there which saying where to redirect page.

I read on forum that I must change some code in ps_shopper.php, but in VM2 I cant find such a file.

Which code I must change, which file, which folder?

Please, can someone help me?
Title: Re: How to redirect "Register and checkout" button in VM2
Post by: PRO on December 12, 2011, 19:43:36 PM
where are you redirecting them to?
Title: Re: How to redirect "Register and checkout" button in VM2
Post by: fenilananinicar on December 12, 2011, 20:01:38 PM
HI, tnx for a reply.

I want to redirect user to the same page where he fill the registration form :

/index.php?option=com_virtuemart&view=user&task=editaddresscheckout&addrtype=BT

, and write him a message that his registered now, and ask him to login.

Can you explain me where I must change the code?

Title: Re: How to redirect "Register and checkout" button in VM2
Post by: Milbo on December 12, 2011, 22:08:03 PM
He logs in automatically, when you allow that in your joomla settings.
Title: Re: How to redirect "Register and checkout" button in VM2
Post by: fenilananinicar on December 12, 2011, 22:28:59 PM
Hi,

If I understand right, in Joomla settings I must set "New user activation" to NO, for that. Is it? Or I must set something else?

I set it like I explained and user isn't logged in after registration.

By the way, I also redirected new user to:

/index.php?option=com_virtuemart&view=user&task=editaddresscheckout&addrtype=BT

when they click on ADD_TO_CART  button, in case there are guests. So there they can login if they have an account, or register if they don't.

Just to mention, I'm using Joomla 1.5.  and VM2 RC2.

So, where I show put a code for redirection? Or you have another suggestion?

Title: Re: How to redirect "Register and checkout" button in VM2
Post by: Milbo on December 13, 2011, 00:19:40 AM
?
the cart itself shows the possibility to login. I do not really understand your idea of the mod.
Title: Re: How to redirect "Register and checkout" button in VM2
Post by: fenilananinicar on December 13, 2011, 09:46:27 AM
My cart doesn't have possibility to login. I use version RC2G.

All I want is that user login before they start shopping, and if they do not have account, to register and then login.

Because I do not use Joomla login and registration form ( bacause lack of information needed for shop) I need to redirect users who do register to the same page where they filled a registration form, and ask them to login. A assume that this isn't hard to do with code.

So if you just can tell me where I should look for that in a files?

Really appreciate.
Title: Re: How to redirect "Register and checkout" button in VM2
Post by: Milbo on December 13, 2011, 11:42:08 AM
You must update to M, you cant update to the final without the M version. This is very important!
Title: Re: How to redirect "Register and checkout" button in VM2
Post by: fenilananinicar on December 13, 2011, 12:07:16 PM
I already changed a lot of files, I can't update now, or I loose all that, wont I?

So I just want to redirect register page, "Register and checkout" button actually, can you explain me how?

Title: Re: How to redirect "Register and checkout" button in VM2
Post by: Milbo on December 13, 2011, 12:48:40 PM
It depends which files. All file layouts can be put in a template and use the joomla template override method. You should update to the final and then start to mod vm2. And you must learn how to use template overrides.
Title: Re: How to redirect "Register and checkout" button in VM2
Post by: PRO on December 13, 2011, 14:01:10 PM
Quote from: fenilananinicar on December 13, 2011, 12:07:16 PM
I already changed a lot of files, I can't update now, or I loose all that, wont I?


http://forum.virtuemart.net/index.php?topic=90935.0
Title: Re: How to redirect "Register and checkout" button in VM2
Post by: fenilananinicar on December 13, 2011, 16:29:45 PM
:)

This start to look like Monty Python scene dialog.

We have discussion already, but you all guys seems to avoid answering on my very_strait_forward question which I asked few times till now:

How to redirect "Register and checkout" button in VM2??

So I need to repeat that.

I'm using VM RC2 version and Joomla 1.5.

I read on forum that I must change ps_shopper.php, in folder classes. But in this version of VM there is no such folder and such file.

So, please, can someone explain that to me?
Title: Re: How to redirect "Register and checkout" button in VM2
Post by: PRO on December 13, 2011, 17:35:04 PM
I guess you can TRY to change the form

<button class="button vm-button-correct" type="submit" onclick="javascript:return callValidatorForRegister(userForm);" title="Register And Checkout">Register And Checkout</button>
Title: Re: How to redirect "Register and checkout" button in VM2
Post by: Milbo on December 13, 2011, 17:42:23 PM
Quote from: fenilananinicar on December 13, 2011, 16:29:45 PM
How to redirect "Register and checkout" button in VM2??

I must admit, that I do not understand your question. From my point of view it is like someone asking for the pedals sitting on a motorbike and therefore I cant answer it.

Because the Register and checkout button IS doing a redirect. So when you do not understand this simple fact, why you start to mod files? sorry.
Title: Re: How to redirect "Register and checkout" button in VM2
Post by: alatak on December 13, 2011, 17:51:16 PM
Hi,

QuoteI read on forum that I must change ps_shopper.php, in folder classes. But in this version of VM there is no such folder and such file.
There are 2 versions of VirtueMart. The version 1, and the one you installed which is version 2.
The file ps_shopper.php comes from version 1, and NOT from version 2.
So the solutions that you migth have read saying that you should change that file are not valid for VM2.

QuoteHow to redirect "Register and checkout" button in VM2
where do you want to redirect the user?
It should be to the cart, and it is done like that.
Title: Re: How to redirect "Register and checkout" button in VM2
Post by: fenilananinicar on December 13, 2011, 20:06:56 PM
Quote from: BanquetTables.pro on December 13, 2011, 17:35:04 PM
I guess you can TRY to change the form

<button class="button vm-button-correct" type="submit" onclick="javascript:return callValidatorForRegister(userForm);" title="Register And Checkout">Register And Checkout</button>

In this line of code, isn't possible to see where it takes you after you click the button, and because of that I don't know how to change this line so that button takes me where I want to takes me.

When user fill the registration form and click on the button, he's being registered, and redirected to the HOMEPAGE. I want to change that, and redirect user to the same page where he filled a registration form, and finally where is that very same button.

Title: Re: How to redirect "Register and checkout" button in VM2
Post by: fenilananinicar on December 13, 2011, 20:20:31 PM
Quote from: Milbo on December 13, 2011, 17:42:23 PM
Quote from: fenilananinicar on December 13, 2011, 16:29:45 PM
How to redirect "Register and checkout" button in VM2??

I must admit, that I do not understand your question. From my point of view it is like someone asking for the pedals sitting on a motorbike and therefore I cant answer it.

Because the Register and checkout button IS doing a redirect. So when you do not understand this simple fact, why you start to mod files? sorry.

I know that button "Register and checkout" redirects me, and I know where it redirects me or user.

Sorry, my English isn't so good, and I suffer of lack of words. Maybe because of that it's hard for me to explain what I want, and its hard to understand me.

When user fill the registration form I want to register him and redirect him to the same page where he filled the registration form :

/index.php?option=com_virtuemart&view=user&task=editaddresscheckout&addrtype=BT

, and write him a message that his registered now, and ask him to login.

Can you explain me where I must change the code to do that?

Please, if you don't understand question, I can try to change the question sentence in order to be more precise.
I opened this topic in order to find solution of my problem, not to spread discussion, and practice my English.

Thank you all for your posts.
Title: Re: How to redirect "Register and checkout" button in VM2
Post by: Milbo on December 13, 2011, 20:49:04 PM
You should compare your version, with version M and update the files. Your problem is imho completly solved there.