Skip to content

Commit ca05ced

Browse files
committed
Create salableQuantity.php
1 parent 46b9ae5 commit ca05ced

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

salableQuantity.php

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?php
2+
3+
require dirname(__FILE__) . '/app/bootstrap.php';
4+
$bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $_SERVER);
5+
6+
class Outslide extends \Magento\Framework\App\Http
7+
implements \Magento\Framework\AppInterface {
8+
public function launch()
9+
{
10+
$appState = $this->_objectManager->get('Magento\Framework\App\State');
11+
$appState->setAreaCode('frontend');
12+
$stockState = $this->_objectManager->get('\Magento\InventorySalesAdminUi\Model\GetSalableQuantityDataBySku');
13+
$productSku = 'WT09';
14+
$qty = $stockState->execute($productSku);
15+
16+
echo 'Qty: ' . $qty[0]['qty'];
17+
18+
return $this->_response;
19+
}
20+
}
21+
22+
/** @var \Magento\Framework\App\Http $app */
23+
$app = $bootstrap->createApplication('Outslide');
24+
$bootstrap->run($app);

0 commit comments

Comments
 (0)