Rendre content from related post select field

February 13, 2025 04:35:29
eliodata
Topics: 19
Messages: 57
Hi,

This code works well to render the text field content from fsbdd_inter_numero :
[e2pdf-wp id="dynamic" key="fsbdd_inter_numero" meta="true" parent="true"][e2pdf-wc-order key="line_item" subkey="fsbdd_relsessaction_cpt_produit" index="0" order_item_meta="true"][/e2pdf-wp]

But this none doesn't for the select field fsbdd_select_lieuforminter :
[e2pdf-wp id="dynamic" key="fsbdd_select_lieuforminter" meta="true" parent="true"][e2pdf-wc-order key="line_item" subkey="fsbdd_relsessaction_cpt_produit" index="0" order_item_meta="true"][/e2pdf-wp]

Both fields are into the same metabox from the same cpt.

[e2pdf-wc-order key="line_item" subkey="fsbdd_select_lieuforminter" index="0" order_item_meta="true"] works well to render the same field saved into order line items metas.

any idea please ?
February 13, 2025 04:53:30
E2Pdf
Topics: 7
Messages: 3614
Support
Hello,

The shortcode looks correct if the field is in the same group as fsbdd_inter_numero.

Does it output anything when you place the shortcode into the separate "textarea", or is it just an empty output?

We would really appreciate your feedback at WordPress.org!
February 13, 2025 05:07:36
eliodata
Topics: 19
Messages: 57
I have tried into empty input or text fields. Looking at the cpt metadatas I see this:

fsbdd_select_lieusession: Array ( [0] => adress content xxxxx )

I remember this select field is conditionnal logic. it depends on another select : fsbdd_typesession
February 13, 2025 05:22:32
E2Pdf
Topics: 7
Messages: 3614
Support
E2Pdf is not related to conditional logic. If it is visible when you edit the product page and displays the correct value, it should output that value via the [e2pdf-wp] shortcode.

Do you need to output the value set in the Product/Variation page, or do you need to output the value selected by the user upon purchase?

Additionally, could you please clarify—did you get a completely empty output? It seems we couldn't find the answer in your previous message.

We would really appreciate your feedback at WordPress.org!
February 13, 2025 05:28:30
E2Pdf
Topics: 7
Messages: 3614
Support
P.S. If [e2pdf-wc-order key="line_item" subkey="fsbdd_select_lieuforminter" index="0" order_item_meta="true"] outputs the correct value you need, and your E2Pdf Template is connected to WooCommerce → Products/Variations, then we assume you just need to use the shortcode:

[e2pdf-wc-product key="fsbdd_select_lieuforminter" order_item_meta="true"]

We would really appreciate your feedback at WordPress.org!
February 13, 2025 10:32:55
eliodata
Topics: 19
Messages: 57
Thank you for the quick answers!

The field "fsbdd_select_lieuforminter" can originate from two sources:

The custom post type (CPT) related to the product in the order via subkey="fsbdd_relsessaction_cpt_produit".
The meta line items saved during the order.
The field "fsbdd_select_lieuforminter" can be modified directly from its CPT, but this does not affect the line items. Therefore, you need to retrieve it from the CPT. This logic is similar to "fsbdd_inter_numero," which does not pose any issues.

>> did you get a completely empty output?
yes, sorry for my poor english.

I finally managed to force the line items meta to sync with the cpt if updated. So no more problem now, just use [e2pdf-wc-order key="line_item" subkey="fsbdd_select_lieuforminter" index="0" order_item_meta="true"] to render the updated field data.

best regards
Get News and Updates
Our monthly newsletter keeps you in the loop, so you'll always be up to date with the latest news and updates about E2Pdf.
* You can update your email subscription preferences here.
All trademarks, service marks, trade names, product names, and logos appearing on this website are the property of their respective owners. The use of trademarks such as Formidable Forms®, Forminator Forms®, Gravity Forms®, JetFormBuilder®, WordPress®, WooCommerce®, WPForms® and others is solely for identification purposes (nominative use) and does not imply any affiliation, sponsorship, or endorsement by the respective trademark holders.
© 2017 - 2026, https://e2pdf.com

We use cookies to collect and analyse information on site performance and usage, to provide social media features and to enhance and customise content and advertisements. By clicking "Accept Selected", you consent to use of selected cookies according to our Cookie Policy.