3 replies [Last post]
mati515's picture
Offline
Joined: 11/13/2008
Juice: 3

Hello community,

This my first post, I've dived into ecommerce as from about 72 hours.. I've got couple years drupalling and a bit longer PHPing, MySQLing, and HTML/CSSing Smiling

I've searched around a bit and could not really find a lot: google, drupal, here.

I have developed a brochure site in drupal over the last while... this site presents a catalog of woodcraft products, furniture, toys and other things... the products are CCK nodes, with ImageField, Imagecache and all sorts of other settings.. I mean, the site is pretty much setup.... www.ocramgirap.com, I'm still working on it but the main functional issues at least are doing ok... I think..

The idea is to convert CCK nodes to Ubercart nodes. Also, the Categories need to be sorted out so that the Catalog uses the vocabulary of my CCK nodes.

Currently the site as no Ubercart support, I would like to know if this "porting" is possible or if its just better to start all over and use the default "Product" type provided by Ubercart and its default "Catalog" block..
That would be a pain in the bask as I would have to reupload all product images.

So, my attempt so far as gone as dirty as changing the database contents with the MySQL Query Browser. I went to the node_type table and, better to give the (not tested pseudo) query:

UPDATE node_type SET module ="uc_product" WHERE type="my_cck_product_type"

The module field was previously set equal to "node", ie: getting created by default by the core node module, I guess...
Now, if I go to "Create Content > My_CCK_Product_Type" , you will get the Ubercart product fields, like SKU and prices $$ ...
Is this enough? that's my first question. In any case it does not solve the problem of taxonomies, and I can't get all the CCK nodes that I have already set up to "uc_product" nodes that can be Ecommerced.
The second question is: is tweaking the db a good idea? After all its going to be an ecommerce,don't really want to risk anything, security wise for example, for a bunch of stupid dirty tweaks¡!¡!

I've installed Ubercart ( also tried doing it locally on a fresh drupal install) and it looks neat, I might use it for another project hopefully.

I had also played around with Ecommerce module about a year ago, by now it must have gotten better I guess and I plan on trying it anyway... if any one thinks that this alternative could be better in my case, please signal it..

¿Any ideas? Any suggestions?

Lyle's picture
Offline
AdministratoreLiTe!
Joined: 08/07/2007
Juice: 6841
Re: How to convert a CCK node set to Ubercart product nodes?

Changing the module field is basically what needs to happen, but there's an easier way to do it. If you create a product class called "my_cck_product_type", it will do that for you. And it's reversible, so if you later delete the product class, all of those nodes will go back to being regular nodes.

The Catalog module should let you set which vocabulary to use. Changing the nodes to products shouldn't affect the vocabulary since it's based on node type. The actual name of the node type hasn't changed, so as far as taxonomy.module is concerned, nothing has changed. However, if you are using more than one vocabulary for your nodes, you'll have to pick just one to be the Catalog.

Covenant Web Design's picture
Offline
Joined: 01/09/2009
Juice: 132
Works perfectly!

Thanks for the tip Lyle!

I had a ton of "Camps" with their content ID of "camp" so when I created a product class with an ID of "camp" it automatically converted or added the Ubercart store pricing and other options to the camp.

One note though is that I had to go in and enter the SKU and Price and choose the attributes for each camp. A lot less work than re-entering all the camps though!

(note: sorry if any of this sounds awkward, I was trying to think of and use the terms people would be most likely to search based on)

.:Joshua

Joshua

Joshua Stewardson
Client Consultant
Covenant Web Design

betamos's picture
Offline
Joined: 12/02/2010
Juice: 10
Re: Re: How to convert a CCK node set to Ubercart product nodes?

I can confirm that Lyle's solution still works on ubercart 2.4. Thanks