Hi again,
sorry if I keep asking for explanations, but I try to understand how to make this fantastic Toolset work best.
I was wondering: how to add only a custom field in a given template without using the Toolset visual editor?
I mean, if it is possible to insert within a single product template a php code or a shortcode as I do, for example, with ACF (get_field ("name_field")).
Or, alternatively, use the Toolset editor to edit the existing theme default template?
This approach would be useful for me because it saves me from modifying the single product template, since the customer does not want it to be modified.
Hello, I am not sure what do you mean by "modifying the single product template". So, I'll try to comment on each of your questions.
I was wondering: how to add only a custom field in a given template without using the Toolset visual editor?
This is totally possible. Check this article and let me know if you have further questions:
- https://toolset.com/documentation/customizing-sites-using-php/functions/
- https://toolset.com/documentation/customizing-sites-using-php/creating-templates-single-custom-posts/
Note that the fields that are created through Toolset use a prefix at the database level 'wpcf-'.
Or, alternatively, use the Toolset editor to edit the existing theme default template?
Toolset does not act or allow to modify theme's templates. Toolset acts only on the return of the the_content() function.
This approach would be useful for me because it saves me from modifying the single product template, since the customer does not want it to be modified.
You can create a Toolset Content Template for your custom post types or for specific posts. But the resulting HTML will only replace the_content() function from the theme's template.
For more information on how to customize Toolset based website using PHP, check the articles on this documentation page. Feel free to open a new ticket or chat for any further questions.
https://toolset.com/documentation/customizing-sites-using-php/
Perfect. So, if I want to display a custom taxonomy for that product, should I use this code?
<! -? php echo (types_render_field ('custom_taxonomy')); ? ->
Or do I have to enter a reference to the product id?
My issue is resolved now. Thank you!