Skip to content

Instantly share code, notes, and snippets.

View adamzero1's full-sized avatar

Adam adamzero1

View GitHub Profile
@adamzero1
adamzero1 / double_decrementing_stock_on_shipment.patch
Last active August 26, 2021 19:52
Magento doule decrementing stock when shipping orders
--- Model/GetItemsToDeductFromShipment.php 2020-11-26 10:23:56.827000000 +0000
+++ Model/GetItemsToDeductFromShipment.php 2020-11-26 10:22:50.741302876 +0000
@@ -17,6 +17,7 @@
use Magento\Sales\Model\Order\Item as OrderItem;
use Magento\Sales\Model\Order\Shipment;
use Magento\Sales\Model\Order\Shipment\Item;
+use Magento\CatalogInventory\Api\StockConfigurationInterface;
/**
* Get source items for deduction class.
@adamzero1
adamzero1 / incorrect_store_id_for_admin_orders.patch
Created August 4, 2020 14:14
Wrong Store Id when creating order in admin, with single store.
--- Model/Session/Quote.php 2020-08-04 13:55:36.438626071 +0000
+++ Model/Session/Quote.php 2020-08-04 13:56:16.990487672 +0000
@@ -134,7 +134,7 @@
$cookieMetadataFactory,
$appState
);
- if ($this->_storeManager->hasSingleStore()) {
+ if ($this->_storeManager->isSingleStoreMode()) {
$this->setStoreId($this->_storeManager->getStore(true)->getId());
}