wp_post Author Id error with Id
-
Hello Dear
First at all, thank you for your help and time will put it on it.
After customer, in special the customer are logged, pay for some product, in wp_post.. author_Id we can see all the post are with the same id, the admin ID, and we think that is an error.We think it should be the Customer Id.
How can we solve it if it is an error?
-
By the way, we make test, with all plugin deactivated and also, chage the theme to hello theme, and still the same issue.
Hello abacoin
Thank you for contacting Woo support.
Let me rephrase what you said to confirm if I understand the problem correctly.
When a customer logs in to your site and makes a purchase, an entry is created in the wp_posts table.
Each entry has the same value for the author_ID column that is equal to the Admin ID.
You are saying it should be equal to Customer ID.Is my understanding correct?
Could you share some screenshots from your end?
That will help me compare your entries with the entries on my test site.Looking forward to your response. ??
Best regards.
Hello Zubair !
Yes you are correct, but I’m not sure if I do.
The question is, in ‘wp_post’ as ‘post_type->shop_order’, in the post_author column, has to be the Customer Id or User Id, in other words, the ID of the person who bought the product, that is my question.
Here the screenshots:
https://imgur.com/a/gBQiIYq
Thank You and God Bless You AllHi @abacoin
In WooCommerce, the
post_author
field in thewp_posts
table forpost_type->shop_order
is typically the ID of the user who created the order. In most cases, this would be the customer ID. However, if an admin creates an order on behalf of a customer, thepost_author
would be the admin’s user ID.If you’re seeing the admin ID for all orders, it could be that the orders are being created via the admin interface. If this is not the case and the customers are making these orders themselves, then there might be an issue.
Could you please confirm if the customers themselves are making the orders or if they are being created via the dashboard? If not, check whether those orders are being created using any third-party service or plugin with API or administration access.
Looking forward to your response.
Hi Again.
We test already before lookup for help, with all the normal test, change theme, deactivate all plugins, clear caches and cookies, and still the issue.
And Yes, the orders are created from a different browser and user Id, that is from where we know something is wrong.
What else we can do Dear?
Is urgent for as now to solve this issue, please help us because we are so close for the soft launch.Hi @abacoin,
Thanks again for getting back to us.
If I understand you correctly, you want to track purchases by customer ID. I came across this article that seems to describe what you’re trying to achieve in detail.
Please take a look at it and let us know if you have any further questions.
Thanks a lot Ckadenge.
I read the article you give me, and I can see diferent options to get the Author of the order, but in diferent tables and not in wp_post.
They validate the post_author has to be the Author, but not in my case, that is my problem here. and you know, if something not work, is because something else is not working lol.
I Still reaching for solution… and Hope you can guide me to solve it.Hi @abacoin
Yes, the orders are created from a different browser and user Id, that is from where we know something is wrong.
Is this customer registered on your site, or are they placing an order from a different site or through a POS interface? Could you please provide more details or the steps to reproduce this error on my end?
However, based on the conflict tests you’ve carried out and the results you’ve shared, there might be an issue with your WooCommerce setup. The
post_author
field in thewp_posts
table should indeed reflect the customer’s ID who placed the order.To determine whether the issue is in WooCommerce setup, you may consider reinstalling WooCommerce. But before doing so, please ensure you have a complete backup of your site. If you feel unsafe, you can test it on a staging site first.
Additionally, head over to WooCommerce → Status → Tools, and do the following:
- WooCommerce transients – Clear
- Expired transients – Clear
- Clear template cache – Clear
- Capabilities – Reset Capabilities
- Clear customer sessions -Clear
- Update database – Update
- Verify base database tables – Verify
- Product lookup tables – Regenerate
- Regenerate the product attributes lookup table – Regenerate
Next, please clear your browser cache and place another order using a customer account. If this makes no difference, I recommend contacting a WooCommerce developer or expert who can look closely at your setup.
- A local web developer
- Codeable.io
- WooExperts
You can also ask for insight related to those on either the WooCommerce Advanced Facebook group or the WooCommerce Community Slack. Many of our developers hang out there and will be able to offer insights into your question.
I wish I could help more, but hopefully, this gets you going in the right direction to get some further insight/information.
Shammem, Thank you for your help!
We follow up step by step, all your recommendations, and we left until the end, delete woocommerce plugin , and then reinstall, but, we have a problem:
https://imgur.com/a/dtoCZ71
All the plugins, caches, browsers etc, and we disconnect the woocommerce account also, and we can't delete the plugin.
Last point:
The WooCommerce Legacy REST API that woocommerce install in automatic, looks like IS NOT installed, you can check in the image, it say is required and the button is not to activate, is to 'install' the plugin from wordpress plugin repo.
Note1: This is the list that we found out that we have to remove from wp_plugins, and 'only in that way, the woocommerce plugin, let uninstall.
dokan-lite
dokan-pro
woocommerce-conditional-shipping-and-payments
woocommerce-deposits
woocommerce-gateway-stripe
woocommerce-google-analytics-integration
woocommerce-paypal-payments
Note2: We can't pay for a professional dev, and that is why we are here with you and your support.
Thank YouHi @abacoin,
Thanks for getting back to us with more information on what you’re facing.
and we left until the end, delete woocommerce plugin , and then reinstall, but, we have a problem:https://imgur.com/a/dtoCZ71
I understand you’re facing an issue deleting the WooCommerce plugin.
If I may ask, were you able to first deactivate all other plugins dependent on WooCommerce? If not, I recommend first deactivating all other plugins like WooCommerce PayPal payments then deactivating WooCommerce.
Should you still be unable to uninstall the plugin, I recommend accessing your site via FTP, then heading over to your plugins folder and changing the WooCommerce folder name to a different name. This should automatically deactivate the plugin. You can as well delete the WooCommerce folder under plugins but please be sure to have a full site backup before proceeding.
The WooCommerce Legacy REST API that woocommerce install in automatic, looks like IS NOT installed, you can check in the image, it say is required and the button is not to activate, is to ‘install’ the plugin from wordpress plugin repo.
Please note that the Legacy REST API is deprecated and we recommend using the newer WooCommerce REST API which in most cases is installed with the latest version of WooCommerce.
We can’t pay for a professional dev, and that is why we are here with you and your support.
While we understand you’re unable to hire a professional developer, please also note that our support is only limited to the WooCommerce core plugin.
I hope this helps.
Hello dear.
At list in our system, is not only deactivate all the plugins the ones has to be with woocommerce, algo the follow list, if we don’t remove from site or delete, we can not delete woocommerce, and in the time we remove from server this plugins from below list, then we can delete woocommerce plugin.
dokan-lite
dokan-pro
woocommerce-gateway-stripe
woocommerce-paypal-payments
woocommerce-deposits
woo-update-manager
woocommerce-conditional-shipping-and-payments
woocommerce-google-analytics-integration
woocommerce-legacy-rest-api
Now, we did all th recomendations, and reinstall woocommerce plugin, and change theme, with all plugins deactivated, just the ‘twenty Twenty one’ theme and woocommerce, make a buy a product to make the order, from diffetent browser, with clean browser cache and cookies, and is the same, the Author_id in ‘wp_oder’ table, is the Id of Admin user, the user Id ‘1’.
So, what is the next step? please any help appreciated.Hello abacoin,
Thank you for your reply.
I tried to create the problem on my test site but I have HPOS enabled on my test site.
As a result, I can see the customer’s ID in the database against the order created.I recommend you switch to HPOS which is a better way to store orders.
For more details check this guide about HPOS.Let me know if you have any questions. ??
Best regards.
Zubair nice to say hi again and thank you a lot for your help.
https://imgur.com/a/gsBUIZl
Scream of pure pleasure when I see this is the REAL solution, BINGO !
Thank you again.
Just one more thing, after activated HPOS, display the follow warning:
The Legacy REST API plugin is installed and active on this site. Please be aware that the WooCommerce Legacy REST API is not compatible with HPOS.And now my challenge is to know, active or not REST API plugin, because I really don’t know if we have to use or not, we ignore what plugin need it or not.
For last, can you be kind to give us any idea or suggestion please?
THank you again and God Bless you All.- This reply was modified 4 months, 2 weeks ago by abacoin.
Hi @abacoin
Scream of pure pleasure when I see this is the REAL solution, BINGO !
That’s great to hear! Thanks for letting us know. I am glad that we could address your issue.
And now my challenge is to know, active or not REST API plugin, because I really don’t know if we have to use or not, we ignore what plugin need it or not.
For last, can you be kind to give us any idea or suggestion please?Do you have any other services connected to your store through REST API? To verify, please navigate to WooCommerce > Settings > Advanced > REST API (Or Legacy API) and see if any API keys have been created. If you don’t have any created APIs or aren’t using APIs at all, feel free to disable this plugin, as it’s not being used.
I hope this helps! If you have any other questions, feel free to ask.
Yes Dear, we have an API from the fulfillment service.
- You must be logged in to reply to this topic.