Jump to content

portal7

Recommended Posts

A few months ago, I made some changes in prestashop (can not remember if it was for a module or modifying any of the controllers) where if you register as a customer through an internal link a URL parameter.

 

This allowed.

 

- Register as a customer (nothing out of the ordinary)

- Once registration is complete, instead of redirecting to "my account", then the controller (or module) redirected to my module.

 

On the other hand, if only you sign up as a customer, you redirected directly to "my account".

 

In short.

 

Someone can me or have any idea how to help? I do not remember how I did it, nor do I have a backup to go back to back. (disastrous, I'm starting to do backups and versioning from today): P

 

Example or url:

 

www.mistore.com/index.php?source=plumber&back=module-blockcollaborate-verify  (this when you register)

Link to comment
Share on other sites

Same question here, i have guest Account registration and only one payment module and free shipping. I want after registration ( Name Surname, Address, Code, City, Country) a redirect to the module payment-execution.tpl. I try with this:

 

<input type="submit" class="exclusive button" name="submitAccount" id="submitAccount" value="{l s='Save'}" onclick="location.href ='modules/bill/payment.php';" />

 

The redirect works but the system don´t save my registration, they say "unable so save address".

 

Another try (dont work,nothing happens):

 

 <form method="post" onsubmit="window.location = '{$link->getModuleLink('bill', 'payment')}'" id="new_account_form" class="std" autocomplete="off" autofill="off">

 

How can i save the address and than redirect to the Order summary site? 

Link to comment
Share on other sites

In controllers/front/AuthController.php  look for this line:

Tools::redirect('index.php?controller='.(($this->authRedirection !== false) ? url_encode($this->authRedirection) : 'my-account'));

You can replace it with for example:

Tools::redirect('your-page-link--here'); 

It's located in multiple places in the code, a bit try and error will reward your efforts.

 

Same question here, i have guest Account registration and only one payment module and free shipping. I want after registration ( Name Surname, Address, Code, City, Country) a redirect to the module payment-execution.tpl. I try with this:

 

<input type="submit" class="exclusive button" name="submitAccount" id="submitAccount" value="{l s='Save'}" onclick="location.href ='modules/bill/payment.php';" />

 

The redirect works but the system don´t save my registration, they say "unable so save address".

 

Another try (dont work,nothing happens):

 

 <form method="post" onsubmit="window.location = '{$link->getModuleLink('bill', 'payment')}'" id="new_account_form" class="std" autocomplete="off" autofill="off">

 

How can i save the address and than redirect to the Order summary site? 

Redirection is client-side so it happens before server-side code runs, thus you get the error.

Link to comment
Share on other sites

  • 3 months later...

In controllers/front/AuthController.php  look for this line:

Tools::redirect('index.php?controller='.(($this->authRedirection !== false) ? url_encode($this->authRedirection) : 'my-account'));

You can replace it with for example:

Tools::redirect('your-page-link--here'); 

It's located in multiple places in the code, a bit try and error will reward your efforts.

 

Redirection is client-side so it happens before server-side code runs, thus you get the error.

 

Doesn't matter if I put:

 

 

Tools::redirect('/your-page-link--here.html'); 

 

or

 

Tools::redirect('your-page-link--here.html'); 

 

(page located in the root)

 

or 

 

Tools::redirect('your-page-link--here'); 

 

 

 

I get 404 with href:

 

http://localhost/p1541/index.php?controller=your-page-link--here  [i can't get rid of index.php?controller= phrase]

 

 

 

 

I don't want to redirect to a CMS page (I want the page to be hidden from the Sitemap view), so I'm more happy with simple .html page.

 

Another thing I need:

 

after creation of an account (within function processSubmitAccount) I want to redirect a user to my-custom-html-page for 3-5 seconds, and then to 'my-accout' (I mean this user account view).

 

So, in other word, standard action of presta with showing my html page for a moment before user gets redirected to his/her account view. I know it's weird - but that's what a client wants...

 

Is it possible?

 

 

Thanks in advance.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...