Skip to content

Conversation

rogyar
Copy link
Contributor

@rogyar rogyar commented Oct 26, 2017

Description

The solution adds a possibility to use backorders functionality with Multi-Source Inventory

/** @var Item $stockItem */
$stockItem = current($stockItemsCollection->getItems());

if ($stockItem->getData('backorders') > 0) {
Copy link

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;
Copy link

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;
Copy link

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)
Copy link

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
Copy link

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"/>
Copy link

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

Valeriy Nayda added 2 commits November 1, 2017 16:18
…ckorder

# Conflicts:
#	app/code/Magento/InventorySales/etc/di.xml
@naydav naydav merged commit bb6fdac into develop Nov 7, 2017
@maghamed maghamed deleted the inventory-sales-backorder branch December 11, 2018 18:13
magento-devops-reposync-svc pushed a commit that referenced this pull request Dec 6, 2021
B2B-2018: [AWS S3] [Integration Tests]: Investigate Test Failures in InventoryImportExport module
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants