magento2 icon indicating copy to clipboard operation
magento2 copied to clipboard

Fixed issue create order page in admin - move items from shopping cart

Open rostilos opened this issue 1 year ago • 23 comments

Description (*)

The reason is that moving an item from the cart or wishlist to the order items section in the current implementation does not remove items from the cart or wishlist, but moves them within the session to the $transferredItems object to hide during order creation. Moved items are only deleted after the order has been created (which is obviously intended to avoid removing items from the wish list and cart in case no order has been created ). There is currently no functionality to restore moved items, and the item is re-added when you try to move it from the ordered section back to the cart/wishlist (regardless of whether the item is in them). I tried to add this functionality in this MR

Related Pull Requests

Fixed Issues (if relevant)

  1. Fixes magento/magento2#37538

Manual testing scenarios (*)

  1. Create an order from admin.
  2. Add products and move the products to SHOPPING CART or WISHLIST
  3. Again move products to Order.
  4. Put the items back into the cart/wishlist.

Questions or comments

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)

rostilos avatar May 28 '23 16:05 rostilos

Hi @rostilos. Thank you for your contribution! Here are some useful tips on how you can test your changes using Magento test environment.

Add the comment under your pull request to deploy test or vanilla Magento instance:
  • @magento give me test instance - deploy test instance based on PR changes
  • @magento give me 2.4-develop instance - deploy vanilla Magento instance

:exclamation: 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 :information_source: 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-assistant[bot] avatar May 28 '23 16:05 m2-assistant[bot]

@magento run Static Tests

rostilos avatar May 28 '23 16:05 rostilos

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues.

@magento run all tests

rostilos avatar May 28 '23 17:05 rostilos

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues.

@magento run all tests

rostilos avatar May 29 '23 04:05 rostilos

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues.

@magento run all tests

rostilos avatar May 29 '23 10:05 rostilos

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues.

@magento run Functional Tests EE

rostilos avatar Jun 02 '23 17:06 rostilos

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues.

@magento run all tests

engcom-Hotel avatar Jun 12 '23 13:06 engcom-Hotel

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues.

@magento run all tests

engcom-Hotel avatar Oct 26 '23 08:10 engcom-Hotel

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues.

Hello @rostilos,

Have you got a chance to check this comment?

Thanks

engcom-Hotel avatar Nov 15 '23 06:11 engcom-Hotel

@engcom-Hotel Yes, I have looked at it, and will try to fix it as soon as possible, can't spare the time right now, but will give an update soon. Thanks

rostilos avatar Nov 15 '23 07:11 rostilos

@rostilos did you get a chance to have a look on https://github.com/magento/magento2/pull/37553#pullrequestreview-1699112369?

engcom-Hotel avatar Dec 26 '23 06:12 engcom-Hotel

@engcom-Hotel Slightly reworked the functionality ( removed the stitch-case statement ), covered the functionality with mftf tests

Please note : the edits do not involve "deleting" an item from the cart. Because removing an item from the quote will actually lead to its absence in the future. I decided to simply "restore" the item to the cart-items section if it already exists in the cart instead of adding it again

rostilos avatar Jan 06 '24 12:01 rostilos

@magento run all tests

rostilos avatar Jan 07 '24 16:01 rostilos

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues.

@magento run all tests

engcom-Hotel avatar Jan 08 '24 09:01 engcom-Hotel

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues.

@magento run all tests

engcom-Echo avatar Jan 16 '24 05:01 engcom-Echo

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues.

@magento run all tests

engcom-Echo avatar Jan 16 '24 07:01 engcom-Echo

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues.

@magento run Functional Tests EE

engcom-Echo avatar Jan 16 '24 10:01 engcom-Echo

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues.

Functional failure are not related to PR changes. Hence moving it to Pending Review

engcom-Echo avatar Jan 16 '24 12:01 engcom-Echo