Skip Navigation

[Resolved] show the costom fields in page " add product" (dokan)

This support ticket is created 6 years ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 2 replies, has 2 voices.

Last updated by cherifM 6 years ago.

Assisted by: Christian Cox.

Author
Posts
#1154683

Hello,
I use dokan multivendor and I use the form to add products but I can not display costom fields

Best regards
Mohammed

#1154871

Hi, if you want to display the values of custom fields, you can use Types field shortcodes or the Types API:
https://toolset.com/documentation/customizing-sites-using-php/functions/

If you want to place custom input fields in a form created by Dokan, that's something you will have to ask Dokan about. I'm not familiar with that system, so I can't offer good advice for modifying Dokan forms. However, I can show you how to set custom field values for a post using PHP. For example, let's say your Dokan form contains an input field called "color" and you want to set the value of a Toolset custom field with the slug "color". In PHP, you can set a custom field value something like this:

$post_id = 12345; // the ID of the post created by Dokan
$color = 'red'; // the value of the color input field
update_post_meta( $post_id, 'wpcf-color', $color );

Now the Toolset custom field "color" has the value of "red" for the post with ID 12345. Notice that the 'wpcf-' prefix is required with update_post_meta.

#1156038

My issue is resolved now. Thank you!