Page 1 of 1

Import/Export Module: Default Values

Posted: Wed Dec 23, 2009 5:00 pm
by mikejshaw
Hi!
Can't quite get the hang of this module. Do I need to fill in the Date/time stamp for the date added / modified / available fields? As NOW() or a made up time? Not having much luck. Keep on getting is error message:

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 ''9781841101675',0,'9781841101675.jpg',1,21.95,NOW(),NOW(),NOW(),0,1,1,9,0,0,0,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`,`measurement_class_id`) VALUES (116,1,'0','0',,'9781841101675',0,'9781841101675.jpg',1,21.95,NOW(),NOW(),NOW(),0,1,1,9,0,0,0,0,'1');
Any suggestions?
Cheers
Michael

Re: Import/Export Module: Default Values

Posted: Wed Dec 23, 2009 5:22 pm
by moggiex
Hi Michael,

I see your logic, but now() does not work, export a product and nick the date stamps off it, or use these two:

date_added = 2009-11-26 19:09:19
date_modified = 2009-11-30 23:51:01
date_available = 2009-12-20

Or alter the loader so that if those fields are null, for it to create the timestamp automatically for you.

Matt

Re: Import/Export Module: Default Values

Posted: Wed Dec 23, 2009 5:37 pm
by mikejshaw
So you're saying all three time stamps have to have a value?
Cheers

Re: Import/Export Module: Default Values

Posted: Wed Dec 23, 2009 10:43 pm
by JNeuhoff
mikejshaw wrote:So you're saying all three time stamps have to have a value?
Cheers
The 3 date fields are optional, if you don't specify them in the spreadsheet the Import will automatically use the NOW() function instead.

However, you forgot the specify the stock_status_id which is required, and whose values usually are

7 = In Stock
5 = Out Of Stock
6 = 2 - 3 Days

in a standard Opencart 1.3.4 database.

Re: Import/Export Module: Default Values

Posted: Thu Dec 24, 2009 6:46 am
by mikejshaw
Thank you for the explication! Hopefully I'll have it sorted out by the time Santa's due down the chimney ... :)