To cut a long story short i have a site that is running on wp-ecommerce and i have 'out grown' it. So... I am porting it to opencart. I have a module for Opencart that allows for importing CSV files but as you may / may not know there is currently no way to get an export CSV of products out of wordpress e-commerce. My problem is that all of the product images and ifo are stored in seperate rwos in the 'wp_posts' table within the wordpress database. As far as i can tell they are all linked by the primary key which is ID. Here is the query for 'wp_posts':
CREATE TABLE `wp_posts` ( `ID` bigint(20) unsigned NOT NULL auto_increment, `post_author` bigint(20) unsigned NOT NULL default '0', `post_date` datetime NOT NULL default '0000-00-00 00:00:00', `post_date_gmt` datetime NOT NULL default '0000-00-00 00:00:00', `post_content` longtext NOT NULL, `post_title` text NOT NULL, `post_excerpt` text NOT NULL, `post_status` varchar(20) NOT NULL default 'publish', `comment_status` varchar(20) NOT NULL default 'open', `ping_status` varchar(20) NOT NULL default 'open', `post_password` varchar(20) NOT NULL default '', `post_name` varchar(200) NOT NULL default '', `to_ping` text NOT NULL, `pinged` text NOT NULL, `post_modified` datetime NOT NULL default '0000-00-00 00:00:00', `post_modified_gmt` datetime NOT NULL default '0000-00-00 00:00:00', `post_content_filtered` text NOT NULL, `post_parent` bigint(20) unsigned NOT NULL default '0', `guid` varchar(255) NOT NULL default '', `menu_order` int(11) NOT NULL default '0', `post_type` varchar(20) NOT NULL default 'post', `post_mime_type` varchar(100) NOT NULL default '', `comment_count` bigint(20) NOT NULL default '0', PRIMARY KEY (`ID`), KEY `post_name` (`post_name`), KEY `type_status_date` (`post_type`,`post_status`,`post_date`,`ID`), KEY `post_parent` (`post_parent`), KEY `post_author` (`post_author`) )
And for example, the product with 'ID' 1037 you have this: (i have removed any identifying information)
INSERT INTO wp_posts VALUES("1037","1","2011-05-06 10:56:52","2011-05-06 10:56:52","product title ","Product page heading","LONG PRODUCT DESC - REMOVED FOR PRIVACY","publish","closed","closed","","product-SEO-friendly-URL","","","2011-10-04 23:23:10","2011-10-04 23:23:10","","0","http://www.removedforprivacy/product-url/","0","wpsc-product","","0");Then a few of these: (you can see the '1037' appears further along)
INSERT INTO wp_posts VALUES("1079","1","2011-05-06 11:13:56","2011-05-06 11:13:56","","ImageName","","inherit","open","open","","catbag1-3","","","2011-05-06 11:13:56","2011-05-06 11:13:56","","1037","http://www.removedforprivacy/wp-content/uploads/2011/05/ImageName1.jpg","0","attachment","image/jpeg","0");INSERT INTO wp_posts VALUES("1080","1","2011-05-06 11:14:05","2011-05-06 11:14:05","","ImageName","","inherit","open","open","","imageName","","","2011-05-06 11:14:05","2011-05-06 11:14:05","","1037","http://www.removedforprivacy/wp-content/uploads/2011/05/ImageName2.jpg","0","attachment","image/jpeg","0");So you can see the data is all over the place. I just want to arrange it so that all the info i need is in one row. All teh description, prices etc AND al of the additional thumnails. That way i can go through and just dump the table and format it as i need as a CSV ready to import in to my new store.
Does that make sense?
Is there a simple way to do this?!
Any help much appreciated!
Thanks.
- G
Help


















