-
Notifications
You must be signed in to change notification settings - Fork 247
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inventory sales backorder functionality #156
Conversation
/** @var Item $stockItem */ | ||
$stockItem = current($stockItemsCollection->getItems()); | ||
|
||
if ($stockItem->getData('backorders') > 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use methods from interface but not from implementation
\Magento\CatalogInventory\Api\Data\StockItemInterface::getBackorders
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
namespace Magento\InventorySales\Test\Integration\Stock; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix code style
|
||
use Magento\Catalog\Api\Data\ProductInterface; | ||
use Magento\Catalog\Api\ProductRepositoryInterface; | ||
use Magento\Catalog\Model\ProductRepository; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like unused dependency
* @param string $sku | ||
* @return SourceItemInterface | ||
*/ | ||
private function getSourceItemBySKU(string $sku) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Provide return typing
|
||
/** | ||
* @param SourceItemInterface $sourceItem | ||
* @param $qty |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Specify type
--> | ||
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> | ||
<type name="Magento\InventoryApi\Api\IsProductInStockInterface"> | ||
<plugin name="backorderInventoryStockStatus" type="Magento\InventorySales\Plugin\Model\BackorderStockStatusPlugin"/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use underscore for mane separating
-- slight refactoring
…ckorder # Conflicts: # app/code/Magento/InventorySales/etc/di.xml
B2B-2018: [AWS S3] [Integration Tests]: Investigate Test Failures in InventoryImportExport module
Description
The solution adds a possibility to use backorders functionality with Multi-Source Inventory