Post by JNeuhoff » Sun Mar 15, 2009 7:09 am

The Import/Export is a new administrative feature which allows the admin user to do a bulk export
of all the categories, products, and product options to an Excel spreadsheet file.
The spreadsheet file can be edited offline and then be re-imported to the OpenCart database.

This module also provides some minor changes to the existing Backup/Restore module:
  • - The control panel contains a brief description of the module
    - The buttons labelled 'Export' and 'Import' are now renamed to 'Backup' and 'Restore'
    - The arrow-up and arrow-down images for the buttons have been swapped
Also, though not yet ported to Opencart 1.1.x, this Export/Import module already has built-in support for the following optional modules and/or extensions to the database:
  • - category descriptions
    - Featured/Special Offer/Latest Products
    - min_qty
    - option weight factor
We just need someone to port these features from Opencart 0.7.9 to 1.1.x, and they will automatically show up in the exported spreadsheet file!
Last edited by i2Paq on Tue Jan 11, 2011 3:55 am, edited 1 time in total.
Reason: Topic moved

Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig


User avatar
Guru Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by JNeuhoff » Mon Mar 16, 2009 8:45 pm

The newly released Export/Import module will only work for Opencart 1.1.8, not for 1.1.9, because it seems Daniel has done some changes to the database as regards the way images are handled.

Hope to have a new release of the module ready soon.

User avatar
Guru Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


User avatar
Guru Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by Nahuel » Wed Mar 18, 2009 4:41 am

Thanks JNeuhoff! This is a great module

New member

Posts

Joined
Fri Mar 13, 2009 9:35 am

Post by JNeuhoff » Fri Mar 20, 2009 2:16 am

Just to let you know that the Export/Import module works fine with both Opencart 1.1.9 or the new 1.2.0.

User avatar
Guru Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by sulix » Mon Mar 23, 2009 9:53 pm

Hello JNeuhoff,
first thank you for posting the import/export plugin. It's surely nice feature, but I have problem with it. I am using Opencart 1.2, I installed the plugin, allowed it in User group. I can see under Admin/Configuaration/Export/Import link but when I press Export button I got 500 error. What could be the problem?
Whole shop works just fine.

Thank you,

Sulix

Newbie

Posts

Joined
Mon Dec 01, 2008 8:37 pm

Post by mlrazzano » Tue Mar 24, 2009 7:48 am

Thanks for the excellent contribution. I gave this a try in a clean 1.2.3 install, and kept getting blank (zero bytes) xml files on export. I peeked at the error log and noticed this:

[Mon Mar 23 16:23:18 2009] [error] [client 208.106.45.45] PHP Warning: tempnam() [<a href='function.tempnam'>function.tempnam</a>]: open_basedir restriction in effect. File() is not within the allowed path(s): (/home:/var/www:/var/log/httpd/sites:/usr/share/pear:/tmp) in /var/www/sites/www.mysitedomain.com/shop/admin/OLE/PPS/File.php on line 87

It seems like tempnam() was failing to create a temporary file within the Excel-exporting library when it was just a null string (""), so I hardcoded a writable directory into admin/Spreadsheet/Excel/Writer/Workbook.php as a temporary hack. There's probably a better place to set it, but this seems to have fixed the problem for me. Hopefully it helps someone or a better fix can be implemented in the release. This may be related to Sulix's issue if mod_sec or another security module arbitrated it instead, and threw a 500 error.... wild guess though.

(since it might be a php/os issue, I'm using PHP 5.2.6 on Fedora Core 4 - 2.6.17)

Newbie

Posts

Joined
Tue Mar 24, 2009 6:36 am

Post by JNeuhoff » Tue Mar 24, 2009 6:55 pm

It normally uses a temporay file with a name of something like this: '/tmp/OLE_PPS_FileXXXXXX'. That means, your PHP script running under your user account must have write and read access to the '/tmp' directory. If you can't solve it, you may try this in the export.php file, in function download:

...........
// Creating a workbook
$workbook = new Spreadsheet_Excel_Writer();
$workbook->setTempDir(getcwd().'/../cache');
$workbook->setVersion(8); // Use Excel97/2000 Format
..........


This would result in the usage of Opencart's cache directory as the temporary directory for the export. The cache directory should have the necessary write and read permissions.

Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig


User avatar
Guru Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by reefnut » Wed Mar 25, 2009 3:53 am

That was exactly what my problem was with 1.2.4 I added that line to model/tool/backup.php and all is well now

TY for the fix

New member

Posts

Joined
Mon Feb 16, 2009 1:21 am

Post by sulix » Wed Mar 25, 2009 4:16 am

Thanks for your help JNeuhoff,

I inserted this piece of code to model/tool/export.php file and set up cache directory with read and write permission
...........
// Creating a workbook
$workbook = new Spreadsheet_Excel_Writer();
$workbook->setTempDir(getcwd().'/../cache');
$workbook->setVersion(8); // Use Excel97/2000 Format
..........
Now, small progress! After the pressing Export button it generates in cache directory some files:
Generating took very long (about two minutes)
cache.manufacturer.1237926586
cache.product.latest.1.8.1237926590
cache.product.latest.6.8.1237926586
cache.product.popular.1.5.1237926590
cache.product.popular.6.5.1237926586

but in frontend nothing happens. Still blanc page and error 500

Newbie

Posts

Joined
Mon Dec 01, 2008 8:37 pm

Post by sakathecheetah » Wed Mar 25, 2009 5:32 am

Sulix, you'll probably have to at least check your apache error log and look for telltale php errors/warnings. If you're not sure where it is, ask your host. The problem will usually be pretty obvious from the logs, but if you think it's an incompatibility, then post it here. It might be that php reached its max_execution_time since you said it took a very long time, but it could be many things.

btw, I am mlrazzano from above... forgot that I had registered back in 0.7.x. I will try to contribute more from now on. ;)

New member

Posts

Joined
Wed Jul 02, 2008 8:50 am

Post by reefnut » Wed Mar 25, 2009 9:47 am

I downloaded my spreadsheet then I deleted all categories and products then I tried to reupload it and I got this error:

Uploaded file is not a valid spreadsheet file or its values are not in the expected formats!

However the categories did go back just no products.

Anyone have any clue why this would happen. It is exactly the samr information I downloaded.

New member

Posts

Joined
Mon Feb 16, 2009 1:21 am

Post by JNeuhoff » Wed Mar 25, 2009 7:07 pm

I downloaded my spreadsheet then I deleted all categories and products then I tried to reupload it and I got this error:

Uploaded file is not a valid spreadsheet file or its values are not in the expected formats!

However the categories did go back just no products.
E-mail me a copy of your spreadsheet file, and I take a look at it. You may have corrupted the 'Products' worksheet somehow, especially the headers in the top row!

User avatar
Guru Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by JNeuhoff » Wed Mar 25, 2009 7:10 pm

but in frontend nothing happens. Still blanc page and error 500
Sulix, examine your error log, that will give you a clue of what might have gone wrong. How many products does your online store contain?

User avatar
Guru Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by reefnut » Thu Mar 26, 2009 1:42 am

I am not exactly sure what the problem was it was saying something about different products so I deleted those products 1 by 1 and after about 20 of them it worked fine. I am assuming those products had something wrong with them.

Would like to Thank you though for offering to help it is much appreciated.

New member

Posts

Joined
Mon Feb 16, 2009 1:21 am

Post by sulix » Thu Mar 26, 2009 4:09 am

JNeuhoff, I am solving logging error with my webhosting provider, but shop contains only defaut items.
Thanks anyway.
Sulix

Newbie

Posts

Joined
Mon Dec 01, 2008 8:37 pm

Post by sulix » Thu Mar 26, 2009 6:26 pm

JNeuhoff, I got following error:


Warning: require_once(PEAR.php) [function.require-once]: failed to open stream: No such file or directory in /home/ftpsite/hodinkyplus.cz/www/admin/Spreadsheet/Excel/Writer.php on line 35

Fatal error: require_once() [function.require]: Failed opening required 'PEAR.php' (include_path='.:/usr/share/php:/usr/share/pear') in /home/ftpsite/hodinkyplus.cz/www/admin/Spreadsheet/Excel/Writer.php on line 35

but seems to be PEAR function installed on the server: http://hodinkyplus/phpinfo.php

What is wrong?

Thanks
Sulix

Newbie

Posts

Joined
Mon Dec 01, 2008 8:37 pm

Post by JNeuhoff » Thu Mar 26, 2009 8:40 pm

Sulix, there are either access permission issues (not allowed to access /usr/share/pear/PEAR.php), or the PEAR.php is genuinely not there. The error log should give some further clues. If you can't solve these issues you might consider using a different webhost, such as HostGator.

Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig


User avatar
Guru Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by reefnut » Thu Mar 26, 2009 10:45 pm

OK I have everything working great but I think I have found a bug. It seems that when you upload your spreadsheet all your product model numbers are also added to the manufacturer list.

Is this a bug or am I doing something wrong? using version 1.2.4

New member

Posts

Joined
Mon Feb 16, 2009 1:21 am

Post by sulix » Thu Mar 26, 2009 11:34 pm

JNeuhoff,
thanks a lot for your effort. As you said problem was in missing PEAR function. I install it and now it WORKS ;D
and I was able to download my first xls sheet.

Now it's time to import something. I am very curious :)

Sulix,

Newbie

Posts

Joined
Mon Dec 01, 2008 8:37 pm
Who is online

Users browsing this forum: No registered users and 39 guests