Skip to content

Getting the minimum qty allowed in a shopping cart without deprecated methods

Previously to get the minimum qty allowed in a shopping cart I would use the following code: public function __construct( MagentoCatalogInventoryApiStockRegistryInterface $stockRegistry ){ $this->stockRegistry = $stockRegistry; } public function getMinSaleQtyAllowed($productId): float { $stockItem = $this->stockRegistry->getStockItem($productId); return $stockItem->getMinSaleQty(); } However, MagentoCatalogInventoryApiStockRegistryInterface… Read More »Getting the minimum qty allowed in a shopping cart without deprecated methods