Jump to content

Redirect to "...validation.php" after account informations is saved in one page guest checkout


Amazzing

Recommended Posts

Hello dear community,

 

Here is my case:

PS 1473. All orders are one page guest checkout. The only payment option is Cash on Delivery.

 

My goal is to redirect user to order validation page right after he clicks 'Save' button, that is used for saving account informations.

 

What I did so far, was adding some JS code to "save" button in order-opc-new-account.tpl:

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

 

It is really simple and it works. But if there are some errors in user fields, page is reloaded and no error message is displayed.

 

So, I need to call JS only in case there are no errors in user fields. It has to look something like that:

{if no errors} onclick="location.href ='modules/cashondelivery/validation.php';"{/if}

 

Can you please tell, how can I define "no errors"? I am sure it is a really easy question for those, who is familiar with PS smarty logic :)

 

If you have any other suggestions about skipping the payment selection and redirecting to validation.php, I would be really glad to hear that!

 

Thank you in advance for your attention.

Link to comment
Share on other sites

  • 1 year later...

I have changed only the first line :

 

<p class="submit">

<input type="submit" class="exclusive button" name="submitAccount" id="submitAccount" value="{l s='Save'}" onclick="location.href =

'modules/cashondelivery/validation.php';" />

</p>

 

I am using prestashop 1.5.4.1

ERROR : TECHNICAL ERROR : unable to send login informations

Redirects to hompage

This is what i am trying to acomplish

http://www.prestashop.com/forums/topic/249427-one-page-checkout-save-account-into-confirm-payment/page__p__1238560?do=findComment&comment=1238560

 

After redirection to homepage , it seems that account is created

Link to comment
Share on other sites

  • 10 months later...

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...