Hello, I have created a new relationship post type with the woocommerce product data.
I have Course post type, which will have many products data which I created using woocommerce plugin. So to achieve this, I create 1 to many relationship between those data. And now I'm able to select the product from the Course post type like on the 1st screenshot.
And my issue is I cannot configure the column to be displayed from the Product (see the 2nd screenshot).
I want to display the not only the name of the product, but also want to display SKU, price and the status of the product (active or disable)
Is there any way to achieve that?
Thanks.
Hi Alexandre,
Thank you for waiting.
I've performed some tests and here are my findings.
When you'll visit your course's edit screen, you'll see a cogwheel sign in the post-relationship section, which will show you popup/modal to select the columns from fields:
( screenshot: hidden link )
At the moment, it is possible to include only columns for these WooCommerce fields:
( screenshot: hidden link )
- WooCommerce Product Price
- Product On Sale Status
- Product In Stock Status
I'm afraid, there is no filter/hook available which can be used to add columns for other fields, but you're welcome to submit the feature requests at:
https://toolset.com/home/contact-us/suggest-a-new-feature-for-toolset/
I hope this helps.
regards,
Waqar
Hello Waqar,
Yeah I see the cogwheel gear, but when I click on it, the pop up didn't show any field.
It says "No fields available for selecting"
https://toolset.com/wp-content/uploads/2019/07/1299185-2nd_Screenshot.png
Is there any configuration you did to show those fields?
Hi Alexandre,
Thanks for writing back.
I apologize for this confusion as I noticed that those fields were showing on my website because they were added using Toolset Types plugin, for "Products" post type.
( ref: https://toolset.com/documentation/user-guides/using-custom-fields/ )
That cogwheel selection only supports Toolset Types fields and not the WooCommerce's native product fields.
A workaround can be to add duplicate fields for SKU, price and the status of the product, etc, using Toolset Types plugin and then show their columns in the post-relationship section.
The admin can either fill these duplicated fields manually in the admin area while creating or editing a Product or you can programmatically update it, as explained in this guide:
https://toolset.com/documentation/customizing-sites-using-php/updating-types-fields-using-php/
I hope this helps and please let me know if you need any further assistance around this.
regards,
Waqar