Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Best Way to Load Product Data Directly into the Database
 
koopkoop2
Member
 
Total Posts:  38
Joined:  2009-02-04
 

The slow speed and limited selection of importable columns has driven me to write an import script to suit the CSV file I’m trying to import (CSV has tier pricing, configurable products, customization text).

My first idea was to inject the product information directly into the database. However, after looking at the database diagram and some experimentation, it appears that this would require a massive amount of variables to be written to be many different tables. This high number of variables isn’t obvious from the back office pages because they’re tagged on behind the scenes after a product is saved. Tracing the dependincies and ensuring you don’t corrupt the database by failing to inject one value is a huge task.

Therefore, I was hoping to go one level above direct database injection and try to manipulate the functions employed on the “create product page”. I was hoping to setup all the necessary variables for the function that’s called when the “Save” button is pushed and then call the “Save” function. on the product page and then Going this way would be safer because Magento would be responsible for generating all of its necesary administration data which accompanies all the user generated data.

First of all though, does anyone know which file these functions are stored in? After that, how do I setup my personal php script so that I can access these Magento functions?

 
Magento Community Magento Community
Magento Community
Magento Community
 
cbsteven
Member
 
Total Posts:  73
Joined:  2008-07-25
 

How about just using the API provided by Magento for product insertion?
http://www.magentocommerce.com/wiki/doc/webservices-api/api#product_api

 
Magento Community Magento Community
Magento Community
Magento Community
 
koopkoop2
Member
 
Total Posts:  38
Joined:  2009-02-04
 

Thank you! This is more than I ever expected. I didn’t even know Magento had this functionality.

I’ve noticed this line of code in the APIs:

$session $client->login('apiUser''apiKey');

Where do I define the User and Key?

 
Magento Community Magento Community
Magento Community
Magento Community
 
cbsteven
Member
 
Total Posts:  73
Joined:  2008-07-25
 

A little searching never hurts. wink I just searched for “api user” in the box and this was the first result:

http://www.magentocommerce.com/boards/viewthread/23208/

 
Magento Community Magento Community
Magento Community
Magento Community
 
koopkoop2
Member
 
Total Posts:  38
Joined:  2009-02-04
 

OK, I think I found it.

System -> WebServices.

One thing I’m not seeing is a property to “Enable” the newly created product though.

 
Magento Community Magento Community
Magento Community
Magento Community
 
darryla
Member
 
Total Posts:  52
Joined:  2008-07-08
 

You may wish to have the code to:

Create Magento Products On-The-Fly

Best of Luck smile

 
Magento Community Magento Community
Magento Community
Magento Community
 
koopkoop2
Member
 
Total Posts:  38
Joined:  2009-02-04
 
darryla - 27 February 2009 11:06 AM

You may wish to have the code to:

Create Magento Products On-The-Fly

Best of Luck smile

Holy!!!

I was already blown away by how easy the api method was, but that last code snippet is just insane.

I’m finally beginning to see Magento as less of a complicated mess and am beginning to appreciate its power.

Thanks!

 
Magento Community Magento Community
Magento Community
Magento Community
 
darryla
Member
 
Total Posts:  52
Joined:  2008-07-08
 
koopkoop2 - 27 February 2009 11:12 AM

darryla - 27 February 2009 11:06 AM
You may wish to have the code to:

Create Magento Products On-The-Fly

Best of Luck smile

Holy!!!

I was already blown away by how easy the api method was, but that last code snippet is just insane.

I’m finally beginning to see Magento as less of a complicated mess and am beginning to appreciate its power.

Thanks!

Really glad it was of some help to you! smile

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top