[Resolved] Showing custom field on woocommerce product page
The Toolset Community Forum is closed, for technical support questions, please head on to our Toolset Professional Support (for paid clients), with any pre-sale or admin question please contact us here.
This support ticket is created 7 years, 4 months ago. There's a good chance that you are reading advice that it now obsolete.
This is the community support forum for Types plugin, which is part of Toolset. Toolset is a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients and people who registered for Types community support can post in it.
I'm working on a website where we use Woocommerce. I'm using the free version of Toolset.
With each product it's possible to upload mp3 files as samples. This works. This is the upload-sample-file slug (see screenshot 2). The way the code is built, show that it works on the frontend (cart.php).
I've made a second 'custom type' called 'Video Samples'.
How do I make this second custom type visible in php, showing on cart.php? And how do i say to it that is has to behave as an individual custom type for each product in woocommerce?
1. And how do i say to it that is has to behave as an individual custom type for each product in woocommerce?
==> The “Video Samples” custom post type, if you have created using Toolset Types then it should be visible on the backend as individual custom type.
2. How do I make this second custom type visible in php, showing on cart.php?
==> For this please explain a bit more, I am not getting what you are trying to achieve here. Do you want to show custom fields on cart.php or you want to show Posts on cart.php or something else?
1. I've seen it's visible on the backend with each backend product-edit page. Thanks!
2. Yes i want to show the custom fields on cart.php. The information what i fill in in the custom fields 'Video Samples', is what i want to show. So that will be some video's.
Because the custom type 'mp3' is working, i need to know what to do (for exampe adding extra code) to show the video samples at cart.php . The images i posted with the php code, Is (from what I believe) the code what's needed to show the mp3-files at cart.php . I thought it's something with copying the code and changing the id's and variables, but this didn't work out for me.
There is no builtin option in Types to do that but that will need advance custom coding using Types API you can show fields, there are examples on this page general example as well as example codes for each field type: https://toolset.com/documentation/customizing-sites-using-php/functions/
We cannot consult on custom code as this is out of support policy (https://toolset.com/toolset-support-policy/). If you would like you can contact Toolset recommended consultants to further discuss the custom approach. We have some recommended list of service providers here if you would like to take a look: https://toolset.com/consultant/
This tutorial may come handy: hidden link
Thank you
The forum ‘Types Community Support’ is closed to new topics and replies.