Skip Navigation

[Resolved] Adding Custom Fields to Order details in Woocommerce

This thread is resolved. Here is a description of the problem and solution.

Problem: I would like to use CRED to add custom field to each order.

Solution: The contents of the Order page are set by WooCommerce, so adding a CRED form here to control a custom field isn't something I can help with. If you can figure out a place to put the CRED form, I can help you create one that allows users to upload a custom file.

This support ticket is created 6 years, 6 months 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 8 replies, has 2 voices.

Last updated by andreaD-4 6 years, 6 months ago.

Assisted by: Christian Cox.

Author
Posts
#572886

Hi,
i'd like Adding Custom Fields to Order details in Woocommerce. In particulary i'd like add file in page order.
The payment method is bank transfer. I would like it after registering and after making the order. The customer can upload the PDF document of the bank transfer. Even a few days after the order. Going to my-account > orders > n ° order and in this page upload file.
is it possible?

#573036

It's possible to add a custom field to an Order, but then managing that custom field value from the Account page isn't something I would be able to help with. The contents of each order page are set by WooCommerce, and integrating with their page structure would require custom code or another 3rd party plugin.

If you are able to find a way to modify the Orders page and insert a shortcode, then I can try to help you insert a CRED form to manage a custom field applied to the Order post type. Your CRED form would only include one input - the file input - and a save button.

#573045

Thank you.
Are there other alternatives to insert the file into other order points? Can you help me build the shortcode? Do you have any idea about the woocommerce file to personalize?

#573078
cred.png

Are there other alternatives to insert the file into other order points?
This is a question that is better answered by the WooCommerce support team. CRED Commerce can help you put an item in someone's shopping cart, but the actual Order isn't created by CRED Commerce. It's created entirely by WooCommerce. So adding a custom field somewhere in the Order creation process will require their assistance.

Can you help me build the shortcode?
Sure, you can create a shortcode automatically within any Content Template, View, or Visual Editor cell by clicking the CRED Forms button and inserting the form of your choice. See the screenshot. Then you can copy and paste that shortcode elsewhere in your site. If you need help generating the form or removing fields from the generated code, let me know. We have more information about CRED forms here:
https://toolset.com/documentation/user-guides/#cred-topics

#573214

Hi Christian, I found this ticket. Can you help me to understand it? is still valid? This solution for me is ok.

https://toolset.com/forums/topic/front-end-input-to-a-custom-field-defined-for-woocommerce-order/

#573405

The solution there involves a fair of custom code that we would not be able to provide here in the forum.
- The CRED form to add information to an Order is placed on the Checkout page. Sure, this is possible, but when a customer gets to the Checkout page, no Order has been created yet by WooCommerce! So you can't add the information directly to an Order that does not exist. To store this information with CRED, you will need to create a new custom post type to hold this information.
- Then you need a way to copy the information into the Order after the Order is created. Custom code is required here, because you need to be able to associate the new post with the new order somehow, and then you need to copy the information over into the new order.

#573975

Hi Christian, if you could guides me to create a CRED to upload a file within the woocommerce checkout page.
Then I'll put the shortcode inside the php page.
This tutorial could be useful to other users. I have seen that there are several posts.
Thank you

#574147

I can help you create a CRED form that allows users to upload a file, but just to be clear, I cannot help you associate this file with an Order. That part requires custom code that I will not be able to assist you with.
- First you create a new field group that contains a file upload field.
- Then you apply this field group to the custom post type you have created specifically to hold this information.
- Then create a new CRED form that creates new posts, and select your custom post type.
- Click the Auto-generate HTML button to generate the code for your CRED form.
- Insert the CRED form into a Content Template using the CRED Forms button in the Content Template editor.

#575117

Thank you Christian

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.