0
如何通过编程获得产品信息的延期交货状态?如何从Magento 2中以编程方式获取产品信息的延期交货状态
现在产品信息已经准备好作为$ _product,我们也可以通过此代码获取库存状态。
<?php $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$StockState = $objectManager->get('\Magento\CatalogInventory\Api\StockStateInterface');
$product_is_stock = $StockState->getStockQty($_product->getId(), $_product->getStore()->getWebsiteId()); ?>
此外,延期交货功能已经结算,因此我们可以在购物车上添加缺货产品。