PluginProbe ʕ •ᴥ•ʔ
CommerceBird – AI Command Center, ERP Integrations & B2B for WooCommerce (Zoho, Exact Online). / 2.2.17
CommerceBird – AI Command Center, ERP Integrations & B2B for WooCommerce (Zoho, Exact Online). v2.2.17
3.0.3 3.0.2 3.0.1 trunk 2.2.14 2.2.15 2.2.16 2.2.17 2.2.18 2.2.19 2.3.0 2.3.1 2.3.10 2.3.11 2.3.12 2.3.13 2.3.14 2.3.2 2.3.3 2.3.4 2.3.5 2.3.6 2.3.7 2.3.8 2.3.9 2.4.0 2.4.1 2.4.2 2.4.3 2.4.4 2.4.5 2.4.6 2.5.0 2.5.1 2.5.2 2.6.0 2.6.1 2.6.2 2.6.3 2.6.4 2.6.5 2.7.0 2.7.1 2.7.2 2.7.3 2.7.4 2.7.5 2.7.6 2.7.7 2.7.8 2.7.9 2.7.91 2.7.92 2.7.93 2.8.0 2.8.1 2.8.2 2.8.3 2.8.4 2.8.5 2.9.0 2.9.1 2.9.2 2.9.3 3.0.0
commercebird / includes / classes / zoho-crm / class-zcrm-custom-fields.php
commercebird / includes / classes / zoho-crm Last commit date
class-zcrm-custom-fields.php 1 year ago index.php 1 year ago
class-zcrm-custom-fields.php
46 lines
1 <?php
2
3 namespace CommerceBird;
4
5 if ( ! defined( 'ABSPATH' ) ) {
6 exit;
7 }
8
9 use CMBIRD_API_Handler_Zoho;
10
11 class ZCRM_Custom_Fields {
12
13 /**
14 * create API Get call to Zoho CRM to get all custom fields
15 *
16 * @param module $module - module name
17 * @return array | \WP_Error
18 */
19 public function cmbird_get_custom_fields( $module ) {
20 $zoho_crm_url = get_option( 'cmbird_zoho_crm_url' );
21 $url = $zoho_crm_url . 'crm/v6/settings/fields?module=' . $module;
22 $execute_curl_call_handle = new CMBIRD_API_Handler_Zoho();
23 $json = $execute_curl_call_handle->execute_curl_call_get( $url );
24 if ( is_wp_error( $json ) ) {
25 return $json;
26 } else {
27 // Parse the response
28 $parsed_fields = array();
29
30 foreach ( $json->fields as $field ) {
31 $parsed_fields[] = array(
32 'id' => $field->id,
33 'apiName' => $field->api_name,
34 'visible' => (bool) $field->visible,
35 'fieldLabel' => $field->field_label,
36 'displayLabel' => $field->display_label,
37 'customField' => (bool) $field->custom_field,
38 'dataType' => $field->data_type,
39 );
40 }
41
42 return $parsed_fields;
43 }
44 }
45
46 }