[Resolved] Display the post title

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.

This thread is resolved. Here is a description of the problem and solution.


Display related post information in Woocommerce cart page.


It needs custom codes, see details here:


Relevant Documentation:


This topic contains 8 replies, has 2 voices.

Last updated by domenicoS 6 months, 4 weeks ago.

Assigned support staff: Luo Yang.



I've created a great booking system with toolset.
A last task is to catch the title of a parent post and display it in the cart

I displayed it in the post with this string:

[wpv-post-title item="@preventivo-struttura.parent"] 

Then I click on the button And I go to the cart

In the I cart I displeyed all the post meta of the child post, but I need to display also the title of the parent post.

How can I do?


Luo Yang

Languages: English (English ) Chinese (Simplified) (简体中文 )

Timezone: Asia/Hong_Kong (GMT+08:00)


I assume we are talking about similar problem as your another thread:

1) There isn't such kind of built-in feature, it needs custom codes, see above thread.

2) In my opinion, you can setup a similar Toolset post form, display post title as the submit button text, for example:
[cred_field field="form_submit" output="bootstrap" value="[wpv-post-title]" class="btn btn-primary btn-lg"]


Hi Luo, yes similar but about another meta.

I display all the meta correctly in the cart meta.
Tha only one I'm not able to display is the title of the post.

If you remeber I've a cutom post type "accommodation" with a form

The form create the new pot type "quote"

This to are linked with a relationship

In the cart i'm able to diplay al the meta of "quote post type" but not the meta of "accommodation post type"

I tryed with tihis code

		$accommodation_name =  get_the_title( $post->post_parent);

But is dispalyed the title of "quote" post and not the title of "accommodation" post

If you want I can share with you the link


Luo Yang

Languages: English (English ) Chinese (Simplified) (简体中文 )

Timezone: Asia/Hong_Kong (GMT+08:00)

You can get the "quote" post ID, for example:

$post_id = $cart_item['cred_meta']['cred_post_id'];

With the "quote" post ID, you can get the related "accommodation" post ID with API function toolset_get_related_post():

With the "accommodation" post ID, you can get it's post title:

For your reference.


It is already set in this way:

$post_id = $cart_item['cred_meta']['cred_post_id'];
$accommodation_name =  get_the_title( $post_id->post_parent);

But it give the title of the actual page and not of the accommodation page


Luo Yang

Languages: English (English ) Chinese (Simplified) (简体中文 )

Timezone: Asia/Hong_Kong (GMT+08:00)

As I mentioned above, you will need to use function toolset_get_related_post() to get related "accommodation" post ID.

If you still need more assistance for it, please provide a test site with the same problem, and point out the problem page URL and form URL, where I can edit your PHP codes, I need a live website to test and debug, and I am off now, will check it tomorrow morning. thanks


Ok Luo, you already have the access to the website.
If you need I can share you all as private


Luo Yang

Languages: English (English ) Chinese (Simplified) (简体中文 )

Timezone: Asia/Hong_Kong (GMT+08:00)

I can get the your website credentials in this post:

Since you did not point out the problem page URL and form URL, I assume we are talking about this post type relationship "preventivo-struttura":
hidden link

Here is an example:

$post_id = $cart_item['cred_meta']['cred_post_id'];
$accommodation_id = toolset_get_related_post( $post_id, 'preventivo-struttura',  'parent');
$accommodation_title = get_the_title( $accommodation_id );

"preventivo-struttura" is the post type relationship slug, see our document:

For your reference.


It works perfectly! My issue is resolved now. Thank you for your help, you are the best!