Skip to content

Remove Magento_Sales' remaining dependency on Magento_Wishlist - #399

Draft
pingiun wants to merge 1 commit into
mage-os:mainfrom
cresset-tools:sales-decouple-wishlist-order-create
Draft

pingiun wants to merge 1 commit into
mage-os:mainfrom
cresset-tools:sales-decouple-wishlist-order-create

Conversation

@pingiun

@pingiun pingiun commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Description (*)

Sales\Model\AdminOrder\Create creates Wishlist models through the object manager, and Sales' layouts always place the wish list sidebar section. Without Wishlist, the order create page fails. This finishes the Sales part after #287.

  • Add Sales\Model\AdminOrder\WishlistProviderInterface with a null implementation. Wishlist binds the real one in adminhtml/di.xml, as Decouple the admin order-create items grid from Magento_Wishlist #287 does.
  • Create uses it through a new optional constructor argument. Without wish lists, getCustomerWishlist() returns false and wish list actions are skipped.
  • Wishlist's layouts now place the sidebar section, after the cart section as before.
  • Drop the require from Sales' composer.json.

Related Pull Requests

#287, #395, #396, #397, #398, #400

Manual testing scenarios (*)

  1. In admin order create for a customer with a wish list, the Wish List sidebar section, adding an item to the order and "Move to Wish List" work as before.

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)

🤖 Generated with Claude Code

The admin order create model loaded Magento\Wishlist models through the
object manager when it showed the customer's wish list in the sidebar,
moved a quote item to a wish list, added a wish list item to the order or
removed one. Sales' layouts also always placed the wish list sidebar
section. Without module-wishlist, opening the order create page failed.

Add Magento\Sales\Model\AdminOrder\WishlistProviderInterface, which loads
a customer's wish list, a wish list by ID and a wish list item. Sales binds
it to NullWishlistProvider; Magento_Wishlist binds it to
Wishlist\Model\Sales\AdminOrder\WishlistProvider in its adminhtml di.xml.
Create gets the provider as a new optional constructor argument. Without
wish lists, getCustomerWishlist() returns false, moving an item to a wish
list reports that the wish list can't be found, and wish list items in the
request are ignored.

The wish list sidebar section is now placed by Magento_Wishlist's layouts,
after the shopping cart section as before, and the
sales_order_create_load_block_sidebar_wishlist handle moves there. The
Sidebar\Wishlist block class stays in Sales.

With this, Magento_Sales' composer.json drops magento/module-wishlist.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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

Successfully merging this pull request may close these issues.

1 participant