How to Change Stock Status in Magento 2 Import When “is_in_stock” Is Missing
You can easily change a product stock status in Magento 2 automatically by importing the update straight to your e-commerce website. But what if the “is_in_stock” column is missing or doesn’t contain any values? Use Improved Import & Export. Provide the update, and the extension will recreate “is_in_stock” values following the corresponding “qty” values automatically. So, when is_in_stock is missing in the import table, there is no need to create additional files or apply changes to the import table. Let’s see how to change a product stock status in Magento 2 when “is_in_stock” data is absent. Follow our Developer’s Cookbook for more useful tips on Magento 2.
What Is Magento 2 Stock Status?
While stock status in general is a report that shows what stock is on hand, what needs to be dispatched to customers, and what is on its way to be received, Magento 2 focuses on the most important aspect only – understanding whether a certain product is available for sale or not. On the frontend, it looks as follows:
Therefore, you have just two options:
- is_in_stock = 1 which means that the product is in stock;
- is_in_stock = 0 which means that the product is out of stock.
You can also switch between them manually in the admin:
If this information is not available in the update file, you cannot properly import products to your catalog for selling them.
But if the “is_in_stock” column from the file above is not available or lacks data?
Luckily, the Improved Import & Export module knows how to read the provided data and recreate the missing values.
How to Change Stock Status in Magento 2 When “is_in_stock” Is Missing in The Import Table
The Improved Import & Export Magento 2 extension updates “is_in_stock” values based on the corresponding “qty” values automatically, when “is_in_stock” data is missing in the import table. If the product quantity is more than zero, the module sets the stock status as “is_in_stock = 1”. If the product quantity equals zero, it updates the stock status as “is_in_stock = 0”.
That’s it. You only need to provide the update file, and the Improved Import & Export extension will do all the work for you.
However, if the quantity data is missing in the import table, the module doesn’t change the “is_in_stock”.
Learn how to import products to Magento 2 here: Magento 2 product import and export guide.
Improved Import & Export Features
In addition to changing a product stock status in Magento 2 when “is_in_stock” data is not available, the Improved Import & Export module offers many more useful import and export improvements.
First of all, the extension includes a timeline useful for regular data transfers. The scheduling section lets you import data to your e-commerce website at any time.
The plugin also includes a number of mapping functions. Third-party attributes can be matched to Magento 2 attributes, or new attributes and values can be automatically generated when data is imported into Magento 2.
Furthermore, advancements to import and export allow you to avoid time-consuming and unpleasant file transformations. Our plugin supports a wide range of file types, including CSV, XML, JSON, ODS, and XLSX, whereas Magento 2 only accepts CSV files. They may be imported and exported natively.
Various file sources are also at your service. Google Drive, Dropbox, FTP/SFTP, direct file uploads, or URL uploads dramatically extend the default range of supported file sources. Even Google Sheets Magento 2 import and export processes are possible.
It is also worth mentioning that the Improved Import & Export extension supports API connections. The module links your e-commerce website directly to external services. For further information, click on the following links: