Add validation for custom field
-
Hi there,
I’ve added a custom field on the WC Checkout page. The field is set to be mandatory.
When the user is not logged into Amazon, the field is added using the hook
woocommerce_after_checkout_billing_form
in the Billing section. This works fine for other payment gateways such as Paypal, Stripe and so on.In a scenario where the user is logged into Amazon and wants to complete the payment using Amazon Pay, the field is added using the hook
woocommerce_checkout_after_customer_details
.Even though the field is set to be mandatory and an asterik is displayed along with the field label indicating its mandatory, users are able to complete the payment when the field is left blanks.
Can you please guide me on how to ensure that validation is performed when the user tries to pay using Amazon Pay?
The field is not present in the list of fields for the below filters:
1.woocommerce_billing_fields
2.woocommerce_shipping_fields
Any help is greatly appreciated.
Thanks,
Pinal
- The topic ‘Add validation for custom field’ is closed to new replies.