Jump to content

Hide payment methods when required fields are not saved


Amazzing

Recommended Posts

Hello guys,

 

I think I found a bug in one page guest checkout:

 

1) Payment methods are not displayed until you fill in required fields for guest checkout. This is OK.

2) As soon as you fill in all required fields, and hit “save”, payment methods are displayed. This is OK too.

3) But imagine you saved all required fields and suddenly noticed a mistake in one of them. Of course you try to edit it, or just leave it blank. In this case payment methods do not disappear. Even if you leave blank a required field, they are visible and active.

 

I know that after editing any field, the “save button” appears again and you have to press it in order to update the data in the blanks. But I think payment methods should be hidden until you save the updated information.

It may be confusing for a customer to see the “save” button above the payment methods.

 

I found the statement that hides payment methods until you fill in required fields.

It is in OrderOpcController.php:

if (!$this->isLogged)
return '<p class="warning">'.Tools::displayError('Please sign in to see payment methods').'</p>';

So, I am trying to add one more statement, that hides payment methods in case fields are updated and not saved yet.

But I can't find the name of the condition, when updated fields are not saved yet...

I mean, what should I insert insead of xxx here?

if (!$this->xxx)
return '<p class="warning">'.Tools::displayError('Please press save button to proceed').'</p>';

Any help is appreciated.

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