Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom Fields are checked after Customer enters PayPal #857

Open
Fiorinol opened this issue Mar 1, 2021 · 3 comments
Open

Custom Fields are checked after Customer enters PayPal #857

Fiorinol opened this issue Mar 1, 2021 · 3 comments

Comments

@Fiorinol
Copy link

Fiorinol commented Mar 1, 2021

This plugin seems to only check the woocommerce_checkout_process hook when the customer clicks on "Pay Now" inside Paypal's interface, and not before the user goes onto Paypal like with default fields. This is bothersome as the customer goes through the entire process and gets thrown back into checkout when they're done entering all their payment information/logging into PayPal.

I have custom fields created from woocommerce_form_field, and I validate them as thus:

add_action('woocommerce_checkout_process', 'my_validation');

function my_validation() {
	wc_clear_notices();

	if ( empty( $_POST['field_1']) ){
		wc_add_notice( "Please Enter Field 1.", 'error' );
	}

	if ( empty( $_POST['field_2']) ){
		wc_add_notice( "Please Enter Field 2.", 'error');
	}

}

The behavior that I expect is that it gets checked at the same time as the other fields, as this is the recommended way to handle custom fields as per WooCommerce: https://docs.woocommerce.com/document/tutorial-customising-checkout-fields-using-actions-and-filters/

Environment (please complete the following information):

  • WordPress Version: 5.6.2
  • WooCommerce Version: 4.8
  • PayPal (Express) Checkout Plugin Version: 4.7
  • WooCommerce Multilingual: 4.8
  • Yoast 4.8
@addedlovely
Copy link

+1 Came across this today.

@jorgeatorres
Copy link
Member

From #807:

I am using Paypal Express checkout, I am only having Paypal checkout on Checkout page also I am skipping the cart. I have minimum order amount Error messages based on Customer postcode input, this works fine for default Paypal checkout. But we prefer to use Paypal Express checkout. Paypal express won't let the user to enter Paypal page if the minimum order amount is not reached, that's perfectly working, but our custom message is not getting display, only alert mark and red line is appearing.

Environment (please complete the following information):

WordPress Version - 5.4.2
WooCommerce Version - Version 3.7.0
PayPal (Express) Checkout Plugin Version - Version 2.0.3
Browser [e.g. chrome, safari] and Version - Chrome

@aadigital2020
Copy link

+1 Encountered this with a shipping method that hooks into woocommerce_checkout_process and the validation isn't performed until the user clicks Pay Now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants