Link to home
Start Free TrialLog in
Avatar of TonyCabone
TonyCabone

asked on

'Send Registration' redirecting to index.php? for new VirtueMart accounts

Hi,

For some reason when a new user hits the 'Send registration' button to register a new account, they are redirected to index.php with nothing but the confirmation message displayed.

The account is setup & everything works fine, only the index page has lots of images and the message is actually pushed below the users view. This is unnerving and confusing.

How can I make the button redirect to a different page?

I run joomla 1.5, virtuemart 1.14, new account activation is turned on.

I have been searching for a while, seems a common problem but no common fix available.

Please help, 500 up for grabs
Avatar of Jesse Matlock
Jesse Matlock
Flag of United States of America image

Hey Tony.. what version of Joomla are you running ? (1.5.??)
Avatar of TonyCabone
TonyCabone

ASKER

1.5.15
FYI
 - optional account registration
 - account activation ON
 - secure url & home page url are the same (http//www.....)
 - HOMEPAGE: shop.index
 - ERRORPAGE: shop.error
Great.. ok..
You should be able to open:
components/com_virtuemart/themes/default/templates/common/login_form.tpl.php
(change the name of the theme if you're NOT using the default one, of course)

and at the bottom.. change this:
      <input type="hidden" name="return" value="<?php echo $return_url ?>" />
To:
      <input type="hidden" name="return" value="URL_WHERE_YOU_WANT_TO_REDIRECT" />

TEST and let me know how it goes... ;)
Sorry cloud9, same problem still exists. We go to a page where VM component & modules appear underneath the images I have on the index page.
And you changed the URL to where you WANT the user to be redirected? Ok.. do you have a link to your site?
Also, are you using the Joomla reg/login form or VM reg/login form?
The same site you helped me with on the last thread.

VM reg/login form & VM login module (where there is a 'register' link that takes you to the form)
re
"And you changed the URL to where you WANT the user to be redirected? Ok.. do you have a link to your site?"

I tried relative & absolute url, neither made a difference so I've reverted to original code for now.
OK. great.. then we're looking at the VM module.. makes sense.

Ok, first.. check in the VM login module settings itself. for what u have set for the redirection.. set it to 'same page' and let me know what that does..

Alternatively, if we can connect directly (email or IM) we can run through this more quickly,.. and reply here with solution once solved.. what ever you're comfortable with.
Has always been set to same page. It doesn't seem to effect anything no matter what I change it to.

tonycabone@gmail.com

thank you
Merry Christmas to you by the way! Probably time for us to take a break from coding! :D
Merry Christmas to you as well Tony! Yes, I think a break is very appropriate.. I'll connect with you after the weekend.. and we'll get this cleared up.
Happy new year!!

Any more ideas on possible solutions for this problem?
Hi Tony.. Happy New Year to you too!

ok, back in the game, lets this:
Go to:
administrator/components/com_virtuemart/html/checkout_register_form.php
Open that file and on line 32 or there about, you should see this:

      vmRedirect( $sess->url( 'index.php?page='.HOMEPAGE, true, false ), $msg );


Try changing the url to something absolute, just to see if this is creating the desired effect, like your contact page - something like this:

      vmRedirect( $sess->url( 'index.php?option=com_aicontactsafe&view=message&layout=message&pf=1&Itemid=54, true, false ), $msg );


And let me know if that works.. this is just to let us know we're on the correct piece of code to track this down..

Boy, this is one reason why we stopped using VM, it is just unpredictable.. one install works, another doesn't, another yet again breaks in a different area lol. good times. !
hmm when I change that I get "Parse error: syntax error, unexpected T_DNUMBER...." when I try to navigate to registration form
CORRECTION

if I enter a complete url (http://www.site.com.au/page32) the registration form works but still redirects to index page

T
Interesting. ok. I will research further and see what we find.
Tony,
are you using Joomla SEF or any other .htaccess re-writes on this site?
OK, try this:

open this file:
administrator/components/com_virtuemart/classes/ps_shopper.php and at or around line 460, you will see this:
[code]
                  if( !empty( $_SESSION['cart']['idx'])) {
                        $redirect_to_page = 'checkout.index';
                  } else {
                        $redirect_to_page = HOMEPAGE;
                  }
                  vmRedirect( $sess->url( 'index.php?page='.$redirect_to_page, false, false ), $VM_LANG->_('REG_COMPLETE') );
            }
[/code]


Change this part:
[code]
vmRedirect( $sess->url( 'index.php?page='.$redirect_to_page, false, false ), $VM_LANG->_('REG_COMPLETE') );
[/code]

To this:
[code]
vmRedirect( $sess->url( 'http://www.domain.com/page-to-redirect-to/', false, false ), $VM_LANG->_('REG_COMPLETE') );
[/code]
Still get the 'Cart' attaching itself to the frontpage template :( Even if I enter "www.google.com", the problem prevails.

Could this be a template issue? If the cart redirected to a page with the default template it be ok but for some reason it always uses the template assigned to the front page. What a pain!

Appreciate your patience & ongoing assistance, surely we're nearly there..
What about "$redirect_to_page = HOMEPAGE" ?

Could that have anything to do with it? Please excuse me if it seems a silly question, I'm not an expert coder.

Thanks again.
The problem with changing: $redirect_to_page = HOMEPAGE" is that this is only a part of the equation.. if you look at vmRedirect, you will see that HOMEPAGE only inserts a 'page' name.. not the URL.. so, it may insert something like 'page=shop.registration' etc.. so, just changing that variable will break the redirect, it may actually keep you on the same page, but it'll throw errors as well.

Ok, let's try this 'hack' and see if it works.

Create a php file with this content:

<?php
if( !defined( '_VALID_MOS' ) && !defined( '_JEXEC' ) ) die( 'Direct Access to '.basename(__FILE__).' is not allowed.' );

header( 'Location: http://www.domain.com/page-to-redirect-to-after-registration/' ) ;
?>

Change the URL to the exact URL you want the person to go to after registration, like the main store page, etc.

and place it in the administrator/components/com_virtuemart/html directory

Then, in VM Admin go to Configuration - Security Tab and change the Homepage field to:
shop.redirect

Test this and see if that works..

what should the file be called?
i tried calling it shop.redirect.php but the same problem still exists.
Hi Tony,
Yes, name the file sop.redirect.php - sorry for not including that in the description.

Well, at this point... and without any response from the VM developers,.. the best I can do is continue to search/try new solutions...

Please double check that your Store and Secure URLs are correct, turn OFF any SEO, set Account Registration to Optional and see if that resolves the error.

I'll hang in here with you and do the best I can ;)
Store & Secure URL's are the same, both to the root directory and both http://
SEF/SEO turned off
Still set to optional account registration.

Thanks for your help thus far. I can't believe a solution is proving so difficult!! I will perhaps request some attention from moderators.
I hear ya.. to be honest, this is all supposed to be internally controlled within VM, it just never works right lol. Again, I really want to 'love' VM, have even contributed to the project, etc.. but, I stopped using it some time back because of these types of issues, and the Devs not addressing these types of bugs even after major version changes.. But, we'll press on and see what we can find out.. ;D
Appreciate your enthusiasm cloud9- I really can't afford to give up on this one :o
;) I hear ya.. this is an important user experience piece, part of my frustration with it since UI/UX is my passion.. here for the ling haul.
Hey Tony,
Please be sure to revert the changes we've made so far, remove the shop.redirect.php file and return your HOMEPAGE field in VM admin > configuration > security to shop.index

:)
I've posted a Bug to the VM tracker.. please let me know if you would like anything added to it:
http://dev.virtuemart.net/cb/issue/2843

Also, just to make sure, what versions of Joomla an VM are installed?
Joomla! 1.5.15 Stable [ Wojmamni Ama Mamni ] 05-November-2009 04:00 GMT

VM 1.14
Hi Tony..

Well, I have searched, scoured,.. even installed and trouble shot this to no end. I cannot reproduce this error on my new install ALTHOUGH I KNOW we have been faced with this before on another install! As a developer, this is one of the frustrating parts about VM,.. it's highly inconsistent and unreliable. I'll keep looking for the cause,.. but at this point, without feedback from VM on the bug I have submitted.. we're kinda sitting here, waiting.
Howdy cloud9,

Yes no one seems to be keen to assist (apart from yourself) so I'm also sitting and waiting! Oh well, the joys of IT.

I've convinced the client to go with automatic registration which eliminates the problem.

T
ASKER CERTIFIED SOLUTION
Avatar of Jesse Matlock
Jesse Matlock
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks for the tip, I assume they're not compatible with Joomla!

What about OS commerce?

Noticed you're racking up the points, nice work!
Thanks for all your help, looks like we'll have to give up on this one considering the developers won't come to the party.
Hey Tony,

Thanks for the accepted answer! Actually, the first two carts I listed are 'inclusion' type carts... so you include them into an existing website/design.. the last one is more of a standard cart with a store front, etc.. that you can restyle to look like your Joomla site, etc.
The inclusion type carts are great because they allow you to include a file (or two) into the head code of you site, and then place forms for each product you wish to sell. They each have an admin area for setting up config settings, payment and shipping vendors, etc. But, basically, they are a more scalable, reliable solution to using Paypal's cart and you keep the buyers on your store.

Nano-cart is still in beta, and is the lighter of the two. The nice thing about Nano-Cart is that you buy a license and own it.. you dont have to pay hosting fees for the cart each month.

FoxyCart has more features, because its been out longer.. but, you have to pay $19 a month for it..  So, depends on what you need, the clients budget, etc..

OsCommerce has been around a LONG time.. and is a decent app.. but it's dated just like VM and has many limitations. One aspect that can't be changed in OSC is the admin interface.. which is AWFUL ! If you decide to go with OSC, then buy the 'customized' version from CRE Loaded. It's costs money, but you actually get the app setup the way it should be, so it works properly and is reliable, etc.

That's our take on commerce apps.. we've been building commerce sites for the last 6-7 years and have really been unimpressed with the available offerings in the 'lower to middle end'. This year our team is planning on introducing a new cart system for Joomla 1.6, but that wont be till year end.

Take care and let me know if you need anything else!
Did you guys ever find a solution to this?

I have a thread opened with the same question....I just want to change the redirect after some submits registration?

Hi Guys,
I too really really need to know the solution to this problem.
Im using the Virturemart registration form, after registering i need the user to be redirected to a "Thank you , please check your email for the activation link" page, but however it gets redirected to index.php.

This is really frustrating, ive tried everything...virtuemart forum has no answers to this issue. Apparently still hasn't been fix.
Basically i done and have everything that Tony has done.
My site is http://www.allstarfitness.com.au/ its live and i really need to fix it asap.

any help would be much appreciated. Thanks in advanced

Chi