Skip to main content

Regular Expression on Custom Fields

4 years 1 month ago - 4 years 1 month ago #345939 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
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
Code:
$ret['userData']
you'll have an object with the user custom fields. And in
Code:
$ret['addressData']
you'll have an object with the address custom fields of the billing address. And in
Code:
$ret['shippingAddressData']
you'll have an object with the address custom fields of the shipping address.

Please Log in or Create an account to join the conversation.

Time to create page: 0.043 seconds
Powered by Kunena Forum