cancel
Showing results for 
Search instead for 
Did you mean: 

Show order status again on product details page?

Show order status again on product details page?

Is it possible to check if a product is on backorder on the product detail page? I would like to show a certain message and product atribute when the 'product status' is in backorder.

1 REPLY

Re: Show order status again on product details page?

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();

$appState = $objectManager->get('\Magento\Framework\App\State');
$appState->setAreaCode('frontend');

$stockItem = $objectManager->get('\Magento\CatalogInventory\Model\Stock\StockItemRepository');

$id = 1; // product id
$productStock = $stockItem->get($id);

var_dump($productStock->getData());



You can get by backorders(). From above object

If Issue Solved, Click Kudos/Accept As solutions.