I am trying to: Import custom post type fields from TourCMS plugin (hidden link) to show in woocommerce single product
Where to begin to show the fields in woocommerce single product?
The tourcms plugin provides a way to easily pull product descriptions, images and prices out of TourCMS and into the WordPress environment in a way that WordPress designers and developers should find familiar.
How can I use these fields in the woocommerce single product? Do you need access to my demo site?
Thank you for contacting Toolset Support. I think you want to use Custom Fields that are created with TourCMS plugin. If those custom fields are registered using standard WordPress approach, then these steps can help to use those fields:
1. You can control Custom Fields or Post Fields by using “Post Field Control” option, please see attached screenshot.
-- First you will create a Post Field Group for products and then assign the custom fields to that group >> using the Post Field Control, so that these will display in the WC Products.
To add 3rd party Custom fields in your Content Template, there are 2 things you should check in this case:
- Toolset >> Settings >> Front-end Content >> Click “Select custom fields” button >> And check if you are seeing TourCMS custom fields there? If yes, please enable them (if they are already checked, you can skip this step).
- Then go to your Content Template >> use Filed and Views button >> there you will find a button called “Load non-Types custom fields” >> click on it >> it will show all 3rd party custom fields that you can insert into the template, please see attached screenshot.
Apart from above, you can modify entire Single Product Template by using our Toolset WooCommerce Views >> Content Template editor (you might already know this). Please see short video here that I created to demonstrate that how easily you can add or modify WC product template and add your own data: hidden link
Thanks for this. To be honest I managed to get so far :-). So I am not that dumb :-p.
But how do these fields get filled with data on the front-end? The data is imported thru tourcms plugin.
Maybe I have to change my thoughts. I want to use the data of tourcms in woocommerce product template. But maybe I have to switch the tourcms custom post to a sellable product. So take the content template of the tourcms custom post and add woocommerce to it.
So the problem is not to create a template but to fill it with data already in the database.
I think I see what I need to do. I have to make a post relationship of the tours post in the woocommerce product. But in the "Post Types" there is no mention of the woocommerce post type. How to create a post relationship between ToursCMS post and woocommerce post?
How to create a post relationship between ToursCMS post and woocommerce post?
==> You can setup post relationship by editing TourCMS post type and there you can select “Parent” or “Children” for this post type, please see attached screenshot. It will then be shown inside each Product in the “Post Relationship” section (metabox).
WooCommerce Products is a special post type, due to which Types do not offer to edit it, neither it is recommended to modify WC Products post type as it can break things.
No, you can still create the relationship and add data into WC Product by editing TourCMS post type and set the "Product" post type as "Parent" for it. This is kind of inverse way to link these post types together.
The other comment I made is for the question that why we actually do not show Products post type in Toolset Types (Post Types) screen.
The other ways for displaying custom fields in WC product are also mentioned in this thread already as above.
Yes, for now I am changing ticket status as Pending or Waiting for confirmation, so if you have anything more to add later on for this particular question, you can post here (just because with each client reply ticket status changes back to working). Thank you
When I look I don't see the post type Tours/hotels in the "Post type" only the standard post type media, posts, pages. Do I first need to import the post type into "Post Type?
It is underneath the Porducts in Dashboard. Does this change something?
I think you need to enable that custom post type first so that it is managed by Types.
- Please deactivate TourCMS plugin
- Create same CPT in types with same slug
- And then reactivate the TourCMS plugin (after CPT has been created in Types)
Now you will be able to see CPT of that plugin (Tours/hotels) into Types. And all your posts or data will still be there.