Page 5 of 11

Re: [UPDATED] Export/Import tool for OpenCart 1.4.9

Posted: Thu Apr 14, 2011 8:15 pm
by JNeuhoff
SupraTwinTurbo wrote:Hi JNeuhoff,

Thanks for your awesome module. I installed and exported my store. Then, I added 2 more products, but when I imported the new XLS file, the product tags for all the products disappear. I double checked the file and the product tag column looks fine to me; it just does not seem to be working. I PMed you the XLS file I used to upload, I hope you can take a look for me.

Thank you,

SupraTT
Thank you for your feedback. I can confirm that the tags are indeed not imported to the DB, will fix this bug.

P.S. I have now fixed it, try the latest version for 1.4.9.x from http://www.mhccorp.com/opencart/export-import-tool

Re: [UPDATED] Export/Import tool for OpenCart 1.4.9

Posted: Fri Apr 15, 2011 7:31 am
by daledude
I've made some slight modifications to the Export/Import tool, primarily because I wanted to add in five extra fields. I've done that successfully, and I can edit the fields in the Product area in the backend, and when I export the spreadsheet it contains my additional fields and their data. But when I re-upload the spreadsheet, I get this error:

Code: Select all

Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''felina',0,'data/felina-parchment-500x500.jpg',1,0,'2011-04-05 20:46:41','2011-0' at line 1
Error No: 1064
INSERT INTO `product` (`product_id`,`quantity`,`sku`,`location`,`stock_status_id`,`model`,`manufacturer_id`,`image`,`shipping`,`price`,`date_added`,`date_modified`,`date_available`,`weight`,`weight_class_id`,`status`,`tax_class_id`,`viewed`,`length`,`width`,`height`,`length_class_id`,`cleaning_code`,`repeat_dir`,`xroll_dir`,`fabric_dir`,`roll_width`,`sort_order`,`subtract`,`minimum`,`cost`) VALUES (1,0,'','',,'felina',0,'data/felina-parchment-500x500.jpg',1,0,'2011-04-05 20:46:41','2011-04-05 20:46:41','2011-04-05',0,5,1,0,0,0,0,0,'3',0,0,0,0,0,'0','0','0',2,3);
The additional fields I added are cleaning_code, repeat_dir, xroll_dir, fabric_dir, and roll_width.

Is there anyone that can take a look and tell me what I'm missing? I'm assuming it's a comma or apostrophe or something that is either missing or not where it's supposed to be. I've attached my entire /admin/model/tool/export.php.

Thanks!

Re: [UPDATED] Export/Import tool for OpenCart 1.4.9

Posted: Fri Apr 15, 2011 4:00 pm
by SupraTwinTurbo
JNeuhoff wrote: Thank you for your feedback. I can confirm that the tags are indeed not imported to the DB, will fix this bug.

P.S. I have now fixed it, try the latest version for 1.4.9.x from http://www.mhccorp.com/opencart/export-import-tool
You are welcome JNeuhoff. I just tested the new version and it works now. Thank you!

Re: [UPDATED] Export/Import tool for OpenCart 1.4.9

Posted: Fri Apr 15, 2011 5:03 pm
by JNeuhoff
The additional fields I added are cleaning_code, repeat_dir, xroll_dir, fabric_dir, and roll_width.

Is there anyone that can take a look and tell me what I'm missing? I'm assuming it's a comma or apostrophe or something that is either missing or not where it's supposed to be. I've attached my entire /admin/model/tool/export.php.
In method uploadProducts you need to make sure to access the cells using the correct column indexes:

Code: Select all

			.....
			$productId = trim($this->getCell($data,$i,1));
			if ($productId=="") {
				continue;
			}
			$name = $this->getCell($data,$i,2);
			$name = htmlentities( $name, ENT_QUOTES, $this->detect_encoding($name) );
			$categories = $this->getCell($data,$i,3);
			$sku = $this->getCell($data,$i,4,'0');
			$location = $this->getCell($data,$i,5,'0');
			$quantity = $this->getCell($data,$i,6,'0');
			$model = $this->getCell($data,$i,7,'   ');
			$manufacturer = $this->getCell($data,$i,8);
			$imageName = $this->getCell($data,$i,9);
			$shipping = $this->getCell($data,$i,10,'yes');
			$price = $this->getCell($data,$i,11,'0.00');
			$dateAdded = $this->getCell($data,$i,12);
			$dateAdded = ((is_string($dateAdded)) && (strlen($dateAdded)>0)) ? $dateAdded : "NOW()";
			$dateModified = $this->getCell($data,$i,13);
			$dateModified = ((is_string($dateModified)) && (strlen($dateModified)>0)) ? $dateModified : "NOW()";
			$dateAvailable = $this->getCell($data,$i,14);
			$dateAvailable = ((is_string($dateAvailable)) && (strlen($dateAvailable)>0)) ? $dateAvailable : "NOW()";
			$weight = $this->getCell($data,$i,15,'0');
			$unit = $this->getCell($data,$i,16,$defaultWeightUnit);
			$length = $this->getCell($data,$i,17,'0');
			$width = $this->getCell($data,$i,18,'0');
			$height = $this->getCell($data,$i,19,'0');
			$measurementUnit = $this->getCell($data,$i,20,$defaultMeasurementUnit);
			$cleaning_code = $this->getCell($data,$i,21);
			$repeat_dir = $this->getCell($data,$i,22,'0');
			$xroll_dir = $this->getCell($data,$i,23,'0');
			$fabric_dir = $this->getCell($data,$i,24,'0');
			$roll_width = $this->getCell($data,$i,25,'0');
			$status = $this->getCell($data,$i,26,'true');
			$taxClassId = $this->getCell($data,$i,27,'0');
			$viewed = $this->getCell($data,$i,28,'0');
			$langId = $this->getCell($data,$i,29,'1');
			if ($langId!=$languageId) {
				continue;
			}
			$keyword = $this->getCell($data,$i,30);
			$description = $this->getCell($data,$i,31);
			$description = htmlentities( $description, ENT_QUOTES, $this->detect_encoding($description) );
			$meta_description = $this->getCell($data,$i,32);
			$meta_description = htmlentities( $meta_description, ENT_QUOTES, $this->detect_encoding($meta_description) );
			$meta_keywords = $this->getCell($data,$i,33);
			$meta_keywords = htmlentities( $meta_keywords, ENT_QUOTES, $this->detect_encoding($meta_keywords) );
			$additionalImageNames = $this->getCell($data,$i,34);
			$stockStatusId = $this->getCell($data,$i,35,$defaultStockStatusId);
			$storeIds = $this->getCell($data,$i,36);
			$related = $this->getCell($data,$i,37);
			$tags = $this->getCell($data,$i,38);
			$sort_order = $this->getCell($data,$i,39,'0');
			$subtract = $this->getCell($data,$i,40,'true');
			$minimum = $this->getCell($data,$i,41,'1');
			$cost = $this->getCell($data,$i,42,'0.00');
			......

Re: [UPDATED] Export/Import tool for OpenCart 1.4.9

Posted: Fri Apr 15, 2011 11:08 pm
by daledude
JNeuhoff wrote:
In method uploadProducts you need to make sure to access the cells using the correct column indexes
Hahahaha WOW how did I miss that... Repeating numbers definitely won't work.

I made that change, and now the error is:

Code: Select all

Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '0,0,0,0,'1','1','1',0)' at line 1
Error No: 1064
INSERT INTO `product` (`product_id`,`quantity`,`sku`,`location`,`stock_status_id`,`model`,`manufacturer_id`,`image`,`shipping`,`price`,`date_added`,`date_modified`,`date_available`,`weight`,`weight_class_id`,`status`,`tax_class_id`,`viewed`,`length`,`width`,`height`,`length_class_id`,`cleaning_code`,`repeat_dir`,`xroll_dir`,`fabric_dir`,`roll_width`,`sort_order`,`subtract`,`minimum`,`cost`) VALUES (1,0,'','',5,'felina',0,'data/felina-parchment-500x500.jpg',1,0,'2011-04-05 20:46:41','2011-04-05 20:46:41','2011-04-05',0,5,1,0,0,0,0,0,'3',,0,0,0,0,'1','1','1',0);
I'm not very knowledgeable in MySQL... but I know I'm so close... Here is a screenshot of the products table if that helps...?
http://img810.imageshack.us/i/products.png/

I thought it may be because I have a '0' after each of the new fields, like:

Code: Select all

$repeat_dir = $this->getCell($data,$i,22,'0');
Which I assume corresponds to a default value, even though in the img above there is no default value in the table, but I deleted the , '0's out and it gave the same error but with just commas instead of 0,...

Code: Select all

Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ',,,,'1','1','1',0)' at line 1
Can't quite wrap my head around what's wrong!

Re: [UPDATED] Export/Import tool for OpenCart 1.4.9

Posted: Sat Apr 16, 2011 5:27 am
by JNeuhoff
Looks like your 2nd product doesn't have values in the spreadsheet for the new fields. If you want to make them optional then you must ensure that the Import uses appropriate default values in the getCell calls, e.g.

$cleaning_code = $this->getCell($data,$i,21,0);

instead of

$cleaning_code = $this->getCell($data,$i,21);

I assume your cleaning_code is a numeric value.

Re: [UPDATED] Export/Import tool for OpenCart 1.4.9

Posted: Sat Apr 16, 2011 6:58 am
by daledude
JNeuhoff wrote:Looks like your 2nd product doesn't have values in the spreadsheet for the new fields. If you want to make them optional then you must ensure that the Import uses appropriate default values in the getCell calls, e.g.

$cleaning_code = $this->getCell($data,$i,21,0);

instead of

$cleaning_code = $this->getCell($data,$i,21);

I assume your cleaning_code is a numeric value.
Ahh, I see. Adding the zero in allowed me to type 12345 into cleaning_code and it uploaded successfully! Thanks!

I haven't tried the others yet, but they would have letter-based or alphanumeric values. I haven't got to test it but I assume I have to use one of the ones that has htmlentities as a base for that... either that or the one for model with ' ' as the value.

Re: [UPDATED] Export/Import tool for OpenCart 1.4.9

Posted: Thu Apr 21, 2011 11:33 pm
by daledude
daledude wrote:Ahh, I see. Adding the zero in allowed me to type 12345 into cleaning_code and it uploaded successfully! Thanks!

I haven't tried the others yet, but they would have letter-based or alphanumeric values. I haven't got to test it but I assume I have to use one of the ones that has htmlentities as a base for that... either that or the one for model with ' ' as the value.
Just for reference, anybody else who may try this, using

Code: Select all

$database->escape($product[# here]);
in the foreach ($products as $product) area fixed everything for the custom columns I made with the SQL errors. Everything works wonderfully. Thanks for the great tool and the help, JNeuhoff. 8)

Re: [UPDATED] Export/Import tool for OpenCart 1.4.9

Posted: Sat Apr 23, 2011 2:53 am
by renegade
Hi, JNeuhoff!

First of all, thanks for putting this tool together. I followed the installation instructions and got it to work properly in the English language, and that was great. My only problem now is that I would like to leave the website with a Portuguese-only front-end. I deleted everything from the website and database and started over, this time inserting your modifications and files in portuguese-related directories (when applicable), among other ideas, but unfortunately I could never make the "tool/export" appear to my Top Administrator.

So my question is: Is there a quick way to make it work in a website in Portuguese only? Should I have deleted the English language altogether before installing the app? (I left is disabled when I tried to install in Portuguese).

Thank you bunches for your help and advice, and congratulations on this most invaluable extension. I plan on making money with the online store, so I promise to donate as soon as I get the ball rolling!

Best regards from Brazil,

Renegade

Re: [UPDATED] Export/Import tool for OpenCart 1.4.9

Posted: Sat Apr 23, 2011 6:43 am
by JNeuhoff
It uses the language set in yourAdmin backend at

System > Settings > Local > Language

which I understand it to be the frontend language.

Re: [UPDATED] Export/Import tool for OpenCart 1.4.9

Posted: Mon Apr 25, 2011 2:48 am
by raoulpop
I'd really appreciate some usage instructions for this plugin. I've installed it according to your instructions (vQMod is pre-installed), and I see no Import or Export option anywhere in the Admin pages. (Yes, I've enabled it on the user group page.) I don't know where else to look. Please help.

Re: [UPDATED] Export/Import tool for OpenCart 1.4.9

Posted: Mon Apr 25, 2011 5:42 am
by Rbq
Hi.
I'm new here, so hello all. I have problem with export, error.

Fatal error: require_once() [function.require]: Failed opening required 'Spreadsheet/Excel/Writer.php' (include_path='.:/usr/local/php52/lib/php/') in /home/NAME/domains/MY DOMAIN/public_html/admin/model/tool/export.php on line 1691

Please help.
Thanks.

Re: [UPDATED] Export/Import tool for OpenCart 1.4.9

Posted: Mon Apr 25, 2011 8:00 pm
by JNeuhoff
raoulpop wrote:I'd really appreciate some usage instructions for this plugin. I've installed it according to your instructions (vQMod is pre-installed), and I see no Import or Export option anywhere in the Admin pages. (Yes, I've enabled it on the user group page.) I don't know where else to look. Please help.

Send me a PM with your Opencart and FTP login details, and I can take a look at it this week.

Re: [UPDATED] Export/Import tool for OpenCart 1.4.9

Posted: Mon Apr 25, 2011 8:04 pm
by JNeuhoff
Rbq wrote:Hi.
I'm new here, so hello all. I have problem with export, error.

Fatal error: require_once() [function.require]: Failed opening required 'Spreadsheet/Excel/Writer.php' (include_path='.:/usr/local/php52/lib/php/') in /home/NAME/domains/MY DOMAIN/public_html/admin/model/tool/export.php on line 1691

Please help.
Thanks.
Looks like something hasn't been correctly installed on your server. In particular, make sure you have the system/pear folder with all its subfolders and files correctly installed on your server.

Re: [UPDATED] Export/Import tool for OpenCart 1.4.9

Posted: Tue Apr 26, 2011 1:36 am
by Rbq
Okey. I reaper error. That was easy, just change cod from errors lins from BIG to small(File to file). But now I have problem with import file.

Fatal error: require_once() [function.require]: Failed opening required 'Classes/PHPexcel.php' (include_path='.:/usr/local/php52/lib/php/') in /home/NAME/domains/MY DOMAIN/public_html/admin/model/tool/export.php on line 1169

I suppose bad source but I have no idea how to change to good one.

thanks.

Re: [UPDATED] Export/Import tool for OpenCart 1.4.9

Posted: Tue Apr 26, 2011 2:53 am
by renegade
JNeuhoff wrote:It uses the language set in yourAdmin backend at

System > Settings > Local > Language

which I understand it to be the frontend language.
Juergen, thanks for the response! Brother, I have just attempted a clean install (DB + OpenCart), in which I even completely removed the English language e left only the Brazilian Portuguese one (for both the Back-end and Front-end), and when installing the tool, I did so on the following directories and files:

admin/controller/common/header.php
admin/language/portuguese-br/common/header.php
admin/view/template/common/header.tpl

And yet the tool/export option never appears, but the interesting thing is that if I do a clean install with the English language only, then it works! Curiously, if there is any other language installed, then the language options on the backend will cease to be able to change the frontend language, so that whatever language was set prior to running the tool, that's what will be there (forever?). Have any idea what might be going on?

Appreciate your super-help, Juergen!!!

Re: [UPDATED] Export/Import tool for OpenCart 1.4.9

Posted: Tue Apr 26, 2011 2:28 pm
by renegade
I figured out a [filthy-but-functional] workaround: just overwrote the english directories with the brazilian portuguese files. Working beautifully now! ;)

Re: [UPDATED] Export/Import tool for OpenCart 1.4.9

Posted: Tue Apr 26, 2011 5:46 pm
by JNeuhoff
renegade wrote:I figured out a [filthy-but-functional] workaround: just overwrote the english directories with the brazilian portuguese files. Working beautifully now! ;)
In your database, what's the value for your config_language in your settings table?

Re: [UPDATED] Export/Import tool for OpenCart 1.4.9

Posted: Sun May 01, 2011 10:28 pm
by Rbq
Anyone could help me with this import error?

Fatal error: require_once() [function.require]: Failed opening required 'Classes/PHPexcel.php' (include_path='.:/usr/local/php52/lib/php/') in /home/NAME/domains/MY DOMAIN/public_html/admin/model/tool/export.php on line 1169

Re: [UPDATED] Export/Import tool for OpenCart 1.4.9

Posted: Tue May 03, 2011 4:34 am
by ercanermis
Hi,

First of all many thanks to the module, who have contributed ...

My question or rather cross the problem. A lot of products supplied by the manufacturer with both the $ and the € available, but we have to sell them on the basis of TL. Suddenly it gave a different product, different exchange rate based on TL and 2000 to enforce a number of pieces, such as Excel, to make changes to the product must have the olduğmuzda. Price column, and euro_kuru dolar_kuru next two columns to create a more comfortable way so I can update the daily exchange, but how it can import? Import errors while I receive so crazy. In addition, price column of the Excel formula used, it is a loss, will you? What would you recommend me?

Thank you.

My Error:

Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'n Prop CF061')' at line 1
Error No: 1064
INSERT INTO `product_image` (`product_image_id`, product_id, `image`) VALUES (493,492,'Pop'n Prop CF061');