Adding author to entry submitted anonymously in WooCommerce integration

By: Krzysztof Szewczuk | Asked: 02/13/2024
ForumsCategory: Paid Help WantedAdding author to entry submitted anonymously in WooCommerce integration
Krzysztof Szewczuk asked 10 months ago
Hello, I asked same question on How to but I am willing to pay for some help with our issue. We are using form attached to a WooCommerce product in our store. Clients can order items as guests and client accounts are created after submitting an order. The problem with such construction is that submitted entries do not have an author. We would like to add it after WooCommerce order is paid (status changed to processing) but we have some problem with code. Formidable support pointed us to this article https://formidableforms.com/knowledgebase/formidable-woocommerce/#kb-add-username-to-field-after-completed-order as a starting point.  
1 Answers
Victor Font answered 10 months ago
I don't think you can do what you are asking because the code that was suggested to you assumes that the person that's logged in is the same person that filled out the form in the first place. If the status changes when an Admin is viewing the record, the user ID will be the admin's not the user that filled out the form. You have to register the users first, otherwise I don't have an answer about how you can realize you business process.
Krzysztof Szewczuk replied 10 months ago

Thank you for the reply. How about this code - https://formidableforms.com/knowledgebase/formidable-woocommerce/#kb-add-order-id-to-entry ? We are using it to add order number to our entry and it works fine so maybe we could use it for adding entry author somehow?

Victor Font replied 10 months ago

Unless I'm missing something, the only way to add an entry's author to an entry is if the author is logged in when the entry is created.

Making the Best WordPress Plugin even better - Together

Take on bigger projects with confidence knowing you have access to an entire community of Formidable Experts and Professionals who have your back when the going gets tough. You got this!
Join the community
crossarrow-right