Page 1 of 1

creating the import Excel file programatically

Posted: Mon Feb 06, 2012 11:07 pm
by ce_opencrt
hey all,

i have a quick question about the format of the xls file that opencart v1.5.1.3 uses.
i exported/dl the xls file from the sample data; under the "Categories" tab, the last element on the first row is named "status enabled", but the name appears on 2 lines - as if there is a "\n" or a linebreak.

i cannot replicate it directly in excel, although that does not bother me; however, i need to write to an xls file from a php script, so that i can import the data, and i do not know what the field should be called. i have not seen anything like this before.

there are some other columns in the xls file that exhibit the same behavior:

under the products tab:
requires shipping
length unit
status enabled

under the options tab:
price, points and weight prefix

i am setting the column value using PHPExcel like this:
$sheetProducts->setCellValue('A1', 'product_id');

i just don't know what to put for column value for the aforementioned columns.

any ideas?

Re: creating the import Excel file programatically

Posted: Fri Feb 10, 2012 1:46 am
by ce_opencrt
bump

Re: creating the import Excel file programatically

Posted: Fri Feb 10, 2012 3:21 am
by ce_opencrt
i figured it out - here's the file in question:
/admin/model/tool/export.php

it has several functions for validating the spreadsheet - validateCategories, validateProducts, etc

thus, status enabled is listed as "status\nenabled"

enjoy