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

Removed the customer logged in condition from reorder method #39601

Open
wants to merge 6 commits into
base: 2.4-develop
Choose a base branch
from

Conversation

Mohamed-Asar
Copy link
Contributor

@Mohamed-Asar Mohamed-Asar commented Feb 4, 2025

Description (*)

Removed the customer login check, verify only the re-order eligibility for the particular order

Fixed Issues (if relevant)

  1. Fixes Reorder with a deleted parent configurable product #39568

Manual testing scenarios (*)

  1. Create a configurable product and place an order with a customer for this product
  2. After placing the order delete the product from the Magneto system
  3. Navigate the user that has placed this order in the admin,
  4. Select the orders tab,
  5. Find the desired order and verify the reorder link is not present

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • README.md files for modified modules are updated and included in the pull request if any README.md predefined sections require an update
  • All automated tests passed successfully (all builds are green)

Copy link

m2-assistant bot commented Feb 4, 2025

Hi @Mohamed-Asar. Thank you for your contribution!
Here are some useful tips on how you can test your changes using Magento test environment.
❗ Automated tests can be triggered manually with an appropriate comment:

  • @magento run all tests - run or re-run all required tests against the PR changes
  • @magento run <test-build(s)> - run or re-run specific test build(s)
    For example: @magento run Unit Tests

<test-build(s)> is a comma-separated list of build names.

Allowed build names are:
  1. Database Compare
  2. Functional Tests CE
  3. Functional Tests EE
  4. Functional Tests B2B
  5. Integration Tests
  6. Magento Health Index
  7. Sample Data Tests CE
  8. Sample Data Tests EE
  9. Sample Data Tests B2B
  10. Static Tests
  11. Unit Tests
  12. WebAPI Tests
  13. Semantic Version Checker

You can find more information about the builds here
ℹ️ Run only required test builds during development. Run all test builds before sending your pull request for review.


For more details, review the Code Contributions documentation.
Join Magento Community Engineering Slack and ask your questions in #github channel.

@m2-github-services m2-github-services added Partner: Ziffity partners-contribution Pull Request is created by Magento Partner labels Feb 4, 2025
@Mohamed-Asar
Copy link
Contributor Author

@magento run all tests

@engcom-Bravo engcom-Bravo added the Priority: P2 A defect with this priority could have functionality issues which are not to expectations. label Feb 5, 2025
@Priyakshic Priyakshic added the Project: Community Picked PRs upvoted by the community label Feb 12, 2025
@ihor-sviziev
Copy link
Contributor

@Mohamed-Asar,
To understand the full picture - I see you used a different approach than the one described in the issue description.
Now, I'm confused about why the issue's author suggests checking the product's existence while you suggest removing the check if the customer is logged in in the customer session.

Could you please explain why you rejected the way how it was suggested to fix and decided to fix it in another way?

@Mohamed-Asar
Copy link
Contributor Author

Mohamed-Asar commented Feb 12, 2025

@ihor-sviziev
The canReorder method is used in the frontend recent orders template to determine whether an order is eligible for reordering. However, this method checks if the customer is logged in.

In the frontend, since the customer is logged in, the method returns the expected result. However, the same method is also used in the admin panel, where the customer is not logged in, causing it to always return true.

I don't see any valid reason to check whether the customer is logged in to determine reorder eligibility. That's why I removed this logic.

@engcom-Hotel engcom-Hotel self-requested a review February 13, 2025 06:28
@engcom-Hotel
Copy link
Contributor

@magento run all tests

Copy link
Contributor

@engcom-Hotel engcom-Hotel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @Mohamed-Asar,

Thanks for the contribution!

The code changes seem fine to us. However, please fix the static test failures. The other failed tests appear to be flaky.

Thanks

@Mohamed-Asar
Copy link
Contributor Author

@magento run all tests

@Mohamed-Asar
Copy link
Contributor Author

@engcom-Hotel

I fixed the static test case failures, please review

@engcom-Hotel
Copy link
Contributor

@magento run all tests

@engcom-Hotel
Copy link
Contributor

@magento run Integration Tests

@engcom-Bravo
Copy link
Contributor

@magento run all tests

@engcom-Bravo
Copy link
Contributor

Hi @Mohamed-Asar,

Thanks for the collaboration & contribution!

✔️ QA Passed

Preconditions:

  • Install fresh Magento 2.4-develop

Steps to reproduce

  • Create a configurable product and place an order with a customer for this product
  • After placing the order delete the product from the Magneto system
  • Navigate the user that has placed this order in the admin,
  • Select the orders tab,
  • Find the desired order and verify the reorder link is not present

Before: ✖️ 

Screenshot 2025-02-18 at 12 12 07 pm

After: ✔️

Screenshot 2025-02-18 at 12 18 02 pm

Builds are failed. Hence, moving this PR to Extended Testing.

Thanks.

@engcom-Charlie
Copy link
Contributor

@magento run Functional Tests CE, Functional Tests EE

@engcom-Charlie engcom-Charlie self-assigned this Feb 19, 2025
@engcom-Charlie
Copy link
Contributor

Two of the Functional EE test failure are inconsistent in the last two builds. They neither part of PR nor failing because of the PR changes, seems to be flaky. The other one is a known issue. Hence moving it to Merge In Progress.

Run 1:
https://public-results-storage-prod.magento-testing-service.engineering/reports/magento/magento2/pull/39601/49242207b8d8ab274cfed56a7dffa32f/Functional/allure-report-ee/index.html#categories

image

Run 2:
https://public-results-storage-prod.magento-testing-service.engineering/reports/magento/magento2/pull/39601/3e323d1ea9adc776939cf4ec44885eff/Functional/allure-report-ee/index.html#categories/8d15dc75932eb25ad8b082470d405a17/290976eab9ed622a/
image

Known Issue:
OrderDataGridDisplaysPurchaseDateTest: ACQE-5825

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Partner: Ziffity partners-contribution Pull Request is created by Magento Partner Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Progress: ready for testing Project: Community Picked PRs upvoted by the community
Projects
Status: Merge in Progress
Development

Successfully merging this pull request may close these issues.

Reorder with a deleted parent configurable product
7 participants