Render label from metabox.io select field

10 June, 2024 00:52:29
eliodata
Topics: 16
Messages: 49
Hi,

I would like to display the label from a metabox.io select field. I have tried this:
[e2pdf-wc-order key="fsbdd_check_exotva" meta="true" show="label"]
But it still give me the value.
the field choices are like this:

NON:FSC
OUI:FS
JE NE SAIS PAS:TODO

Thank you!
10 June, 2024 01:58:44
E2Pdf
Support
Topics: 7
Messages: 3330
Hello,

meta="true" - gets the value exactly as it's saved in the database.

Can you please clarify:

- What is the example output of [e2pdf-wc-order key="fsbdd_check_exotva" meta="true"]
- Do you have any other keys in Visual Mapper with fsbdd_check_exotva?
- Do you see the label value on the WooCommerce Order page?
We would really appreciate your feedback at WordPress.org!
10 June, 2024 03:06:18
eliodata
Topics: 16
Messages: 49
Thank you for the quick answer!
Sorry for my poor english...
i use this select field in the woocommerce order front end page and woocommerce order admin page.
I have tried 4 skortcodes:

[e2pdf-wc-order key="fsbdd_check_exotva" meta="true" show="label"]
[e2pdf-wc-order key="fsbdd_check_exotva"]
[e2pdf-wc-order key="fsbdd_check_exotva" show="value"]
[e2pdf-wc-order key="fsbdd_check_exotva" show="label"]

All render "OUI" instead of "FS".

The visual mapper only find this key:
[e2pdf-wc-order key="fsbdd_check_exotva" meta="true"]

best regards
10 June, 2024 03:10:04
E2Pdf
Support
Topics: 7
Messages: 3330
In this case, unfortunately, it seems metabox.io doesn't save "labels" in the metadata. You can try to use search / replace and replace values to labels:

[e2pdf-format-output search="NON|||OUI|||JE NE SAIS PAS" replace="FSC|||FS|||TODO"][e2pdf-wc-order key="fsbdd_check_exotva" meta="true"][/e2pdf-format-output]
We would really appreciate your feedback at WordPress.org!
10 June, 2024 03:29:12
eliodata
Topics: 16
Messages: 49
The search replace works great.
Thank you!