- Posts: 56
- Thank you received: 1
Regular Expression on Custom Fields
4 years 1 month ago - 4 years 1 month ago #345939
by jiawen
Regular Expression on Custom Fields was created by jiawen
For the checkout form, I have added few custom fields. For normal registration form, I would like to set the custom fields to required and optional in guest checkout form. Is there any way to do this?
Last edit: 4 years 1 month ago by jiawen.
Please Log in or Create an account to join the conversation.
4 years 1 month ago #345943
by nicolas
Replied by nicolas on topic Regular Expression on Custom Fields
Hi,
You would need to turn off the required setting of the custom field, and instead, implement the event onBeforeHikaUserRegistration(&$ret, $input_data, $mode) in a plugin of the group "hikashop".
If $mode is equal to 2 then you're in guest mode, and otherwise, you're in registration mode.
In
you'll have an object with the user custom fields. And in
you'll have an object with the address custom fields of the billing address. And in
you'll have an object with the address custom fields of the shipping address.
You would need to turn off the required setting of the custom field, and instead, implement the event onBeforeHikaUserRegistration(&$ret, $input_data, $mode) in a plugin of the group "hikashop".
If $mode is equal to 2 then you're in guest mode, and otherwise, you're in registration mode.
In
Code:
$ret['userData']
Code:
$ret['addressData']
Code:
$ret['shippingAddressData']
Please Log in or Create an account to join the conversation.
Time to create page: 0.043 seconds