Regular Expression on Custom Fields

  • Posts: 56
  • Thank you received: 1
2 years 4 weeks ago #345939

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: 2 years 4 weeks ago by jiawen.

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
2 years 4 weeks ago #345943

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

$ret['userData']
you'll have an object with the user custom fields. And in
$ret['addressData']
you'll have an object with the address custom fields of the billing address. And in
$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.046 seconds
Powered by Kunena Forum