Support » Plugin: WooCommerce Email Validation » Apple Pay using WooCommerce Stripe does not work when using this plugin

  • Apple Pay using WooCommerce Stripe does not work when using WooCommerce Email Validation. Because Apple Pay is supposed to allow you to not enter any details, its passed from the phone. But when this plugin is enabled it shows the error then email address is not entered.

Viewing 1 replies (of 1 total)
  • George

    (@subscriptiongroup)

    Maybe something like this would help? You’d need to update the gateway details to whatever you use.

    
    add_filter( 'woocommerce_checkout_fields', 'gruum_remove_validation_for_checkout_fields', 99999 );
    function gruum_remove_validation_for_checkout_fields( $checkout_fields ) {
    
    	if ( ! WC()->session ) {
    		return $checkout_fields;
    	}
    
    	$session = WC()->session->paypal;
    	$is_paypal_checkout = ( is_a( $session, 'WC_Gateway_PPEC_Session_Data' ) && $session->payer_id && $session->expiry_time > time() );
    
    	if ( !$is_paypal_checkout ) {
    		return $checkout_fields;
    	}
    
    	unset( $checkout_fields['billing']['billing_email-2'] );
    	return $checkout_fields;
    }
    
    

    @hlashbrooke should probably come up with a similar solution on this plugin as it’s an issue for other gateways also.

    A code similar to the above should also fix https://wordpress.org/support/topic/plugin-is-not-compatible-with-paypal-express-checkout-and-amazon-pay/ from @infonetzlichtcom

    • This reply was modified 3 months, 2 weeks ago by George.
    • This reply was modified 3 months, 2 weeks ago by George.
Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.