Skip to content

inventory

Auto Added by WPeMatico

Magento 2.3.1 Inventory reservations cleanup not working

Even though cron job seems to be working fine, it does not cleanup the inventory_reservation table. This is the result I get back from the cron.log: [2019-06-03 00:00:11] main.INFO: Cron Job inventory_cleanup_reservations is successfully finished. Statistics: {“sum”:0.0029830932617188,”count”:1,”realmem”:0,”emalloc”:70656,”realmem_start”:161742848,”emalloc_start”:160341872} [] [] It… Read More »Magento 2.3.1 Inventory reservations cleanup not working

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