sgray Posted January 4, 2015 Share Posted January 4, 2015 (edited) 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 January 4, 2015 by sgray (see edit history) Link to comment Share on other sites More sharing options...
fred-vinapresta Posted January 5, 2015 Share Posted January 5, 2015 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 Link to comment Share on other sites More sharing options...
vekia Posted January 5, 2015 Share Posted January 5, 2015 product class is located in /classes/product.php Link to comment Share on other sites More sharing options...
sgray Posted January 5, 2015 Author Share Posted January 5, 2015 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 :-) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now