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?
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.
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?
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
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/
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.
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
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.