woocommerce-gateway-paypal-express-checkout
woocommerce-gateway-paypal-express-checkout copied to clipboard
Custom Fields are checked after Customer enters PayPal
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