Split form fiels data to 2 different 3rd party field
-
Hi guys,
I’m trying to connect with CRM that requires to get the phone field as: cellphone + cellphoneprefixI tried to use hooks but it’s not working ??
The code I’ve added to functions.php is:function service1_action_callback($response, $results){ try { $cellphoneprefix = ''; $cellphone = ''; $telephonePrefix = ''; $telephone = ''; $tel = preg_replace('/[^0-9]/', '', $_POST['tel0']); if($tel){ if(substr($tel, 0, 2) == '05'){ $cellphoneprefix = substr($tel, 0, 3); $cellphone = substr($tel, 3); }else{ $telephonePrefix = substr($tel, 0, 2); $telephone = substr($tel, 2); } } $results['attach'] = $tel; } catch(Exception $ex){ // indicate failure by adding errors as an array $results['errors'] = array($ex->getMessage()); } }//-- function service1_action_callback add_action('Forms3rdPartyIntegration_service_a0', array(&$this, 'service1_action_callback'), 10, 2);
Print screen of the 3rd-parety settings in my admin: https://i.imgur.com/I5YhkTl.jpg
https://www.ads-software.com/plugins/forms-3rdparty-integration/
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Split form fiels data to 2 different 3rd party field’ is closed to new replies.