Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6892569
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T06:33:05+00:00 2026-05-27T06:33:05+00:00

I am importing products from a 3rd party database into my magento site. I

  • 0

I am importing products from a 3rd party database into my magento site. I have found a great tutorial online for doing this in PHP.

However, the tutorial does not describe how to assign multiple descriptions to a single product based on the store.

In my example I have a product that has both an english and french description. One for my French store and one for the english, how can I import both into magento.

I also need to do this for the title, urlkey and have different categories assigned per store.

Here is the code given on the tutorial.

<?php
require_once('/path/to/magento/app/Mage.php');
umask(0);

// Set an Admin Session
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
Mage::getSingleton('core/session', array('name'=>'adminhtml'));
$userModel = Mage::getModel('admin/user');
$userModel->setUserId(1);
$session = Mage::getSingleton('admin/session');
$session->setUser($userModel);
$session->setAcl(Mage::getResourceModel('admin/acl')->loadAcl());

// Then we see if the product exists already, by SKU since that is unique to each    product
$product = Mage::getModel('catalog/product')
->loadByAttribute('sku',$_product['sku']);

if(!$product){
// product does not exist so we will be creating a new one.

$product = new Mage_Catalog_Model_Product();

$product->setTypeId('simple');
$product->setWeight(1.0000);
$product->setVisibility(Mage_Catalog_Model_Product_Visibility::VISIBILITY_BOTH);
$product->setStatus(1);
$product->setSku('UNIQUESKUHERE');
$product->setTaxClassId(0);
$product->setWebsiteIDs(array(0)); // your website ids
$product->setStoreIDs(array(0));  // your store ids
$product->setStockData(array(
    'is_in_stock' => 1,
    'qty' => 99999,
    'manage_stock' => 0,
));
}

// set the rest of the product information here that can be set on either new/update
$product->setAttributeSetId(9); // the product attribute set to use
$product->setName('Product Title');
$product->setCategoryIds(array(0,1,2,3)); // array of categories it will relate to
$product->setDescription('Description');
$product->setShortDescription('Short Description');
$product->setPrice(9.99);

// set the product images as such
// $image is a full path to the image. I found it to only work when I put all the images I wanted to import into the {magento_path}/media/catalog/products - I just created my own folder called import and it read from those images on import.
$image = '/path/to/magento/media/catalog/products/import/image.jpg';

$product->setMediaGallery (array('images'=>array (), 'values'=>array ()));
$product->addImageToMediaGallery ($image, array ('image'), false, false);
$product->addImageToMediaGallery ($image, array ('small_image'), false, false);
$product->addImageToMediaGallery ($image, array ('thumbnail'), false, false);

// setting custom attributes. for example for a custom attribute called special_attribute
// special_attribute will be used on all examples below for the various attribute types
$product->setSpecialAttribute('value here');

// setting a Yes/No Attribute
$product->setSpecialField(1);

// setting a Selection Attribute
$product->setSpecialAttribute($idOfAttributeOption); //specify the ID of the attribute   option, eg you creteated an option called Blue in special_attribute it was assigned an ID of some number. Use that number.

// setting a Mutli-Selection Attribute
$data['special_attribute'] = '101 , 102 , 103'; // coma separated string of option IDs. As ID , ID (mind the spaces before and after coma, it worked for me like that)
$product->setData($data);

try{
$product->save();
} catch(Exception $e){
echo $e->getMessage();
//handle your error
}
?>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T06:33:06+00:00Added an answer on May 27, 2026 at 6:33 am

    I eventually chose magmi to do this job.

    Everything is entered into a CSV, if you’re importing old data from another system, you need to create this CSV programmatically.

    An example of what this CSV should look like is here

    To do multiple descriptions for one product, simply copy the row of a product and duplicate it underneath, change the store code field/website field to the code of the site you need a different description for and enter a new description in the description field.

    Now when you upload your CSV with Magmi, you’ll get one product with 2 or more descriptions associated with the relevant store/website.

    Feel free to comment and ask more questions, this was a headache for me and I’d be glad to relieve you of similar frustrations.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am importing a products csv from Magento admin. I want to know which
I'm trying to import a large number of products from a DB into Magento.
I wrote a script for importing products in Magento community edition 1.5.10 from CSV
I'm importing a function from an unmanaged DLL into C#. The C++ function signature
I am importing data from MySQL to PowerPivot. I have all of the relevant
I'm trying to export 18,0000 products from Magento and it gets stuck at the
I've just imported ~800 products into Magento before realising I had store_id set to
I want to write an import function for importing data from a website into
I have imported 100 products in Magento without an image via xml file. (I
When importing a CSV into Magento with the MAGMI importing tool, I am unable

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.