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

  • Home
  • SEARCH
  • 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 3934142
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T23:40:54+00:00 2026-05-19T23:40:54+00:00

Im making a module to import products from another system, but I cant find

  • 0

Im making a module to import products from another system, but I cant find a way to actually save the product. This is what i have tried:

$new_product    = Mage::getModel('catalog/product');

$productInfoData['sku'] = 'mySKU';
$productInfoData['price'] = '10';
$productInfoData['name'] = 'The name';
$productInfoData['status'] = 1;

// then set product's general info to update
$new_product->setData($productInfoData);

// call save() method to save your product with updated data
$new_product->save();

But this does not seem to work 🙁

Could anybody help me on the right track?

BR/Sune

  • 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-19T23:40:55+00:00Added an answer on May 19, 2026 at 11:40 pm

    I found a solution:

                        $new_product    = Mage::getModel('catalog/product');
    
                    $new_product->setWebsiteIds(array(1));
                    $new_product->setSku('lu-'.$product['sku']);
                    $new_product->setPrice((($product['price'])*$e_rate));
                    $new_product->setCategoryIds(array(1152));
                    $new_product->setAttributeSetId(4); 
                    $new_product->setVisibility(1);             
                    $new_product->setType('Simple Product');
                    $new_product->setName($product['name']);
                    $new_product->setDescription('');
                    $new_product->setShortDescription('');
                    $new_product->setStatus(2); 
                    $new_product->setTaxClassId(2);
                    $new_product->setWeight(0);             
                    $new_product->setCreatedAt(strtotime('now'));                   
    
    
                    // call save() method to save your product with updated data
                    $new_product->save();
    

    where $product is an array with new product information.

    This works just perfect!

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

Sidebar

Related Questions

I'm making somewhat of a module that gets included into another unrelated PHP application.
I'm thinking about making a networked game. I'm a little new to this, and
I have a problem compiling Haskell programs, that import the Text.Regex.Posix module. I have
im making some script with mechanize.browser module. one of problem is all other thing
Is there a neat way of making a case or switch statement in Perl
i'm trying making a com dll in python. but i try register to compiled
Currently I am making a new module and I was wondering how could I
Long time lurker, first time poster. I'm making a ServerConnection module to make it
I am making a sequence of Ajax calls using the Ext.Direct module. I want
I'm making a shell script with the optparse module, jut for fun, so I

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.