Skip to content

Commit

Permalink
Merge pull request #43 from AmpersandHQ/fix/m2.4-reserved-store-stock…
Browse files Browse the repository at this point in the history
…-bug

Issue #38 - Magento 2.4 in-store reserved stock bug
  • Loading branch information
AliyaAussie authored Feb 15, 2021
2 parents 1c07f47 + 4e4146d commit a6156d7
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.idea/
vendor/
composer.lock
.php_cs.cache
16 changes: 16 additions & 0 deletions src/etc/di.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,20 @@
<type name="Magento\Sales\Model\Service\OrderService">
<plugin name="inventory_sales_source_deduction_processor" type="Ampersand\DisableStockReservation\Plugin\SourceDeductionProcessor"/>
</type>
<!--
Fix M2.4 introduced bug caused by new interface implementation.
New interface implementation checks against in-store reserved stock.
This in turn throws an error as this functionality is disabled.
Approach is to revert back to original implementation as new implementation errors due to redundant code.
- @see New class: \Magento\InventoryInStorePickupSales\Model\SourceSelection\GetSourceItemQtyAvailableService
- https://github.com/magento/inventory/blob/31461f30fbc6e72433c2cf378ebbfdeb30738ed8/InventoryInStorePickupSales/etc/di.xml#L29
- @see Original class: \Magento\InventorySourceSelectionApi\Model\GetSourceItemQtyAvailableService
- https://github.com/magento/inventory/blob/31461f30fbc6e72433c2cf378ebbfdeb30738ed8/InventorySourceSelectionApi/etc/di.xml#L14-L15
- @see https://github.com/AmpersandHQ/magento2-disable-stock-reservation/issues/38
-->
<preference
for="Magento\InventorySourceSelectionApi\Model\GetSourceItemQtyAvailableInterface"
type="Magento\InventorySourceSelectionApi\Model\GetSourceItemQtyAvailableService"
/>
</config>

0 comments on commit a6156d7

Please sign in to comment.