Jump to content

Where is the Product Class called by the AdminImportController defined?


sgray
 Share

Recommended Posts

Does anyone know where the Product class called by the AdminImportController is defined? There are numerous values referenced in the AdminImportController from "$product = new Product()", so I'm trying to find out where (what file) is Product() defined.

 

Thanks :)

Edited by sgray (see edit history)

Share this post


Link to post
Share on other sites

Hi,

 

$product = new Product() is used to instanciate a new product that will be saved in database. The script adds the required information from your import file to the created object $product->name = '....', $product->reference= '.....', ....then the product is added in database. You can have a look of Product.php in classes/ folder

Share this post


Link to post
Share on other sites

Hi,

 

$product = new Product() is used to instanciate a new product that will be saved in database. The script adds the required information from your import file to the created object $product->name = '....', $product->reference= '.....', ....then the product is added in database. You can have a look of Product.php in classes/ folder

 

Thanks for your reply :)

 

I was tinkering with the Product.php file for a few hours yesterday to understand whether or not it impacted CSV imports.

 

In regard to "$product = new Product()", I wasn't sure if there was a defined way the name=value pairs are loaded into the $product object. Essentially, what I would like to accomplish is for the AdminImportController to recognize an additional field (column) in the CSV file and load the values of each record into the $product object to pass it on to the whatever code is responsible for INSERT into the database (which I'll worry about after I can get the values loaded into the $product object).

 

I'm aware that there are multiple importer modules available that would give me the capability of doing this without coding, but instead of buying my way out of this limitation, I'd prefer to solve it :-)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More