Multi Vendor Marketplace Plugin | WCFM Marketplace › Forums › WCFM › getting product custom fields data
- This topic has 3 replies, 2 voices, and was last updated 3 years, 11 months ago by Sarmistha Chakraborty.
- AuthorPosts
- April 8, 2020 at 10:52 am #116759hnobleParticipant
Hi,
I am working on inserting custom field information into vendor emails and I would like to know if there is a way to get custom field information from one of my fields. I have the email template ready and only need to know how to get the custom field information given a $product in a code snipet.
- April 8, 2020 at 12:43 pm #116783Sarmistha ChakrabortyKeymaster
Hello,
Can u elaborate a little on your requirement so we can guide you accordingly? You have created custom field for product? or vendor registration/profile? and when you want to trigger the mail to vendor?
Thanks.
- April 9, 2020 at 12:14 am #117004hnobleParticipant
A custom field is already created for products. I have already created a snippet to insert the information into the email invoices. I only need to be able to get the custom field information from the product. Is there a function that can be used to get this information like how we get vendor information in wcfm i.e. $vendor_id = $WCFM->wcfm_vendor_support->wcfm_get_vendor_id_from_product( $product_id );
is there a $WCFM->wcfm_product_information->wcfm_get_custom_fields( $product_id ); - April 9, 2020 at 12:14 pm #117160Sarmistha ChakrabortyKeymaster
Hello,
If you have created custom field(for product) by using Advanced Custom Fields(ACF) wordpress plugin, then using this
get_field( "text_field" )
you can get the value. Please check : https://www.advancedcustomfields.com/resources/get_field/Else if you have created the field(for product) by using custom coding, then using this
get_post_meta( int $post_id, $meta_key, true)
you can get the value. Please check : https://developer.wordpress.org/reference/functions/get_post_meta/Thanks.
- AuthorPosts
- You must be logged in to reply to this topic.