We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
<?php /** namespace Vendor\Module\Helper; use Magento\Framework\App\Helper\AbstractHelper; use Magento\Framework\App\Helper\Context; use Magento\InventoryShipping\Model\InventoryRequestFromOrderFactory; use Magento\Sales\Api\Data\OrderInterface; use Magento\Sales\Api\Data\OrderItemInterface; class SourceSelection extends AbstractHelper { protected $inventoryRequestFromOrderFactory; protected $sourceSelectionService; public function __construct( \Magento\InventorySourceSelectionApi\Api\SourceSelectionServiceInterface $sourceSelectionService, InventoryRequestFromOrderFactory $inventoryRequestFromOrderFactory, Context $context ) { $this->inventoryRequestFromOrderFactory = $inventoryRequestFromOrderFactory; $this->sourceSelectionService = $sourceSelectionService; parent::__construct($context); } public function getAlgorithmSourceCode() { return $this->scopeConfig->getValue('vendor/orders/source_selection_algorithm_code'); } /** * @param OrderInterface $order * @return void */ public function getPreferredSource($order) { $inventoryRequest = $this->inventoryRequestFromOrderFactory->create($order); $result = $this->sourceSelectionService->execute($inventoryRequest, $this->getAlgorithmSourceCode()); return $result; } }
However the same issue doesn't happen when you ship the order from the backend and everything works as expected.
The $inventoryRequest contains the bundle SKU product
$inventoryRequest
This is the sample inventory request created when shipping the product via the backend. As you can see it contains one product the physical one.
The text was updated successfully, but these errors were encountered:
Hi @ioweb-gr. Thank you for your report. To speed up processing of this issue, make sure that you provided sufficient information.
Add a comment to assign the issue: @magento I am working on this
@magento I am working on this
Sorry, something went wrong.
We were able to reproduce this as well.
No branches or pull requests
Preconditions (*)
Steps to reproduce (*)
However the same issue doesn't happen when you ship the order from the backend and everything works as expected.
Expected result (*)
The
$inventoryRequest
contains the bundle SKU productThis is the sample inventory request created when shipping the product via the backend. As you can see it contains one product the physical one.
Actual result (*)
$inventoryRequest
contains an empty items arrayThe text was updated successfully, but these errors were encountered: