Tell us what you are trying to do? I need to use Elementor Page Templates in combination with Toolset to restrict access to certain content. I would like to show custom fields from a related parent (film) on a child page (product).
Elementor Page Template for the Product needs to show fields from the 'Film' parent including Synopsis, Directors, Year.
A film can have multiple products under it. The page template will be a 'skin' based on each product associated with that film. And then the actual page content is going to be hidden behind the purchase action. So when a customer pays, the rest of the 'product' page is revealed. Therefore I can't built out the parent/child information in blocks on the product page itself as this will be hidden from the user until they pay.
Is there any documentation that you are following? I've been looking at this: https://toolset.com/documentation/customizing-sites-using-php/displaying-parent-posts/ and https://toolset.com/documentation/customizing-sites-using-php/functions/
Is there a similar example that we can see?
What is the link to your site?
Hello and thank you for contacting the Toolset support.
I am not really sure to understand the question here. Is it about displaying the data from the parent posts? Or about hiding it until the user pays for it then displays it?
If it is about displaying the data, you will need to use the item attribute or a separate content template. For example, you can display a parent post's single line field with the following, assuming that the relationship slug is "film-product" :
[types field="my-singlelinetext" item=" item="@film-product.parent"][/types]
Or using a content template:
[wpv-post-body view_template="Name or slug of the template" item="@film-product.parent"]
https://toolset.com/documentation/programmer-reference/views/views-shortcodes/item-attribute/
If you want to use blocks for the content template, you can choose the parent film post in the dynamic source dropdown, and choose which fields to display.
If your question is about hiding the content until the user buys the product, I am afraid, this is not a built-in feature. Toolset integration with WooCommerce consists of two main features:
- Allowing users to pay to submit posts.
- Allowing users to pay to register to the website.
This does not mean, that it can't be implemented. It can, with some custom code. You can create a custom shortcode or a custom function that should check if the current user has bought the current product. This shortcode or function can be registered in Toolset settings and used inside Toolset conditions. Then you can put the content to hide/show inside a condition. Check this article https://toolset.com/course-lesson/using-toolset-conditional-block/
I hope this makes sense. Let me know if you have any questions.