My function is working as intended - the fields are dynamically added at the end of the form.
When honeypot is not turned on, the form submits saves to admin and sends the notification successfully.
When honeypot is turned on the frontend shows the success message as if it was submitted, but it never saves the entry or sends the notification. Upon checking the debug log, this is the output:
2023-01-24 8:40:21.672811 - DEBUG --> GF_Form_CRUD_Handler::cleanup(): Form meta => Array
(
[title] => Job Application Form
[description] =>
[labelPlacement] => top_label
[descriptionPlacement] => below
[button] => Array
(
[type] => text
[text] => Submit
[imageUrl] =>
[width] => auto
[location] => bottom
[layoutGridColumnSpan] => 12
)
[fields] => Array
(
[0] => GF_Field_Text Object
(
[type] => text
[_is_entry_detail:GF_Field:private] =>
[_context_properties:GF_Field:private] => Array
(
)
[_merge_tag_modifiers:GF_Field:private] => Array
(
)
[_supports_state_validation:protected] =>
[id] => 1
[formId] => 5
[label] => First Name
[adminLabel] =>
[isRequired] => 1
[size] => large
[errorMessage] =>
[visibility] => visible
[inputs] =>
[description] =>
[allowsPrepopulate] =>
[inputMask] =>
[inputMaskValue] =>
[inputMaskIsCustom] =>
[maxLength] =>
[inputType] =>
[labelPlacement] => hidden_label
[descriptionPlacement] =>
[subLabelPlacement] =>
[placeholder] => First Name*
[cssClass] =>
[inputName] =>
[noDuplicates] =>
[defaultValue] =>
[enableAutocomplete] =>
[autocompleteAttribute] =>
[choices] =>
[conditionalLogic] =>
[productField] =>
[layoutGridColumnSpan] => 6
[enablePasswordInput] =>
[enableEnhancedUI] => 0
[layoutGroupId] => ad4635a9
[multipleFiles] =>
[maxFiles] =>
[calculationFormula] =>
[calculationRounding] =>
[enableCalculation] =>
[disableQuantity] =>
[displayAllCategories] =>
[useRichTextEditor] =>
[errors] => Array
(
)
[checkboxLabel] =>
[pageNumber] => 1
[fields] =>
[displayOnly] =>
)
[1] => GF_Field_Text Object
(
[type] => text
[_is_entry_detail:GF_Field:private] =>
[_context_properties:GF_Field:private] => Array
(
)
[_merge_tag_modifiers:GF_Field:private] => Array
(
)
[_supports_state_validation:protected] =>
[id] => 3
[formId] => 5
[label] => Last Name
[adminLabel] =>
[isRequired] => 1
[size] => large
[errorMessage] =>
[visibility] => visible
[inputs] =>
[description] =>
[allowsPrepopulate] =>
[inputMask] =>
[inputMaskValue] =>
[inputMaskIsCustom] =>
[maxLength] =>
[inputType] =>
[labelPlacement] => hidden_label
[descriptionPlacement] =>
[subLabelPlacement] =>
[placeholder] => Last Name*
[cssClass] =>
[inputName] =>
[noDuplicates] =>
[defaultValue] =>
[enableAutocomplete] =>
[autocompleteAttribute] =>
[choices] =>
[conditionalLogic] =>
[productField] =>
[layoutGridColumnSpan] => 6
[enablePasswordInput] =>
[enableEnhancedUI] => 0
[layoutGroupId] => ad4635a9
[multipleFiles] =>
[maxFiles] =>
[calculationFormula] =>
[calculationRounding] =>
[enableCalculation] =>
[disableQuantity] =>
[displayAllCategories] =>
[useRichTextEditor] =>
[errors] => Array
(
)
[checkboxLabel] =>
[pageNumber] => 1
[fields] =>
[displayOnly] =>
)
[2] => GF_Field_Address Object
(
[type] => address
[_is_entry_detail:GF_Field:private] =>
[_context_properties:GF_Field:private] => Array
(
)
[_merge_tag_modifiers:GF_Field:private] => Array
(
)
[_supports_state_validation:protected] =>
[id] => 4
[formId] => 5
[label] => Address
[adminLabel] =>
[isRequired] => 1
[size] => large
[errorMessage] =>
[visibility] => visible
[addressType] => us
[inputs] => Array
(
[0] => Array
(
[id] => 4.1
[label] => Street Address
[name] =>
[autocompleteAttribute] => address-line1
[customLabel] => Street Address*
[placeholder] => Street Address*
)
[1] => Array
(
[id] => 4.2
[label] => Address Line 2
[name] =>
[autocompleteAttribute] => address-line2
[isHidden] => 1
)
[2] => Array
(
[id] => 4.3
[label] => City
[name] =>
[autocompleteAttribute] => address-level2
[customLabel] => City*
[placeholder] => City*
)
[3] => Array
(
[id] => 4.4
[label] => State / Province
[name] =>
[autocompleteAttribute] => address-level1
[customLabel] => State*
[placeholder] => State*
)
[4] => Array
(
[id] => 4.5
[label] => ZIP / Postal Code
[name] =>
[autocompleteAttribute] => postal-code
[customLabel] => Zip Code*
[placeholder] => Zip Code*
)
[5] => Array
(
[id] => 4.6
[label] => Country
[name] =>
[autocompleteAttribute] => country-name
[isHidden] => 1
)
)
[description] =>
[allowsPrepopulate] =>
[inputMask] =>
[inputMaskValue] =>
[inputMaskIsCustom] =>
[maxLength] =>
[inputType] =>
[labelPlacement] => hidden_label
[descriptionPlacement] =>
[subLabelPlacement] => hidden_label
[placeholder] =>
[cssClass] =>
[inputName] =>
[noDuplicates] =>
[defaultValue] =>
[enableAutocomplete] =>
[autocompleteAttribute] =>
[choices] =>
[conditionalLogic] =>
[defaultCountry] => United States
[defaultProvince] =>
[copyValuesOptionLabel] =>
[productField] =>
[layoutGridColumnSpan] =>
[defaultState] =>
[enableCopyValuesOption] =>
[copyValuesOptionDefault] =>
[copyValuesOptionField] =>
[enableEnhancedUI] => 0
[layoutGroupId] => 6e698c8d
[multipleFiles] =>
[maxFiles] =>
[calculationFormula] =>
[calculationRounding] =>
[enableCalculation] =>
[disableQuantity] =>
[displayAllCategories] =>
[useRichTextEditor] =>
[checkboxLabel] =>
[pageNumber] => 1
[fields] =>
[displayOnly] =>
)
[3] => GF_Field_Phone Object
(
[type] => phone
[_is_entry_detail:GF_Field:private] =>
[_context_properties:GF_Field:private] => Array
(
)
[_merge_tag_modifiers:GF_Field:private] => Array
(
)
[_supports_state_validation:protected] =>
[id] => 5
[formId] => 5
[label] => Phone
[adminLabel] =>
[isRequired] => 1
[size] => large
[errorMessage] =>
[visibility] => visible
[inputs] =>
[phoneFormat] => standard
[autocompleteAttribute] => tel
[description] =>
[allowsPrepopulate] =>
[inputMask] =>
[inputMaskValue] =>
[inputMaskIsCustom] =>
[maxLength] =>
[inputType] =>
[labelPlacement] => hidden_label
[descriptionPlacement] =>
[subLabelPlacement] =>
[placeholder] => Phone*
[cssClass] =>
[inputName] =>
[noDuplicates] =>
[defaultValue] =>
[enableAutocomplete] =>
[choices] =>
[conditionalLogic] =>
[productField] =>
[layoutGridColumnSpan] =>
[enableEnhancedUI] => 0
[layoutGroupId] => 09f121e4
[multipleFiles] =>
[maxFiles] =>
[calculationFormula] =>
[calculationRounding] =>
[enableCalculation] =>
[disableQuantity] =>
[displayAllCategories] =>
[useRichTextEditor] =>
[checkboxLabel] =>
[pageNumber] => 1
[fields] =>
[displayOnly] =>
)
[4] => GF_Field_Email Object
(
[type] => email
[_is_entry_detail:GF_Field:private] =>
[_context_properties:GF_Field:private] => Array
(
)
[_merge_tag_modifiers:GF_Field:private] => Array
(
)
[_supports_state_validation:protected] =>
[id] => 6
[formId] => 5
[label] => Email
[adminLabel] =>
[isRequired] => 1
[size] => large
[errorMessage] =>
[visibility] => visible
[inputs] =>
[autocompleteAttribute] => email
[description] =>
[allowsPrepopulate] =>
[inputMask] =>
[inputMaskValue] =>
[inputMaskIsCustom] =>
[maxLength] =>
[inputType] =>
[labelPlacement] => hidden_label
[descriptionPlacement] =>
[subLabelPlacement] =>
[placeholder] => Email*
[cssClass] =>
[inputName] =>
[noDuplicates] =>
[defaultValue] =>
[enableAutocomplete] =>
[choices] =>
[conditionalLogic] =>
[productField] =>
[layoutGridColumnSpan] =>
[emailConfirmEnabled] =>
[enableEnhancedUI] => 0
[layoutGroupId] => 838b9b0f
[multipleFiles] =>
[maxFiles] =>
[calculationFormula] =>
[calculationRounding] =>
[enableCalculation] =>
[disableQuantity] =>
[displayAllCategories] =>
[useRichTextEditor] =>
[checkboxLabel] =>
[pageNumber] => 1
[fields] =>
[displayOnly] =>
)
[5] => GF_Field_FileUpload Object
(
[type] => fileupload
[_is_entry_detail:GF_Field:private] =>
[_context_properties:GF_Field:private] => Array
(
)
[_merge_tag_modifiers:GF_Field:private] => Array
(
)
[_supports_state_validation:protected] =>
[id] => 7
[formId] => 5
[label] => Attach Resume
[adminLabel] =>
[isRequired] => 1
[size] => large
[errorMessage] =>
[visibility] => visible
[inputs] =>
[description] =>
[allowsPrepopulate] =>
[inputMask] =>
[inputMaskValue] =>
[inputMaskIsCustom] =>
[maxLength] =>
[inputType] =>
[labelPlacement] =>
[descriptionPlacement] =>
[subLabelPlacement] =>
[placeholder] =>
[cssClass] =>
[inputName] =>
[noDuplicates] =>
[defaultValue] =>
[enableAutocomplete] =>
[autocompleteAttribute] =>
[choices] =>
[conditionalLogic] =>
[maxFileSize] =>
[maxFiles] =>
[multipleFiles] =>
[allowedExtensions] =>
[productField] =>
[layoutGridColumnSpan] =>
[enableEnhancedUI] => 0
[layoutGroupId] => c60173e9
[calculationFormula] =>
[calculationRounding] =>
[enableCalculation] =>
[disableQuantity] =>
[displayAllCategories] =>
[useRichTextEditor] =>
[errors] => Array
(
)
[pageNumber] => 1
[fields] =>
[displayOnly] =>
)
[6] => GF_Field_Section Object
(
[type] => section
[_is_entry_detail:GF_Field:private] =>
[_context_properties:GF_Field:private] => Array
(
)
[_merge_tag_modifiers:GF_Field:private] => Array
(
)
[_supports_state_validation:protected] =>
[id] => 8
[formId] => 5
[label] =>
[adminLabel] =>
[isRequired] =>
[size] => large
[errorMessage] =>
[visibility] => visible
[inputs] =>
[displayOnly] => 1
[description] =>
[allowsPrepopulate] =>
[inputMask] =>
[inputMaskValue] =>
[inputMaskIsCustom] =>
[maxLength] =>
[inputType] =>
[labelPlacement] =>
[descriptionPlacement] =>
[subLabelPlacement] =>
[placeholder] =>
[cssClass] =>
[inputName] =>
[noDuplicates] =>
[defaultValue] =>
[enableAutocomplete] =>
[autocompleteAttribute] =>
[choices] =>
[conditionalLogic] =>
[productField] =>
[enableEnhancedUI] => 0
[layoutGroupId] => a570ee61
[multipleFiles] =>
[maxFiles] =>
[calculationFormula] =>
[calculationRounding] =>
[enableCalculation] =>
[disableQuantity] =>
[displayAllCategories] =>
[useRichTextEditor] =>
[pageNumber] => 1
[fields] =>
)
)
[version] => 2.6.9
[id] => 5
[markupVersion] => 2
[nextFieldId] => 9
[useCurrentUserAsAuthor] => 1
[postContentTemplateEnabled] =>
[postTitleTemplateEnabled] =>
[postTitleTemplate] =>
[postContentTemplate] =>
[lastPageButton] =>
[pagination] =>
[firstPageCssClass] =>
[subLabelPlacement] => below
[requiredIndicator] => asterisk
[customRequiredIndicator] => (Required)
[cssClass] =>
[saveButtonText] => Save and Continue Later
[limitEntries] =>
[limitEntriesCount] =>
[limitEntriesPeriod] =>
[limitEntriesMessage] =>
[scheduleForm] =>
[scheduleStart] =>
[scheduleEnd] =>
[schedulePendingMessage] =>
[scheduleMessage] =>
[requireLogin] =>
[requireLoginMessage] =>
[enableHoneypot] => 1
[enableAnimation] => 1
[validationSummary] =>
[deprecated] =>
[saveEnabled] =>
[save] => Array
(
[enabled] =>
[button] => Array
(
[type] => link
[text] => Save and Continue Later
)
)
[scheduleStartHour] =>
[scheduleStartMinute] =>
[scheduleStartAmpm] =>
[scheduleEndHour] =>
[scheduleEndMinute] =>
[scheduleEndAmpm] =>
[notifications] => Array
(
[63cf083e9b610] => Array
(
[id] => 63cf083e9b610
[isActive] => 1
[to] => Trishaj#ruckusmarketing.com
[name] => Admin Notification
[event] => form_submission
[toType] => email
[subject] => New submission from {form_title}
[message] => {all_fields}
[service] => wordpress
[toEmail] => Trishaj#ruckusmarketing.com
[toField] =>
[routing] =>
[fromName] => {First Name:1}
[from] => {admin_email}
[replyTo] => {Email:6}
[bcc] =>
[disableAutoformat] =>
[enableAttachments] => 1
[notification_conditional_logic_object] =>
[notification_conditional_logic] => 0
[conditionalLogic] =>
[cc] =>
)
)
[confirmations] => Array
(
[63cf083e9c269] => Array
(
[id] => 63cf083e9c269
[name] => Default Confirmation
[isDefault] => 1
[type] => message
[message] => Thanks for contacting us! We will get in touch with you shortly.
[url] =>
[pageId] =>
[queryString] =>
)
)
)
2023-01-24 8:40:21.673713 - DEBUG --> GFFormsModel::trim_form_meta_values(): Starting.
2023-01-24 8:40:21.673815 - DEBUG --> GFFormsModel::trim_conditional_logic_values(): Starting.
2023-01-24 8:41:31.517559 - DEBUG --> GFFormDisplay::process_form(): Starting to process form (#5) submission.
2023-01-24 8:41:31.519542 - DEBUG --> GFFormDisplay::process_form(): Source page number: 1. Target page number: 0.
2023-01-24 8:41:31.754956 - DEBUG --> GFFormsModel::get_temp_filename(): Uploaded filename is homeadvisor-color.svg and temporary filename is 63cfe00bb849d_input_7.svg
2023-01-24 8:41:31.755081 - DEBUG --> GF_Field_FileUpload::validate(): Validating field input_7
2023-01-24 8:41:31.769860 - DEBUG --> GF_Field_FileUpload::validate(): Validating file upload for homeadvisor-color.svg
2023-01-24 8:41:31.769980 - DEBUG --> GF_Field_FileUpload::validate(): Validation complete.
2023-01-24 8:41:31.770303 - DEBUG --> GFFormDisplay::process_form(): After validation. Is submission valid? Yes.
2023-01-24 8:41:31.770384 - DEBUG --> GFFormDisplay::process_form(): Uploading files...
2023-01-24 8:41:31.770445 - DEBUG --> GFFormDisplay::upload_files(): Upload path /nas/content/live/powerhrg2/wp-content/uploads/gravity_forms/5-51403278f6166fe42c507d417f729fc5
2023-01-24 8:41:31.787142 - DEBUG --> GFFormsModel::get_temp_filename(): Uploaded filename is homeadvisor-color.svg and temporary filename is 63cfe00bb849d_input_7.svg
2023-01-24 8:41:31.787241 - DEBUG --> GFFormDisplay::upload_files(): Temp file info: Array
(
[uploaded_filename] => homeadvisor-color.svg
[temp_filename] => 63cfe00bb849d_input_7.svg
)
2023-01-24 8:41:31.808958 - DEBUG --> GFFormDisplay::upload_files(): File uploaded successfully: homeadvisor-color.svg
2023-01-24 8:41:31.809124 - DEBUG --> GFFormDisplay::process_form(): Failed Honeypot validation. Displaying confirmation and aborting.
2023-01-24 8:41:31.809190 - DEBUG --> GFFormDisplay::handle_confirmation(): Preparing confirmation (#63cfe00bc58b8 - Default Confirmation).
2023-01-24 8:41:31.809382 - DEBUG --> GFFormDisplay::handle_confirmation(): Sending confirmation => <div id='gf_5' class='gform_anchor' tabindex='-1'></div><div id='gform_confirmation_wrapper_5' class='gform_confirmation_wrapper '><div id='gform_confirmation_message_5' class='gform_confirmation_message_5 gform_confirmation_message'>Thanks for contacting us! We will get in touch with you shortly.</div></div>
Here's my function, and the filter's I'm hooking to:
//dynamically create new radio fields from get_job() array
add_filter( 'gform_pre_render_5', 'add_screening_fields' );
add_filter( 'gform_pre_validation_5', 'add_screening_fields' );
add_filter( 'gform_admin_pre_render_5', 'add_screening_fields' );
add_filter( 'gform_pre_submission_filter_5', 'add_screening_fields' );
function add_screening_fields($form) {
// get new field ids
$new_field_id = 0;
foreach( $form['fields'] as $field ) {
if( $field->id > $new_field_id ) {
$new_field_id = $field->id;
}
}
$new_field_id++;
// foreach 'question' inside get_job() array
$job = get_job();
foreach ($job['screening_questions'] as $question=>$q) {
$answers = ['yes','no'];
$items = array();
foreach ( $answers as $answer ) {
$items[] = array( 'value' => $answer, 'text' => $answer );
}
// Prepare GF field properties
$props = array(
'id' => $new_field_id,
'cssClass' => 'gf_list_inline',
'type' => 'radio',
'label' => $q['question'],
'choices' => $items,
);
// Create new gravity forms field and add it to the form object
$nf = GF_Fields::create( $props );
// insert new fields into array at specific position (end of form)
array_splice( $form['fields'], 7, 0, array($nf) );
$new_field_id++;
}
return $form;
}
Am I not hooking to the right filters, or am I missing a validation step? Any help is greatly appreciated.
Related
I am working on a project where I am creating a plugin that works on top of ACF 5. I have made it pretty far but right now I am stuck on this issue:
I have a flexible content field setup that has multiple sub layouts. I need to add conditional logic to each of these layouts based on there names. Right now I am doing it by getting their field ID:
$field_id = $field['ID'];
$field being my main array.
Then doing a simple php switch statement just setting a variable I can then check for when doing conditional logic:
$layout = '';
switch ($field_id) {
case "19":
$layout = "html";
break;
case "28":
$layout = "grid";
break;
}
Then I just check to see what $layout is set to and go from there. While this does work I do not like the fact that I have to update the IDs every time I move development environments or re-create a layout.
Does anyone know how a better way to do this?
Array dump for single $field:
Array
(
[padding_top] => 0
[padding_right] => 0
[padding_bottom] => 0
[padding_left] => 0
[background_style] => default
[section_width] => default
[ID] => 28
[key] => field_5876368ea05b4
[label] => Section Styles
[name] => acf[field_5873e9fdacab1][0][field_5876368ea05b4]
[prefix] => acf[field_5873e9fdacab1][0]
[type] => section_styles
[value] => Array
(
[section_width] => default
[margin_top] =>
[margin_right] =>
[margin_bottom] =>
[margin_left] =>
[padding_top] =>
[padding_right] =>
[padding_bottom] =>
[padding_left] =>
[background_color] =>
[background_image] =>
[background_style] => default
[background_position_1] => top
[background_position_2] => left
)
[menu_order] => 0
[instructions] =>
[required] => 0
[id] => acf-field_5873e9fdacab1-0-field_5876368ea05b4
[class] =>
[conditional_logic] => 0
[parent] => 14
[wrapper] => Array
(
[width] =>
[class] =>
[id] =>
)
[_name] => section_styles
[_prepare] => 1
[_valid] => 1
[parent_layout] => 58763683a05b3
[margin_top] =>
[margin_right] =>
[margin_bottom] =>
[margin_left] =>
[background_color] =>
[background_position_1] => top
[background_position_2] => left
)
Array dump for main builder object:
Array
(
[layouts] => Array
(
[0] => Array
(
[key] => 5873ea05b5bf2
[name] => html_section
[label] => HTML Section
[display] => block
[sub_fields] => Array
(
[0] => Array
(
[placement] => top
[endpoint] => 0
[ID] => 15
[key] => field_5873f2366de0c
[label] => Content
[name] =>
[prefix] => acf
[type] => tab
[value] =>
[menu_order] => 0
[instructions] =>
[required] => 0
[id] =>
[class] =>
[conditional_logic] => 0
[parent] => 14
[wrapper] => Array
(
[width] =>
[class] =>
[id] =>
)
[_name] =>
[_prepare] => 0
[_valid] => 1
[parent_layout] => 5873ea05b5bf2
)
[1] => Array
(
[tabs] => all
[toolbar] => full
[media_upload] => 1
[default_value] =>
[delay] => 0
[ID] => 16
[key] => field_5873f2456de0d
[label] => Content
[name] => content
[prefix] => acf
[type] => wysiwyg
[value] =>
[menu_order] => 1
[instructions] =>
[required] => 0
[id] =>
[class] =>
[conditional_logic] => 0
[parent] => 14
[wrapper] => Array
(
[width] =>
[class] =>
[id] =>
)
[_name] => content
[_prepare] => 0
[_valid] => 1
[parent_layout] => 5873ea05b5bf2
)
[2] => Array
(
[multiple] => 0
[allow_null] => 1
[choices] => Array
(
[narrow-width] => Narrow
[default-width] => Default
[full-width] => Full Width
)
[default_value] => Array
(
[0] => default-width
)
[ui] => 0
[ajax] => 0
[placeholder] =>
[return_format] => value
[ID] => 17
[key] => field_5873f2616de0e
[label] => Width
[name] => width
[prefix] => acf
[type] => select
[value] =>
[menu_order] => 2
[instructions] =>
[required] => 0
[id] =>
[class] =>
[conditional_logic] => 0
[parent] => 14
[wrapper] => Array
(
[width] =>
[class] =>
[id] =>
)
[_name] => width
[_prepare] => 0
[_valid] => 1
[parent_layout] => 5873ea05b5bf2
)
[3] => Array
(
[placement] => top
[endpoint] => 0
[ID] => 18
[key] => field_5873f28e6de0f
[label] => Apperance
[name] =>
[prefix] => acf
[type] => tab
[value] =>
[menu_order] => 3
[instructions] =>
[required] => 0
[id] =>
[class] =>
[conditional_logic] => 0
[parent] => 14
[wrapper] => Array
(
[width] =>
[class] =>
[id] =>
)
[_name] =>
[_prepare] => 0
[_valid] => 1
[parent_layout] => 5873ea05b5bf2
)
[4] => Array
(
[padding_top] => 0
[padding_right] => 0
[padding_bottom] => 0
[padding_left] => 0
[background_style] => default
[section_width] => default
[ID] => 19
[key] => field_5873f2976de10
[label] => Section Styles
[name] => section_styles
[prefix] => acf
[type] => section_styles
[value] =>
[menu_order] => 4
[instructions] =>
[required] => 0
[id] =>
[class] =>
[conditional_logic] => 0
[parent] => 14
[wrapper] => Array
(
[width] => 100
[class] =>
[id] =>
)
[_name] => section_styles
[_prepare] => 0
[_valid] => 1
[margin_top] => 0
[margin_right] => 0
[margin_bottom] => 0
[margin_left] => 0
[border_top] => 0
[border_right] => 0
[border_bottom] => 0
[border_left] => 0
[border_style] => solid
[border_color] =>
[background_color] =>
[background_position_1] => top
[background_position_2] => left
[parent_layout] => 5873ea05b5bf2
)
)
[min] =>
[max] =>
)
[1] => Array
(
[key] => 58763683a05b3
[name] => grid_section
[label] => Grid Section
[display] => block
[sub_fields] => Array
(
[0] => Array
(
[padding_top] => 0
[padding_right] => 0
[padding_bottom] => 0
[padding_left] => 0
[background_style] => default
[section_width] => default
[ID] => 28
[key] => field_5876368ea05b4
[label] => Section Styles
[name] => section_styles
[prefix] => acf
[type] => section_styles
[value] =>
[menu_order] => 0
[instructions] =>
[required] => 0
[id] =>
[class] =>
[conditional_logic] => 0
[parent] => 14
[wrapper] => Array
(
[width] =>
[class] =>
[id] =>
)
[_name] => section_styles
[_prepare] => 0
[_valid] => 1
[parent_layout] => 58763683a05b3
[margin_top] =>
[margin_right] =>
[margin_bottom] =>
[margin_left] =>
[background_color] =>
[background_position_1] => top
[background_position_2] => left
)
)
[min] =>
[max] =>
)
)
[min] =>
[max] =>
[button_label] => Add Row
[ID] => 14
[key] => field_5873e9fdacab1
[label] => Main Builder
[name] => main_builder
[prefix] => acf
[type] => flexible_content
[value] => Array
(
[0] => Array
(
[acf_fc_layout] => grid_section
[section_styles] => Array
(
[section_width] => default
[margin_top] =>
[margin_right] =>
[margin_bottom] =>
[margin_left] =>
[padding_top] =>
[padding_right] =>
[padding_bottom] =>
[padding_left] =>
[background_color] =>
[background_image] =>
[background_style] => default
[background_position_1] => top
[background_position_2] => left
[background_position] => top left
[padding] => 0 0 0 0
)
)
[1] => Array
(
[acf_fc_layout] => html_section
[content] =>
[width] => default-width
[section_styles] => Array
(
[section_width] => default
[margin_top] => uk-margin-large-top
[margin_right] => uk-margin-small-right
[margin_bottom] => uk-margin-medium-bottom
[margin_left] =>
[padding_top] =>
[padding_right] =>
[padding_bottom] =>
[padding_left] =>
[background_color] =>
[background_image] =>
[background_style] => default
[background_position_1] => top
[background_position_2] => left
[background_position] => top left
[padding] => 0 0 0 0
)
)
)
[menu_order] => 0
[instructions] =>
[required] => 0
[id] =>
[class] =>
[conditional_logic] => 0
[parent] => 13
[wrapper] => Array
(
[width] =>
[class] =>
[id] =>
)
[_name] => main_builder
[_prepare] => 0
[_valid] => 1
)
I am using SOAP API for DocuSign. It is demo account.
So, I have created my code based on sendatemplate.php and I use the templatereference class to create my FieldData and this is the result in array
Array ( [0] => TemplateReference Object ( [TemplateLocation] => Server
[Template] => 2ade4fe1-9b7b-49eb-af2e-xxxxxxxxx [Document] =>
[RoleAssignments] => Array ( [0] => TemplateReferenceRoleAssignment Object (
[RoleName] => Signer1 [RecipientID] => 1 ) ) [FieldData] =>
TemplateReferenceFieldData Object ( [DataValues] => Array ( [0] =>
TemplateReferenceFieldDataDataValue Object ( [TabLabel] => Company [Value]
=> Otto ) ) ) [AdditionalTabs] => [Sequence] => [TemplateAttachments] => ) )
I then use the RequestStatusResponse and this is my result:
RequestStatusResponse Object
(
[RequestStatusResult] => EnvelopeStatus Object
(
[RecipientStatuses] => stdClass Object
(
[RecipientStatus] => Array
(
[0] => RecipientStatus Object
(
[Type] => Signer
[Email] => xxxxxx#yahoo.com
[UserName] => xxxxx
[RoutingOrder] => 1
[Sent] => 2015-12-02T22:56:01.317
[Delivered] => 2015-12-02T22:56:13.567
[Signed] =>
[Declined] =>
[DeclineReason] =>
[Status] => Delivered
[RecipientIPAddress] => xxxxxxxx
[ClientUserId] => 1
[AutoNavigation] =>
[IDCheckInformation] =>
[RecipientAuthenticationStatus] =>
[CustomFields] => stdClass Object
(
)
[TabStatuses] => stdClass Object
(
[TabStatus] => Array
(
[0] => TabStatus Object
(
[TabType] => SignHere
[Status] => Active
[XPosition] => 1333
[YPosition] => 964
[Signed] =>
[TabLabel] => Signature 1
[TabName] => Signature
[TabValue] =>
[DocumentID] =>
[PageNumber] =>
[OriginalValue] =>
[ValidationPattern] =>
[RoleName] =>
[ListValues] =>
[ListSelectedValue] =>
[ScaleValue] =>
[CustomTabType] =>
)
[1] => TabStatus Object
(
[TabType] => Custom
[Status] => Active
[XPosition] => 989
[YPosition] => 916
[Signed] =>
[TabLabel] => Address
[TabName] => Address
[TabValue] =>
[DocumentID] =>
[PageNumber] =>
[OriginalValue] =>
[ValidationPattern] =>
[RoleName] =>
[ListValues] =>
[ListSelectedValue] =>
[ScaleValue] =>
[CustomTabType] =>
)
[2] => TabStatus Object
(
[TabType] => FullName
[Status] => Active
[XPosition] => 989
[YPosition] => 872
[Signed] =>
[TabLabel] => Name 1
[TabName] => Name
[TabValue] =>
[DocumentID] =>
[PageNumber] =>
[OriginalValue] =>
[ValidationPattern] =>
[RoleName] =>
[ListValues] =>
[ListSelectedValue] =>
[ScaleValue] =>
[CustomTabType] =>
)
[3] => TabStatus Object
(
[TabType] => Company
[Status] => Active
[XPosition] => 683
[YPosition] => 252
[Signed] =>
[TabLabel] => Company
[TabName] => Company
[TabValue] =>
[DocumentID] =>
[PageNumber] =>
[OriginalValue] =>
[ValidationPattern] =>
[RoleName] =>
[ListValues] =>
[ListSelectedValue] =>
[ScaleValue] =>
[CustomTabType] =>
)
)
)
[RecipientAttachment] =>
[AccountStatus] =>
[EsignAgreementInformation] =>
[FormData] =>
[RecipientId] =>
)
)
)
I don't see my Company values are populated.
Please help!!!
I am using PHP code to do this.
I am trying to add an inventory item using the QuickBooks PHP SDK. I specify TrackQtyOnHand, the starting inventory and inventory start date, but these fields appear to be ignored?
Any help would be greatly appreciated!
thanks!
Here is the request:
IPPItem Object
(
[Name] => Product Name
[Description] => ProductDesc
[Active] => 1
[SubItem] =>
[ParentRef] =>
[Level] =>
[FullyQualifiedName] =>
[Taxable] => 1
[SalesTaxIncluded] =>
[PercentBased] =>
[UnitPrice] => 17.54386
[RatePercent] =>
[Type] => Inventory
[PaymentMethodRef] =>
[UOMSetRef] =>
[IncomeAccountRef] => IPPReferenceType Object
(
[name] => Sales of Product Income
[type] => Account
[value] => 80
)
[PurchaseDesc] =>
[PurchaseTaxIncluded] =>
[PurchaseCost] => 4.24000
[ExpenseAccountRef] => IPPReferenceType Object
(
[name] => Cost of sales
[type] => Account
[value] => 81
)
[COGSAccountRef] =>
[AssetAccountRef] => IPPReferenceType Object
(
[name] => Inventory Asset
[type] => Account
[value] => 82
)
[PrefVendorRef] =>
[AvgCost] =>
[TrackQtyOnHand] => 1
[QtyOnHand] => 10
[QtyOnPurchaseOrder] =>
[QtyOnSalesOrder] =>
[ReorderPoint] =>
[ManPartNum] =>
[DepositToAccountRef] =>
[SalesTaxCodeRef] =>
[PurchaseTaxCodeRef] =>
[InvStartDate] => 2015-03-01
[BuildPoint] =>
[PrintGroupedItems] =>
[SpecialItem] =>
[SpecialItemType] =>
[ItemGroupDetail] =>
[ItemAssemblyDetail] =>
[ItemEx] =>
[Id] =>
[SyncToken] =>
[MetaData] =>
[CustomField] =>
[AttachableRef] =>
[domain] =>
[status] =>
[sparse] =>
)
And the response:
IPPItem Object
(
[Name] => Product Name
[Description] => ProductDesc
[Active] => true
[SubItem] =>
[ParentRef] =>
[Level] =>
[FullyQualifiedName] => Product Name
[Taxable] => false
[SalesTaxIncluded] => false
[PercentBased] =>
[UnitPrice] => 17.54386
[RatePercent] =>
[Type] => Service
[PaymentMethodRef] =>
[UOMSetRef] =>
[IncomeAccountRef] => 80
[PurchaseDesc] =>
[PurchaseTaxIncluded] => false
[PurchaseCost] => 4.24
[ExpenseAccountRef] => 81
[COGSAccountRef] =>
[AssetAccountRef] =>
[PrefVendorRef] =>
[AvgCost] =>
[TrackQtyOnHand] => false
[QtyOnHand] =>
[QtyOnPurchaseOrder] =>
[QtyOnSalesOrder] =>
[ReorderPoint] =>
[ManPartNum] =>
[DepositToAccountRef] =>
[SalesTaxCodeRef] =>
[PurchaseTaxCodeRef] =>
[InvStartDate] =>
[BuildPoint] =>
[PrintGroupedItems] =>
[SpecialItem] =>
[SpecialItemType] =>
[ItemGroupDetail] =>
[ItemAssemblyDetail] =>
[ItemEx] =>
[Id] => 15
[SyncToken] => 0
[MetaData] => IPPModificationMetaData Object
(
[CreatedByRef] =>
[CreateTime] => 2015-07-19T07:02:57-07:00
[LastModifiedByRef] =>
[LastUpdatedTime] => 2015-07-19T07:02:57-07:00
[LastChangedInQB] =>
[Synchronized] =>
)
[CustomField] =>
[AttachableRef] =>
[domain] =>
[status] =>
[sparse] =>
)
Did you enable Track Quantity on Hand in your company setting->Sales tab?
Data show in this array format in to page -->
Array (
[people] => Array (
[0] => Array (
[administrator] =>
[address-city] => Bucharest
[pid] =>
[site-owner] =>
[twitter] =>
[phone-number-home] =>
[last-name] => Buzoianu
[email-address] => dmeo#gmail.com
[userUUID] =>
[user-name] => AdrianB
[company-name] => Ambassadors
[id] => 60536
[last-changed-on] => 2014-03-14T06:32:02Z
[phone-number-office] =>
[address-state] => Bucharest
[address-country] => RO
[notes] =>
[first-name] => Adrian
[user-type] => account
[permissions] => Array (
[can-manage-people] =>
[can-add-projects] =>
)
[im-service] =>
[im-handle] =>
[address-line-2] =>
[address-line-1] => AL. Rotunda nr.4, BL. H6, Scara E, Ap. 81, Sector 3
[created-at] => 2013-09-27T22:48:41Z
[phone-number-office-ext] =>
[company-id] => 19181
[address-zip] => 032705
[phone-number-fax] =>
[in-owner-company] =>
[last-login] => 2014-03-14T06:30:07Z
[email-alt-1] =>
[email-alt-2] =>
[companyId] => 19181
[email-alt-3] =>
[title] => Ambassador
)
[1] => Array (
[administrator] =>
[address-city] =>
[pid] =>
[site-owner] =>
[twitter] =>
[phone-number-home] =>
[last-name] => Balazsy
[email-address] => dmeo#gmail.com
[userUUID] =>
[user-name] => AnnaB
[company-name] => Ambassadors
[id] => 40047
[last-changed-on] => 2014-03-12T19:48:18Z
[phone-number-office] =>
[address-state] =>
[address-country] => US
[notes] =>
[phone-number-mobile] =>
[first-name] => Anna
[user-type] => account
[permissions] => Array (
[can-manage-people] =>
[can-add-projects] =>
)
[im-service] =>
[im-handle] =>
[address-line-2] =>
[address-line-1] =>
[created-at] => 2013-03-18T18:27:03Z
[phone-number-office-ext] =>
[company-id] => 19181
[address-zip] =>
[phone-number-fax] =>
[in-owner-company] =>
[last-login] => 2013-11-11T15:55:39Z
[email-alt-1] =>
[email-alt-2] =>
[companyId] => 19181
[email-alt-3] =>
[title] =>
)
[2] => Array (
[administrator] =>
[address-city] =>
[pid] =>
[site-owner] =>
[twitter] => billpoli
[phone-number-home] =>
[last-name] => Polizos
[email-address] => demo#gmail.com
[userUUID] =>
[user-name] => billpolizos
[company-name] => Ambassadors
[id] => 38828
[last-changed-on] => 2014-03-13T15:21:07Z
[phone-number-office] =>
[address-state] =>
[address-country] => CND
[notes] =>
[phone-number-mobile] => 7894563210
[first-name] => Bill
[user-type] => account
[permissions] => Array (
[can-manage-people] =>
[can-add-projects] =>
)
[im-service] =>
[im-handle] =>
[address-line-2] =>
[address-line-1] =>
[created-at] => 2013-02-21T17:46:10Z
[phone-number-office-ext] =>
[company-id] => 19181
[address-zip] =>
[phone-number-fax] =>
[in-owner-company] =>
[last-login] => 2014-03-13T14:59:35Z
[email-alt-1] =>
[email-alt-2] =>
[companyId] => 19181
[email-alt-3] =>
[title] =>
)
[3] => Array (
[administrator] =>
[address-city] => Puerto Montt
[pid] =>
[site-owner] =>
[twitter] =>
[phone-number-home] =>
[last-name] => Díaz Pinto
[email-address] => dmeos#gmail.com
[userUUID] =>
[user-name] => DalmaD
[company-name] => Ambassadors
[id] => 88290
[last-changed-on] => 2014-03-12T19:48:37Z
[phone-number-office] =>
[address-state] => Región de Los Lagos
[address-country] => CL
[notes] =>
[first-name] => Dalma
[user-type] => account
[permissions] => Array (
[can-manage-people] =>
[can-add-projects] =>
)
[im-service] =>
[im-handle] =>
[address-line-2] =>
[address-line-1] =>
[created-at] => 2014-03-06T16:48:03Z
[phone-number-office-ext] =>
[company-id] => 19181
[address-zip] => 5505263
[phone-number-fax] =>
[in-owner-company] =>
[last-login] => 2014-03-07T21:16:43Z
[email-alt-1] =>
[email-alt-2] =>
[companyId] => 19181
[email-alt-3] =>
[title] => Directora de Comunicaciones / Director of Communications Gastronomía Patagonia
)
[4] => Array (
[administrator] =>
[address-city] =>
[pid] =>
[site-owner] =>
[twitter] =>
[phone-number-home] =>
[last-name] => Agostini
[email-address] => dmeo67#gmail.com
[userUUID] =>
[user-name] => DanielaA
[company-name] => Ambassadors
[id] => 89822
[last-changed-on] => 2014-03-14T21:10:03Z
[phone-number-office] =>
[address-state] =>
[address-country] => AUS
[notes] =>
[phone-number-mobile] =>
[first-name] => Daniela
[user-type] => account
[permissions] => Array (
[can-manage-people] =>
[can-add-projects] =>
)
[im-service] =>
[im-handle] =>
[address-line-2] =>
[address-line-1] =>
[created-at] => 2014-03-14T21:10:03Z
[phone-number-office-ext] =>
[company-id] => 19181
[address-zip] =>
[phone-number-fax] =>
[in-owner-company] =>
[last-login] =>
[email-alt-1] =>
[email-alt-2] =>
[companyId] => 19181
[email-alt-3] =>
[title] =>
)
)..
I need to sort this array data through ['address-country'] key
Sort your array according to your array structure..
PHP sorting manual
This is the cart array in the Virtuemart 2.0.22a ..
this is stored in "$cart"
how to print [virtuemart_product_id] => 21 at 4.
$cart=
VirtueMartCart Object
(
[products] => Array
(
[21] => stdClass Object
(
[virtuemart_manufacturer_id] => Array
(
)
[slug] => stylish-shirt
[published] => 1
[virtuemart_product_price] =>
[virtuemart_product_id] => 21
[virtuemart_shoppergroup_id] =>
[product_price] => 450.00000
[override] => 0
[product_override_price] => 0.00000
[product_tax_id] => -1
[product_discount_id] => -1
[product_currency] => 68
[virtuemart_vendor_id] => 1
[product_parent_id] => 0
[product_sku] =>
[product_name] => Stylish Shirt
[product_s_desc] =>
[product_weight] =>
[product_weight_uom] => KG
[product_length] =>
[product_width] =>
[product_height] =>
[product_lwh_uom] => M
[product_in_stock] => 0
[product_ordered] => 0
[product_sales] => 0
[product_unit] => KG
[product_packaging] =>
[min_order_level] =>
[max_order_level] =>
[virtuemart_media_id] => Array
(
[0] => 21
)
[step_order_level] =>
[image] => VmImage Object
(
[media_attributes] => 0
[setRole] =>
[file_name] => 3
[file_extension] => jpg
[virtuemart_media_id] => 21
[_foldersToTest:VmMediaHandler:private] => Array
(
[0] => E:\wamp\www\ecomm\images\stories\virtuemart\product\
[1] => E:\wamp\www\ecomm\images\stories\virtuemart\product\resized\
)
[_actions:VmMediaHandler:private] => Array
(
)
[_mLocation:VmMediaHandler:private] => Array
(
)
[_hidden:VmMediaHandler:private] => Array
(
)
[theme_url] => http://localhost/ecomm/components/com_virtuemart/
[virtuemart_vendor_id] => 1
[file_title] => 3.jpg
[file_description] =>
[file_meta] =>
[file_mimetype] => image/jpeg
[file_type] => product
[file_url] => images/stories/virtuemart/product/3.jpg
[file_url_thumb] => images/stories/virtuemart/product/resized/3_90x90.jpg
[published] => 1
[file_is_downloadable] => 0
[file_is_forSale] => 0
[file_is_product_image] => 0
[shared] => 0
[file_params] =>
[file_lang] =>
[_translatable] =>
[_tablePreFix] =>
[created_on] => 2013-08-12 12:32:19
[created_by] => 572
[modified_on] => 2013-08-12 12:38:50
[modified_by] => 572
[file_url_folder] => images/stories/virtuemart/product/
[file_path_folder] => images\stories\virtuemart\product\
[file_url_folder_thumb] => images/stories/virtuemart/product/resized/
[media_role] => file_is_displayable
[file_name_thumb] => 3_90x90
)
[categories] => Array
(
[0] => 6
)
[virtuemart_category_id] => 6
[category_name] => Shirts
[link] => /ecomm/index.php/component/virtuemart/shirts/stylish-shirt-detail?Itemid=0
[packaging] =>
[quantity] => 1
)
)
[_inCheckOut] =>
[_dataValidated] =>
[_blockConfirm] =>
[_confirmDone] =>
[_redirect] =>
[_redirect_disabled] =>
[_lastError] =>
[vendorId] => 1
[lastVisitedCategoryId] => 0
[virtuemart_shipmentmethod_id] => 0
[virtuemart_paymentmethod_id] => 1
[automaticSelectedShipment] => 1
[automaticSelectedPayment] => 1
[BT] => 0
[ST] => 0
[tosAccepted] =>
[customer_comment] =>
[couponCode] =>
[order_language] =>
[cartData] => Array
(
[VatTax] => Array
(
)
[duty] => 1
[payment] => 0
[paymentName] =>
Finally i got the output.. after lot of struggles
foreach($cart->products as $cur)
{
echo $cur->virtuemart_product_id;
}