Import Stock via CSV – How to Update Stock Using CSV Files

csvimportstock

CSV with data
How can I update stocks in Dataflow – Profiles?

I have created a csv with the data (see image):

When trying to import it via "Import Product Stocks" then an error shows:

Skip import row, is not valid value "" for field "type"

Any idea what the problem might be?

Best Answer

This is a standard error that Magento returns when there is no product with some of the SKUs. If there are 3 SKUs that don't exist in your store - you have to see 3 times this error. Please check each of the SKUs in your CSV file if they actually exist in your store.

You can see app/code/core/Mage/Catalog/Model/Convert/Adapter/Product.php -> public function saveRow:

$productId = $product->getIdBySku($importData['sku']);

if ($productId) {
    $product->load($productId);
} else {
    $productTypes = $this->getProductTypes();
    $productAttributeSets = $this->getProductAttributeSets();

    /**
     * Check product define type
     */
    if (empty($importData['type']) || !isset($productTypes[strtolower($importData['type'])])) {
        $value = isset($importData['type']) ? $importData['type'] : '';
        $message = Mage::helper('catalog')->__('Skip import row, is not valid value "%s" for field "%s"', $value, 'type');
        Mage::throwException($message);
    }

If Magento can't get the product ID by SKU - it checks for column type, but your CSV hasn't such column, that's why it throws an error.