Skip Navigation

[Resolved] export data form to xlsx with WP all import gets me serialized data

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

This topic contains 10 replies, has 2 voices.

Last updated by moomS 1 year, 1 month ago.

Assisted by: Waqar.

Author
Posts
#2560245
Captura de pantalla 2023-02-23 a la(s) 09.31.25.png

Tell us what you are trying to do?
Trying to export through WP ALL IMPORT the data from User form generated in toolset. Would you help me to identify the php functions to get the data from this serialized data (obtained in Toolset Post Form): a:2:{s:64:"wpcf-fields-checkboxes-option-f7f9c7a19a5c90a0cbde74b0a6c57735-1";a:1:{i:0;s:11:"Mitigación";}s:64:"wpcf-fields-checkboxes-option-885b1ff227ab8644a29dbebe1d08ab27-1";a:1:{i:0;s:20:"Obras de terracería";}}

In my export, I want to see only "Mitigación" or "Obras de terracería"

Is there any documentation that you are following?
yes, this hidden link

Is there a similar example that we can see?

What is the link to your site?

#2560773

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi,

Thank you for contacting us and I'd be happy to assist.

To suggest the most efficient way to achieve this, I'll need to see how these checkboxes type custom field is set up in the admin area.

Can you please share a screenshot showing this field's settings in the custom field group?

regards,
Waqar

#2560809
Captura de pantalla 2023-02-24 a la(s) 07.57.14.png
Captura de pantalla 2023-02-24 a la(s) 07.55.02.png

Thank you Waqar.
I upload an image with the admin area. The problem is with the checkboxes only.

You can create an account and register a company here: hidden link

Additionally I uploaded an image with the option of WP ALL IMPORT to export with php function, maybe here we can figure out a solution with a php code.

Thank you!

#2563423

hello?

#2563499

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for waiting, as we had an unusually busy forum queue over the weekend.

I'm currently performing some tests on my website with a similar 'checkboxes' type field. Will share the findings, as soon as this testing completes.

Thank you for your patience.

#2563841

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for waiting.

On my test website, I was able to make this export work using the following custom PHP function:


function my_convert_checkbox_to_txt( $value ) {
	// Return nothing if there is no value.
	if ( empty( $value ) ) {
		return null;
	}

	$target_values =  array('one','two');
	$return_values =  array();
	
	for ($i=0; $i < sizeof($target_values) ; $i++) { 
		if (strpos($value, $target_values[$i]) !== false) {
		    $return_values[] = $target_values[$i];
		}
	}
	
	// Return comma-delimited list of values.
	return implode( ', ', $return_values );
}

In my test, the checkboxes field had two checkbox options with values 'one' and 'two', respectively. But, on your website, you'll update the values in the array '$target_values', as per the values used by your checkboxes type field.
( screenshot: hidden link )

#2563893
Captura de pantalla 2023-03-01 a la(s) 08.07.28.png
Captura de pantalla 2023-03-01 a la(s) 08.06.16.png

Thanks Waqar.

I'm having this error: Parse error: syntax error, unexpected ' ' (T_STRING) in your code on line 8
And the serialized persist. (please see the wpcf-obra-civiles field) in the preview.

#2564033
Captura de pantalla 2023-03-01 a la(s) 10.50.01.png
Captura de pantalla 2023-03-01 a la(s) 10.49.50.png

UPDATE: I copied and pasted it in an editor and it pass... but still not getting the data (please see the wpfc-obras-civiles field.

#2564505

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Can you please share temporary admin login details, so that I can see the export section in the admin area?

Note: Your next reply will be private and making a complete backup copy is recommended before sharing the access details.

#2564735

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for sharing the access details.

I just tested the export using the same function and the 'Obras civiles' field and it worked as expected.

Screenshot settings: hidden link
Screenshot preview: hidden link

You can see the settings used in the last export, in the 'Manage Exports' section.

#2564805

My issue is resolved now. Thank you!

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.