Skip to content
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

[bug]: Order statuses are decoupled from the back-end #3716

Closed
1 of 8 tasks
fooman opened this issue Feb 23, 2022 · 11 comments
Closed
1 of 8 tasks

[bug]: Order statuses are decoupled from the back-end #3716

fooman opened this issue Feb 23, 2022 · 11 comments
Assignees
Labels
bug Something isn't working Issue: Needs Update Additional information is require, waiting for response Progress: done triage-done

Comments

@fooman
Copy link
Contributor

fooman commented Feb 23, 2022

Describe the bug

A refunded order will show a wrong status. Custom order statuses are not shown.

To reproduce

Steps to reproduce the behavior: Refund an order in the admin. Create a custom order status and assign it to an order.

  1. navigate to /order-history
  2. notice PWA-Studio's own take on order statuses

Expected behavior

The frontend should accurately show the status of the order.

Possible solutions

Delete the logic around derivedStatus and display what the back-end provides?

Debug Report

Paste the output of yarn build:report, and any other context about the problem, here.

Please complete the following device information:

  • Device [e.g. iPhone6, PC, Mac, Pixel3]:
  • Browser [e.g. Chrome, Safari]:
  • Browser Version [e.g. 22]:
  • Magento Version [e.g Magento Commerce 2.4]:

Please let us know what packages this bug is in regards to:

  • venia-concept
  • venia-ui
  • pwa-buildpack
  • peregrine
  • pwa-devdocs
  • upward-js
  • upward-spec
  • create-pwa
@fooman fooman added the bug Something isn't working label Feb 23, 2022
@m2-assistant
Copy link

m2-assistant bot commented Feb 23, 2022

Hi @fooman. Thank you for your report.
To speed up processing of this issue, make sure that you provided sufficient information.

Add a comment to assign the issue: @magento I am working on this


@fooman
Copy link
Contributor Author

fooman commented Feb 23, 2022

A few other things not quite right with this implementation. Checking for 'Complete' would not work if the language is not English and/or the label was changed.

It's also a stretch to translate Complete to Delivered. In a default Magento environment the moment an order has an invoice and a shipment its status will change to Complete. At that point in time it would not have left the merchant's warehouse.

@anthoula
Copy link
Contributor

@magento export issue to JIRA project PWA as Bug

@github-jira-sync-bot
Copy link

✅ Jira issue https://jira.corp.magento.com/browse/PWA-2639 is successfully created for this GitHub issue.

@anthoula anthoula added the needs-triage A pull request or issue that needs to be triaged prior to being synced to JIRA label Feb 28, 2022
@fooman
Copy link
Contributor Author

fooman commented Feb 28, 2022

As a further suggestion if the frontend should display differently depending on how far an order has objectively progressed relying on the order state https://github.com/magento/magento2/blob/2.4-develop/app/code/Magento/Sales/Api/Data/OrderInterface.php#L29 would be the way to go. It is language independent and works in conjunction with custom order statuses.

@anthoula anthoula removed the needs-triage A pull request or issue that needs to be triaged prior to being synced to JIRA label Mar 1, 2022
@RaghavendraTirumalasetti
Copy link
Contributor

Hi @fooman,

Can you please give the detailed expected behavior of this ticket?

@RaghavendraTirumalasetti RaghavendraTirumalasetti added the Issue: Needs Update Additional information is require, waiting for response label Jul 10, 2023
@fooman
Copy link
Contributor Author

fooman commented Jul 30, 2023

@RaghavendraTirumalasetti currently the frontend relies on the order status for its logic. This is problematic as order statuses can a.) be customised and b.) be translated.

It would be better to use the order state instead which only has a limited number of applicable states as well as being internal with no translations. The order state can now be queried via graphQl. In other respects following what Luma does would be my suggestion.

@glo82145
Copy link
Collaborator

glo82145 commented Sep 5, 2023

@adobe export issue to JIRA project PWA as Bug

@github-jira-sync-bot
Copy link

✅ Jira issue https://jira.corp.adobe.com/browse/PWA-3178 is successfully created for this GitHub issue.

@RaghavendraTirumalasetti
Copy link
Contributor

RaghavendraTirumalasetti commented Sep 6, 2023

Hi @fooman,

Steps that are followed to reproduce:

  • Refund an order in the admin.
  • Create a custom order status and assign it to an order.
  • change the status of the order from admin

Frontend not showing the right status of the order/ Status of the order remains same

For the fix as per the discussion, rather than using this derivedStatus, it should use the value of the state that is returning from GraphQL

Hence, this issue has been confirmed.
We would appreciate your suggestions if there is anything that we are missing.

Thanks.

@fooman
Copy link
Contributor Author

fooman commented Oct 4, 2023

For the fix as per the discussion, rather than using this derivedStatus, it should use the value of the state that is returning from GraphQL

@RaghavendraTirumalasetti this is correct - nothing missed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Issue: Needs Update Additional information is require, waiting for response Progress: done triage-done
Projects
None yet
Development

No branches or pull requests

6 participants