Skip to content

magento man

rtrim() expects parameter 1 to be string, bool given#0 /home/…./vendor/magento/framework/Encryption/Adapter/Mcrypt.php(171): rtrim()

While installing magento 2 fresh version, found this issue on server, rtrim() expects parameter 1 to be string, bool given#0 /home/…./vendor/magento/framework/Encryption/Adapter/Mcrypt.php(171): rtrim() #1 /home/…./vendor/magento/framework/Encryption/Encryptor.php(452): MagentoFrameworkEncryptionAdapterMcrypt->decrypt() #2 /home/…./vendor/magento/module-config/Model/Config/Backend/Encrypted.php(111): MagentoFrameworkEncryptionEncryptor->decrypt() According to Magento DevDocs mcrypt extension is not needed and it’s already… Read More »rtrim() expects parameter 1 to be string, bool given#0 /home/…./vendor/magento/framework/Encryption/Adapter/Mcrypt.php(171): rtrim()

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