I have created a custom field for woo products. It's a Toolset radio button field.
my field slug is "art-sold-status"
How can I add that field as a column to the Woo Products table?
Screenshot : hidden link
I found a tutorial online but don't know how to adapt the code to work with the toolset custom field.
Online tutorial: hidden link
Can you help, please?
Hello,
I assume the custom field "art-sold-status" is created with Toolset Types plugin, Types plugin will add prefix "wpcf-" before field slug, so in your custom PHP codes, you need to use field slug "wpcf-art-sold-status", for example:
get_post_meta( $product_id, 'wpcf-art-sold-status', true);
More help:
https://toolset.com/documentation/customizing-sites-using-php/functions/
when you are accessing custom fields through native WordPress functions, you need to prepend the wpcf- prefix to the slug. Continuing from the above example, for native WordPress function to access the “House Price” field, you need to use the wpcf-house-price slug.
Thanks for confirming the wpcf- part, Luo.
Would you be able to provide me a snippet to use in my website to add a new column for “art sold status” to the woo products page?