How to import products with multiple descriptions into magento

How to import products with multiple descriptions into magento

September 7, 2026 · Illustrated author avatarBy Stefan Bogdanescu
How to import products with multiple descriptions into magento

Multilingual Product Import for Magento

Importing products into your Magento store can be straightforward using PHP scripts, as demonstrated by the provided example. However, when dealing with multilingual stores, you need to ensure that each product’s details are correctly assigned based on the active store. Let’s break down how to handle multiple descriptions and other store-specific attributes during the import process.

Understanding Magento’s Store Configuration

Before diving into the code modifications, let’s clarify some key concepts:

  1. Store Views: These represent the language/currency combinations in your Magento instance.
  2. Store Configurations: Each store view has its own configuration for categories, products, and other settings.
  3. Attribute Sets: Attributes are grouped into sets to define which attributes are available for specific product types.

Modifying the Import Script

The existing script is a good starting point, but it only handles a single description and general product details. To support multiple descriptions and store-specific data, we need to make several adjustments:

1. Load the Product Based on Store View

Currently, the script loads the product based on the SKU without considering the store view. To fix this, we should load the product using the loadByAttribute method with an additional parameter for the store ID.

$product = Mage::getModel('catalog/product')
    ->loadByAttribute('sku', $_product['sku'], $storeId);

2. Set Store-Specific Product Data

For each attribute that varies by store (like title, url key, description), we need to set the data using the correct store ID.

// Assuming $_product['title_fr'] and $_product['description_fr'] are the French versions
$product->setStoreId($storeId)
    ->setData('name', $_product['title_' . $locale])
    ->setData('short_description', $_product['short_description_' . $locale])
    ->setData('description', $_product['description_' . $locale]);

3. Assign Store-Specific Category IDs

To assign different categories per store, you can use the getCategoryIds and addCategoryId methods with the appropriate $storeId.

$categoryIds = $_product['category_ids_' . $locale];
foreach ($categoryIds as $categoryId) {
    $product->addCategory($categoryId, false);
}

4. Save the Product for Each Store View

Since you have multiple store views, you’ll need to save the product for each view individually.

try {
    foreach (Mage::app()->getStores() as $_store) {
        $product->setStoreId($_store->getId())
            ->save();
    }
} catch (Exception $e) {
    echo $e->getMessage();
}

Best Practices for Multilingual Product Import

  1. Use a CSV File with Column Prefixes: Organize your import data using column prefixes that correspond to the store view locale (e.g., title_en, description_fr).
  2. Validate Data Before Inserting: Always validate and sanitize your product data before saving it to prevent database issues or security vulnerabilities.
  3. Monitor Log Files: Keep an eye on your Magento log files for any errors or warnings during the import process.

Conclusion

Handling multilingual products in Magento requires a more nuanced approach than a single-language import script. By modifying the provided code and following the best practices outlined above, you can successfully import products with multiple descriptions and other store-specific attributes.

Remember to test your scripts thoroughly before running them on a live production environment. Happy coding!

For more advanced Magento development techniques and resources, check out Laravel Company’s Magento blog.

Catalog Configuration Pricing Import/Export

Our network