scottyzen / woonuxt

Static e-commerce powered by WooCommerce & Nuxt
https://woonuxt.com
GNU General Public License v3.0
627 stars 161 forks source link

Errors in order summary without log in #212

Open diegomassaroo opened 1 month ago

diegomassaroo commented 1 month ago

When I complete an order it logs me this error: TypeError: Cannot read properties of undefined (reading 'replace') If I check the props.status in orderStatusLabel it shows me empty receipt:

Screenshot 2024-08-02 at 12 29 11

Then when I try to change page and navigate the website it logs me this error: Cannot destructure property 'type' of 'vnode' as it is null.

Do you have any suggestions?

alexookah commented 1 month ago

@diegomassaroo Are you using latest version ?

There was a similar issue: https://github.com/scottyzen/woonuxt/issues/206 Try using latest version maybe it's related/similar issue and your problem will be resolved.

diegomassaroo commented 1 month ago

I have tried but it doesn't resolve the issue

I am using: WordPress | 6.6.1 WooCommerce | 9.1.4 WPGraphQL | 1.27.2 WooGraphQL | 0.19.0 WPGraphQL CORS | 2.1 Woonuxt | 1.0.56

This is the error screenshot:

Screenshot 2024-08-05 at 16 32 54
alexookah commented 1 month ago

@diegomassaroo it seems that the order.status is missing. Please try the latest WooGraphQL | 0.20.0

alexookah commented 1 month ago

Let us know if this resolved your problem and if resolved close this issue :)

diegomassaroo commented 1 month ago

I update WooGraphQL but it doesn't resolve the problem. If I try incognito window or on safari it works but appear this error:

Screenshot 2024-08-05 at 19 39 41
alexookah commented 1 month ago

What payment do you use to checkout? If you go to the order list does it show?

diegomassaroo commented 1 month ago

I use stripe card and yes they appear to the order list

alexookah commented 1 month ago

What status do they have?

alexookah commented 1 month ago

There is a pending PR which Improves checkout with stripe. And this might happen in orders when the payment has failed or some error. so the status is not defined. But this requires a bit of testing.

@scottyzen Will you check the PR and maybe create a new version for these issues to get fixed?

diegomassaroo commented 1 month ago

What status do they have?

They have processing status, so they are correct because products aren't virtual or downloadable.

alexookah commented 1 month ago

@diegomassaroo A new version has been released could you try it and check if the issue got resolved?

diegomassaroo commented 1 month ago

In chrome it works but it display an empty receipt. Instead in incognito and on safari it display: not authorized to access this order

alexookah commented 1 month ago

And this is only happening on guest checkout right?

diegomassaroo commented 1 month ago

Yes exactly

alexookah commented 3 weeks ago

@diegomassaroo I see @scottyzen updated some code about this issue. Could you check the latest version and see if the problem is resolved now?

diegomassaroo commented 3 weeks ago

I just checked and it still remains in a 'Logging you in...' status

alexookah commented 1 week ago

I just made a guest order and it worked. Are you sure you are testing towards latest code versions? (woonuxt, wp-graphQL, woocommerce) ?

diegomassaroo commented 1 week ago

Yes, all my plugins are updated, but I still encounter this issue when completing a guest order:

Screenshot 2024-08-31 at 15 08 49
alexookah commented 1 week ago

What option do you have in WP-GRAPHQL-CORS? do you have set the SameSite CookieMode to None? share a screenshot of your settings please

alexookah commented 1 week ago

also how is it in safari and how is it in Chrome?

alexookah commented 1 week ago

Are you using the latest main code? can you share your website ?

diegomassaroo commented 1 week ago

Sure, here’s the screenshot from WP-GraphQL-CORS:

Screenshot 2024-09-01 at 01 13 42

Yes, I’ve tested it on both Safari and Chrome.

This is the link to my website on Vercel: https://bikeinnovation-fe.vercel.app

As I mentioned last time, I also noticed that when I try to log in, it remains stuck on the 'Logging you in...' status.

alexookah commented 1 week ago

I just checked your website and I just found out you are using outdated code from main branch. Please try to rebase from main your website to get latest changes and try again. it should work.

diegomassaroo commented 1 week ago

I’ve downloaded a copy of the latest code and updated it with my GraphQL endpoint, but it still doesn’t seem to be working properly.

alexookah commented 1 week ago

Try to reduce the authorized domains in wp-graphql cors plugin. keep only one localhost:3000 and one the Vercel one.

alexookah commented 1 week ago

Also I am not sure if that vercel domain should work. Try connecting it with another subdomain same as the Wordpress. Maybe that's the issue.

alexookah commented 1 week ago

Also can you successfully login in localhost?

diegomassaroo commented 1 week ago

Yes, I’ve tried reducing the authorized domain, but I still can’t log in, even on localhost.

alexookah commented 1 week ago

I encountered the same issue on my Woonuxt website when testing in Safari from localhost:3000—getting stuck on the "Logging you in..." message. This problem occurs only in Safari; Chrome works fine from localhost:3000 when trying to login to my remote wordpress website: https://shop.comewithreverse.com/

It appears that Safari has stricter security measures, especially when connecting to an HTTPS website from localhost without SSL, which might cause cookies to be ignored or a domain mismatch to occur, even if the cookie setting is set to None.

However, Woonuxt works correctly in Safari when accessed via HTTPS and the same domain, such as https://comewithreverse.com/. My WordPress site is located at https://shop.comewithreverse.com/.

Please try setting up a subdomain at https://staging-frontend.bikeinnovation.it/ which has same domain as your wordpress connect it with Vercel, and test again in Safari. This should resolve the issue.

diegomassaroo commented 1 week ago

I tried with another site that’s already published, which shares the same domain as my WordPress site, and I’m getting the same error.

alexookah commented 1 week ago

Can you share that domain you tested?

diegomassaroo commented 1 week ago

Sure, but I’ll need to enable test mode for Stripe if you want to test it. Just let me know, and I’ll activate it. Here’s the link: https://www.anienepublishing.it/

alexookah commented 4 days ago

I tested in the website login with safari and it worked I didnt get any "Logging you in...". like from the other website (vercel with different domains)

It's because the wordpress is in url: https://staging.anienepublishing.it/graphql same domain. So it should work.

  1. Is the aniene website using the latest main repo code?
  2. Also maybe in checkout there is something else.

    I remember when I worked on this PR even if there is a checkout payment error the order was created. How did you test exactly the checkout in the aniene website?

diegomassaroo commented 4 days ago

Yes, Aniene is using the repository from August 27, 2024, but I haven’t used layers because I didn’t succeed last time. The locale translations didn’t work as expected, so next time I’ll use layers from the beginning. I select one or more products, fill in the billing details, and proceed to payment. The order completes, but I’m still seeing that error screen.

alexookah commented 3 days ago

Can you Add me in Discord, maybe we can sync so that I can test it in test mode? (#alexookah)