Page 1 of 1
import-export module
Posted: Mon Feb 01, 2010 7:14 pm
by mmurph
hello, i'm new on Opencart, I've installed the import/export module, great work, greetings to the developer, what I'm asking is this:
I'm making a little change to the site, introducing the internal notes: on product side, the store admin can write on each product spwecial notes for internal use, visible only to operators, and not on the public side (text notes such "handle with care", "order this article to that store" etc.)
to do this I've introduced in database a new item in product's table called "intnotes".
Now, how can I add this item to the excel file so to mass import/export intnotes value?
Re: import-export module
Posted: Mon Feb 01, 2010 7:25 pm
by JNeuhoff
You can either do it yourself, by editing file admin/model/tool/export.php, in the appropriate functions, such as populateProductsWorksheet (for export) and validateProducts, uploadProducts, storeProductsIntoDatabase (for import).
Or you can send me a PM with the details of your additional DB fields, and I can do it for a charge, usually shouldn't take me more than 1 or 2 working hours.
Re: import-export module
Posted: Fri Jan 07, 2011 6:47 pm
by deeve
Hi,
I'm in a similar situation where I need to include an extra field I created in the 'product' Table called 'vat_exempt' which has the same db values as the 'status' field.
I'm going to have a go at doing this myself & thought to simply replicate all current references/values to '$status' in the functions you mention but have one big question: I've noticed all existing fields have a corresponding number set against them but that these vary between each function. Is there a set schema for these & if so, what number would you assign to this new field?
Thanks.
Re: import-export module
Posted: Wed Jan 12, 2011 4:55 pm
by deeve
deeve wrote:Hi,
I'm in a similar situation where I need to include an extra field I created in the 'product' Table called 'vat_exempt' which has the same db values as the 'status' field.
I'm going to have a go at doing this myself & thought to simply replicate all current references/values to '$status' in the functions you mention but have one big question: I've noticed all existing fields have a corresponding number set against them but that these vary between each function. Is there a set schema for these & if so, what number would you assign to this new field?
Thanks.
Hi JNeuhoff,
apologies to bother but wondered if you may have time to answer this.. ?
many thanks,
deeve.
Re: import-export module
Posted: Wed Jan 12, 2011 5:39 pm
by JNeuhoff
Just use the next available index number. The Export/Import tool uses cached memory arrays such a $products during execution, where the fields are accessed as $products[0], $products[1], ... $products[n].
Re: import-export module
Posted: Wed Jan 12, 2011 6:20 pm
by deeve
That's precisely where I come unstuck though, as not being familiar with your naming convention I was getting confused as to why certain variables where given a certain number in one function & then a different one in another. Is it simply enough to find an unused number in each & not have them correspond to each other or are there certain numbers which are crucial to the script's success?
To you I'm sure this all sounds like me waffling on, but am only attempting to understand you clearly & not bother you excessively

Re: import-export module
Posted: Wed Jan 12, 2011 8:43 pm
by deeve
I've attached a txt version of my attempt as was over the allowed limit to post - if you should have time to look it over I'd be very grateful. As my new field 'vat_exempt' shares the same table properties as 'status' I simply replictaed all references to that. It appears in lines: 261, 262, 280, 287, 389, 426, 1012, 1266, 1303, 1342 & 1392.
My main question would be of line 389 where I used the next available free number of [33] in the function productUpload. All sequential numbers were alloctaed so I used 33. Should this be ok or do I have to bump all after 22?
Many thanks again for your time in looking @this.
Re: import-export module
Posted: Sat Jan 15, 2011 5:09 am
by deeve
Urgent help required please!
I was hoping someone would have had the opportunity to look over my updated code which I'd attached to my last post. I managed to download the data correctly - however, I just tried to import the spreadsheet & it has wiped ALL of my products from a live site! The categories are in tact but all reference to products have now dissapeared
I would be eternally grateful if anyone on here could spare the time to look my attachment over & point out the error of my attempt. I do thankfully have the downloaded data but would need for it to update the db correctly. Interestingly I didn't receive any errors on the last import.
Re: import-export module
Posted: Sat Jan 15, 2011 6:52 am
by deeve
Problem over!
I went back over my file & realised I'd allocated the wrong order number to my extra field. Phew!
