Title: Pre-fill some custom fields via PHP code
Last modified: February 13, 2023

---

# Pre-fill some custom fields via PHP code

 *  Resolved [digitivup](https://wordpress.org/support/users/digitivup/)
 * (@digitivup)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/pre-fill-some-custom-fields-via-php-code/)
 * Hello,
 * I would like to be able to pre-fill some custom fields via PHP code. I want to
   enter in a field the number of products in the cart. I have no problem to get
   the number of items, but I can’t prefill the field.
 * Can you tell me how I can do this.
 * Thanks in advance.

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Support [Tomasz WP Desk](https://wordpress.org/support/users/tomaszwp/)
 * (@tomaszwp)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/pre-fill-some-custom-fields-via-php-code/#post-16468625)
 * Hello [@digitivup](https://wordpress.org/support/users/digitivup/)
 * I am sorry but our plugin does not have the function of retrieving a value other
   than the one stored in the user profile (this applies to fields from sections
   that WooCommerce caches for the next order).
   This is a custom modification for
   a specific case and our technical support does not cover it.
 *  Thread Starter [digitivup](https://wordpress.org/support/users/digitivup/)
 * (@digitivup)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/pre-fill-some-custom-fields-via-php-code/#post-16468834)
 * Thank you for your answer, in this case, I will modify the form with JQuery to
   fill the fields with the values I will have retrieved before.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Pre-fill some custom fields via PHP code’ is closed to new replies.

 * ![](https://ps.w.org/flexible-checkout-fields/assets/icon-256x256.gif?rev=2522628)
 * [Flexible Checkout Fields for WooCommerce - WooCommerce Checkout Manager](https://wordpress.org/plugins/flexible-checkout-fields/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/flexible-checkout-fields/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/flexible-checkout-fields/)
 * [Active Topics](https://wordpress.org/support/plugin/flexible-checkout-fields/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/flexible-checkout-fields/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/flexible-checkout-fields/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [digitivup](https://wordpress.org/support/users/digitivup/)
 * Last activity: [3 years, 3 months ago](https://wordpress.org/support/topic/pre-fill-some-custom-fields-via-php-code/#post-16468834)
 * Status: resolved