Skip to content

quantity

Auto Added by WPeMatico

pre order on the category page

How to change the label of add to cart to pre order on all magento 2.4.5 based on the below conditions: if(qty<0 , product is salable and getBackorders()/true ) to show pre order else add to cart

Magento 2 show current stock for salable quantity on productpage

I have this code for showing if my product is in stock or not. <?php /* @var $block MagentoCatalogBlockProductViewAbstractView */?> <?php $_product = $block->getProduct() ?> <?php $stockstate = MagentoFrameworkAppObjectManager::getInstance()- >get(‘MagentoInventorySalesApiApiGetProductSalableQtyInterface’); $sale_qty = $stockstate->execute($_product->getSku(), 1); ?> <?php if ($block->displayProductStockStatus()): ?> <?php… Read More »Magento 2 show current stock for salable quantity on productpage