Hi Luo, i opened this extra ticket to spread the different questions on the same topic.
Concerning your reply #589663 :
I'd need to show that value via PHP on pages such as 'checkout'. I tried with a simple echo do shortcode but that didnt work out.
The shortcodes in question are:
[wpv-post-body view_template="show-the-label-values" id="[wpv-user field="wpcf-billing-addresses-nl"]"]
[wpv-post-body view_template="show-the-label-values" id="[wpv-user field="wpcf-billing-addresses-fr"]"]
and so on.
As you may know, there are about 15 of these (1 per region) and only 1 will show a value. So we should maybe need 'hide' the results from the other 14 shortcodes, to come to a simple clean line with 1 result.
How would that work??
PS i have a custom checkout temlate located in child theme/woocommerce/checkout/.. and line 39 is where i put that simple echo.
And: will this work (show result) on the woocommerce emails if i include the code in the mail templates?
Thanks and kind regards
Dear filip,
Q1) So we should maybe need 'hide' the results from the other 14 shortcodes, to come to a simple clean line with 1 result.
You can put all the shortcode you mentioned above into another content template, for example content template "all-in-one":
[wpv-post-body view_template="show-the-label-values" id="[wpv-user field="wpcf-billing-addresses-nl"]"]
[wpv-post-body view_template="show-the-label-values" id="[wpv-user field="wpcf-billing-addresses-fr"]"]
...
Then display them with only one shortcode of content template "all-in-one", for example:
[wpv-post-body view_template="all-in-one"]
You can display the content template "all-in-one" in your theme file with Views PHP function "render_view_template", for example, the ID of content template "all-in-one" is 123, then you can use below PHP codes:
echo render_view_template('123');
See our document:
https://toolset.com/documentation/programmer-reference/views-api/#render_view_template
render_view_template
Returns the content of a Content Template applied to a post.
Q2) will this work (show result) on the woocommerce emails if i include the code in the mail templates?
That depends on how do you setup the woocommerce emails, you can test it and start a new thread if there is any problem
Dear Luo, thanks! For external reasons I'll be picking this up again only after the weekend.
OK, please update this thread when you need more assistance. thanks