Hey @webfocusdesign
Sorry for the late reply. Unfortunately, I could not make it work with ACF Pro which I would like and still looking for a way to implement it with ACF Pro. Tried following this:
https://support.advancedcustomfields.com/forums/topic/acf-wc-vendors-front-dashboard/
did not work for me.
But I did use an alternative method of using WC Vendor Pro custom field, that did work but it is not very dynamic as ACF Pro
https://docs.wcvendors.com/knowledge-base/adding-a-custom-field-for-products/
and they have a few fields you can choose from:
https://docs.wcvendors.com/knowledge-base/form-helper/
It seems the new update has a lot more option when I was trying to implement the field a few months ago.
Hope I was able to help.
Regards,
Thank you very much John,
Will implement on what you have advice and check 🙂
Appreciate your help. 🙏🏽
I have managed to show ACF field on “Add Product” page for WC Vendors.
This is the code I have got from WC Vendor’s support forum.
and just bit of modification in the hook, instead of add_action(‘wcvendors_settings_after_shop_name’, ‘wcv_save_acf_fields’);
hook I used add_action('wcvendors_after_product_form'
to save the form. and to display field original code : add_action(‘wcvendors_settings_after_seller_info’, ‘wcv_add_acf_fields’);
and I have replaced it with add_action('wcv_after_product_details'
to display it on Add product page. The full code is below:
/*
*- Courtesy of Ben Lumley -
* https://www.wcvendors.com/help/topic/howto-add-acf-fields-to-frontend-shop-edit/
*
* https://docs.wcvendors.com/knowledge-base/adding-advanced-custom-fields-acf-support/
*
* This will display + save any custom fields applicable to the vendor_shop in question.
* Second one displays the fields, you can adjust the action it’s attached to in order
* to move the fields (see templates/dashboard/store-settings.php in the pro plugin for
* possible actions). You could also split and display different fields in different
* places – see the docs for acf_form, you can select single/groups of fields.
* http://www.advancedcustomfields.com/resources/acf_form/
* Also possible via acf_form to alter the markup a bit to make it fit your theme.
*
* This code is not supported by WC Vendors, use at your own risk and at your own discretion.
*/
add_action('wcvendors_after_product_form', function () {
acf_form_head();
});
add_action('wcv_after_product_details', function () {
acf_form(
[
'post_id' => 'user_' . get_current_user_id(),
'form' => false,
'return' => false
]
);
});
the field shows now, but the problem is it’s not saving the ACF value. any idea why it is not saving 🙁
Hey Elliot,
I am sorry is this issue still open? can you please explain in details? sorry I am not able to get the draft and publish part to work 🙁
I have managed to create a frontend form template using this tutorial,
https://itsmereal.com/frontend-post-submission-edit-advanced-custom-fields/
currently this works likes this:-
When author click submit, it creates a posts and sets it as a draft status and the admin have to set the post to publish then author can edit the post in the front end. Which is ok for the published posts.
What I want is just a bit more added to this functionality. I want when the author submits the posts, he should be able to edit the posts in draft status and also be able to publish it or make it a draft again.
Can you please explain how can I achieve this? I see that you have mentioned of GET param ?update={$draft_id}
on page template(where author submits the posts) I am not sure how to do this,
For the 2nd part changing the posts status from draft to publish or vice versa I have created a radio button to toggle between ‘draft’ and ‘publish’ but again i am not able to place them in right place to make it work 🙁
Your help would be highly appreciated 🙂
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.