Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

WordPress

Lucas Santos
Lucas Santos
19,315 Points

How can I use the information I already have on my Products custom post type with the WooCommerce Custom Post Type?

Ok so iv ran into a terrible problem where I already have a website set up with about 1000 products "That Did NOT Sell Anything" until now.

So on this website I already have a custom post type created of "Products" with two different taxonomies of "Types" and "Country" used as a category filter. I basically have everything set up the way I want it to be but now i want to add an "Add To Cart" button next to every item so I can start to sell.

I am using the advanced custom fields and custom post type plugin to make the custom fields of "Price", "Image" and ect. for my custom post types of "Products"

I wanted to use WooCommerce but I don't know if there is a way that I can use my custom post type of "Products" over WooCommerce because I cannot re-enter all the information of "Price", "Title", "Description" and "image" for all of my 1000 some what products all over again.

So is there a way that I can use all the data that I have already entered in my custom post types of "Products" with WooCommerce so I don't have to re-enter all the prices and information for the products and just have it maybe recognize the the_field('price') as the price of the product? or is there another alternative or better way to go about this? any solutions and ideas are appreciated, thank you.

Also if I install WooCommerce I know that it makes a "Products" custom post type, but if I already have one does that mean it overwrites mines or what happens?

I was reading over this and just to make one thing clear incase it's not.. I do not have WooCommerce installed yet, I have a custom post types of "Products" already set up with 1000 items and I want to install WooCommerce plugin but not have to re enter all of my products information all over again and use my products custom post types that I already have instead of WooCommerce's "Products" custom post type.

1 Answer

Zac Gordon
STAFF
Zac Gordon
Treehouse Guest Teacher

The best approach would be to look into some of the import products plugins for WooCommerce.

You can create a template file that outputs a csv file and then import them as native WooCommerce products without having to manually reenter them.

Lucas Santos
Lucas Santos
19,315 Points

Thank for the reply Zac really appreciate it. So iv been looking at couple of plugins and I like this one as well as this one which takes CSV files but how do I create a CSV template file with all my products?