Skip to content

Unable to view order as a guest #933

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
sdegetaus opened this issue Apr 17, 2025 · 0 comments
Open

Unable to view order as a guest #933

sdegetaus opened this issue Apr 17, 2025 · 0 comments

Comments

@sdegetaus
Copy link

Describe the bug
I believe there is a logic flaw in the WC_Order Root Query when trying to access an order as a guest. The suspect line is this one.

To my knowledge and according to the docs, the function get_current_user_id() will always return 0 when not logged in, making viewing an order as a guest impossible.

I am new to this plugin, so I may be missing some knowledge. However, since I am taking this theme (WooNuxt) as a starting point and since it is also failing to allow me to see my order as a guest, I believe this might be a bug:

Image

To Reproduce
Steps to reproduce the behavior:

  1. Go to WooNuxt
  2. Add a product to your cart
  3. Checkout (as a guest)
  4. You will be redirected to the thankyou page, but you will encounter the aforementioned error message: Not authorized to access this order.

Expected behavior
I am expecting to be able to see an order as a guest right after I place one.

Desktop (please complete the following information):

  • OS: Windows 11
  • Browser: Brave
  • Version: 1.77.97 Chromium: 135.0.7049.84 (Official Build) (64-bit)

Plugin Versions

  • WooGraphQL Version: 0.21.0
  • WPGraphQL Version: 2.1.1
  • WordPress Version: 6.8
  • WooCommerce Version: 9.8.1

Let me know if I am missing something 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant