Skip to content

Commit

Permalink
Merge pull request #127 from AmpersandHQ/issue-69-issue-121-allow-shi…
Browse files Browse the repository at this point in the history
…pping-via-admin-panel-without-source-selection

Prevent the need for source selection when shipping via Admin
  • Loading branch information
convenient authored Dec 7, 2023
2 parents c634a55 + 0dd0af2 commit d8db36b
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/etc/adminhtml/events.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
<event name="controller_action_predispatch_adminhtml_order_shipment_new">
<!-- Prevent redirecting to source selection page when making a shipment via the MAP -->
<observer name="inventory_shipping_check_data_before_load_new_shipment" disabled="true"/>
</event>
</config>
15 changes: 15 additions & 0 deletions src/view/adminhtml/layout/sales_order_view.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceContainer name="content">
<!--
Remove this block "Magento\InventoryShippingAdminUi\Block\Adminhtml\Order\View\ShipButton" which takes you
to a source selection screen if the order is deemed to need it via sales->order->ship
The source has already been removed at the time of order shipment, so just take the admin to the old shipment
page (which is the same functionality if manageStock was set to 0)
-->
<referenceBlock name="sales_order_view_ship_button" remove="true"/>
</referenceContainer>
</body>
</page>

0 comments on commit d8db36b

Please sign in to comment.