I already wrote earlier. I put a clean version of WordPress on a test site. I installed the Storefront theme. Installed plugins – Woocommerce, ACF and ACF for WooCommerce. Created custom fields and placed them in the my-account of the user WooCommerce.
I do not have third-party plugins on the test server, which do not work well.
The only question is the plugin “ACF for WooCommerce”, which saves to the database “field_5ba168bfdcb58”. Why can not this plugin save “user_phone”?
Thanks for the answer. I answered SO. Tell me how to put update_meta_cache ('user', $ user_id);
? Can you show this in my code example?
And what about checkboxes? Everything is correct in the database, and in the email to the administrator shows “array” (
Thanks for the answer. This option works, but if you replace the existing field value, for example “+79998006655” with the new “+78009995566”, then everything is stored correctly in the database, and the old version of “+79998006655” comes to the administrator’s email.
If the custom field is a checkbox, then it is correctly stored in the database, but only “Array” is shown in the administrator email.
How can this be remedied?
There is a plugin “Loushou: ACF for WooCommerce”, which is not updated for two years. Here, the database correctly stores the fields as ‘user_phone’ and ‘user_age’.
Can problems with the plugin “ACF for WooCommerce”? The database also has the string “acf_user_settings a: 1: {s: 15:” show_field_keys “; s: 1:” 1 “;}”
It seems that there are no such filters. I put a clean version of WordPress on a test site. Installed plugins – Woocommerce, ACF and ACF for WooCommerce. Created custom fields and placed them in the my-account of the user WooCommerce.
In the database, the fields are still stored as field_5ba168bfdcb58 (user_phone) and field_5ba16910dcb59 (user_age). Therefore, I no longer know what to do.
Thanks for the answer. How can you find out?
As it turned out, this plugin “ACF for Woocommerce” saves the field data as meta_key: “field_5b7e4f388fd11” and meta_value: “+79998006655”. Tell me how to correctly display the fields in my code?
get_field( 'field_5b7e4f388fd11', "user_{$user_id}" )
This for some reason does not work. Emails come empty fields ((
I described in more detail here:
https://stackoverflow.com/questions/52385930/acf-fields-in-the-database
If not use the “ACF for WooCommerce” plugin, then how do put custom fields in my account page of WooCommerce?
I understood. Do you use the ACF for WooCommerce plugin? This can be a problem with the ACF for WooCommerce plugin?
I need to show custom fields in the WooCommerce account and send user data by email.
Yes, the data of these custom fields are saved in the database.
Thanks for the answer.
I did as you said. Unfortunately, these fields are still not shown in the email.
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.