How to print "Custom Product Tabs for WooCommerce" plugin tabs

WooCommerce
13 March, 2024 13:23:17
John Green
Topics: 2
Messages: 7
Dear sirs.

I am trying to show all the tabs that adds the plugin "Custom Product Tabs for WooCommerce" but the internal format is weird and I do not know how to do it.
This is the way that E2PDF takes the key: [e2pdf-wc-product key="yikes_woo_products_tabs" meta="true"]

And this is what pdf prints:

a:3:{i:0;a:3:{s:5:"title";s:23:"Electric Equipment";s:2:"id";s:22:"electric-equipment";s:7:"content";s:413:"- Radio - Speakers - TV";}i:1;a:3:{s:5:"title";s:21:"Internal Equipment";s:2:"id";s:21:"internal-equipment";s:7:"content";s:325:"- 2 rooms - 1 WC - 1 kitchen ";}i:2;a:3:{s:5:"title";s:21:"External Equipment";s:2:"id";s:21:"external-equipment";s:7:"content";s:429:"- 4 chairs - 1 Garden Table - Roof";}}

I would like to print every tab and its content ("Electric Equipment", "Internal Equipment", "External Equipment") in a table as columns.
For example:

Electric Equipment Internal Equipment External Equipment
- Radio - 2 rooms - 4 chairs
- Speakers - 1 WC - 1 Garden Table
- TV - Kitchen - Roof

I hope you can help me.
Best regards.
13 March, 2024 13:55:44
E2Pdf
Support
Topics: 7
Messages: 3163
Hello,

The data is stored as an array. Such content can be printed by using path attribute. You must be able to output it as follows:

1. Single value output as https://codefile.io/f/n4rtgCkAhU.

Or

2. Iterate over all values with [e2pdf-for] shortcode as https://codefile.io/f/3LYZZNSsNo.


We would really appreciate your feedback at WordPress.org!
14 March, 2024 02:00:36
John Green
Topics: 2
Messages: 7
Dear Sirs.

Thank you very much for the answer. It works as you say.

Now the data is shown in a single line but when you configure the tab and write the text, it shows in different lines.

------
Electric Equipment
- 2 rooms
- 1 WC
- 1 kitchen
-------

Is it possible to format it to show it like this in the pdf?

Thank you very much and best regards.
14 March, 2024 03:31:07
E2Pdf
Support
Topics: 7
Messages: 3163
Hello,

Can you let us know, please:

- Which shortcode do you use right now?
- Which object do you use inside E2Pdf Template to output data: input / textarea / HTML?
We would really appreciate your feedback at WordPress.org!
14 March, 2024 09:56:16
John Green
Topics: 2
Messages: 7
Hello again and thanks for your help.

I am using HTML template with [e2pdf-wc-product key="yikes_woo_products_tabs" meta="true" path="0.title"]: [e2pdf-wc-product key="yikes_woo_products_tabs" meta="true" path="0.content"]

I hope you can help me
Best regards.
14 March, 2024 10:10:39
E2Pdf
Support
Topics: 7
Messages: 3163
Please try one of the following solutions:

[e2pdf-wc-product key="yikes_woo_products_tabs" meta="true" path="0.title"]: [e2pdf-format-output filter="nl2br"][e2pdf-wc-product key="yikes_woo_products_tabs" meta="true" path="0.content"][/e2pdf-format-output]

or

[e2pdf-wc-product key="yikes_woo_products_tabs" meta="true" path="0.title"]: [e2pdf-format-output search="\r\n" replace="<br>"][e2pdf-wc-product key="yikes_woo_products_tabs" meta="true" path="0.content"][/e2pdf-format-output]

or

[e2pdf-wc-product key="yikes_woo_products_tabs" meta="true" path="0.title"]: [e2pdf-format-output search="\n" replace="<br>"][e2pdf-wc-product key="yikes_woo_products_tabs" meta="true" path="0.content"][/e2pdf-format-output]

or

[e2pdf-wc-product key="yikes_woo_products_tabs" meta="true" path="0.title"]: [e2pdf-format-output search="\r" replace="<br>"][e2pdf-wc-product key="yikes_woo_products_tabs" meta="true" path="0.content"][/e2pdf-format-output]

P.S. It's also recommended to "Disable WYSIWYG Editor" on the "HTML" object to prevent HTML validation and correction: https://e2pdf.com/docs/elements/html#value

P.P.S. If none of the shortcodes work, map please [e2pdf-wc-product key="yikes_woo_products_tabs" meta="true" path="0.content"] to the "tetarea" inside E2Pdf Template and let us know if values printed with new lines.
We would really appreciate your feedback at WordPress.org!
15 March, 2024 01:48:03
John Green
Topics: 2
Messages: 7
Dear sirs.
Thank you very much for your answer.

First option worked for me.

This is the code I am using now:

------
<table cellpadding="5">
<thead>
<tr>
<th scope="col">[e2pdf-wc-product key="yikes_woo_products_tabs" meta="true" path="0.title"]:</th>
<th scope="col">[e2pdf-wc-product key="yikes_woo_products_tabs" meta="true" path="1.title"]:</th>
<th scope="col">[e2pdf-wc-product key="yikes_woo_products_tabs" meta="true" path="2.title"]:</th>
</tr>
</thead>
<tbody>
<tr>
<td style="vertical-align: top;">[e2pdf-format-output filter="nl2br"][e2pdf-wc-product key="yikes_woo_products_tabs" meta="true" path="0.content"][/e2pdf-format-output]</td>
<td style="vertical-align: top;">[e2pdf-format-output filter="nl2br"][e2pdf-wc-product key="yikes_woo_products_tabs" meta="true" path="1.content"][/e2pdf-format-output]</td>
<td style="vertical-align: top;">[e2pdf-format-output filter="nl2br"][e2pdf-wc-product key="yikes_woo_products_tabs" meta="true" path="2.content"][/e2pdf-format-output]</td>
</tr>
</tbody>
</table>
------

Thank you very much and best regards.