Great module. There's one more thing I'm trying to do and was wondering how best to achieve it. I have a product which is associated with a node type 'Specification Form', which allows the user to specify in detail what they want, then check out, allowing the manager to create the product to their specification.

So far no problem. However, when I add several more products it seems I can't associate them with the same node type 'Specification Form'. It seems I need a new node type 'Specification Form A' for Product A, etc. etc. Is that correct? Is there any way to associate multiple products with one node type?

CommentFileSizeAuthor
#6 map_ctype_to_pclass.patch10.84 KBintuited

Comments

intuited’s picture

That would be great, agreed.

fred0’s picture

Or, alternately, associate the node type with a product class instead of an individual product.

mkeith’s picture

i agree with fred0. i'm in the exact same situation and don't want to have to create a new content type for each product.

echoz’s picture

A very helpful person provided some code to do this in a comment here (#38)
http://drupaleasy.com/blogs/ultimike/2009/03/event-registration-ubercart...

besides this being an extremely helpful tutorial for using UC Node Checkout.

fred0’s picture

echoz: I'm afraid I don't see how that applies to what we're discussing here. I'd tried that tutorial before and, while thta post is new since then, it is in regards to creating a view of purchased uc nodes and related orders. This thread is discussing how the current incarnation of uc_node_checkout only allows one to relate a checkout node to an individual product (as opposed to a product class) forcing one to create a unique node type for every product should your desired workflow be to have many different products that all use the same form for options (be it registration or other configuration).
Please enlighten me if I am missing something.

intuited’s picture

Issue tags: +views, +patch, +class, +product class
StatusFileSize
new10.84 KB

Hi folks,
Haven't had time for thorough testing yet, but this patch does seem to be working, at least for what I'm using it for. If you do try it out, any feedback you can provide would be quite welcome.
What it does:
Adds a column to the uc_node_checkout admin page to provide for the possibility of mapping a content-type to a product class rather than (or actually in addition to) a specific product or a view.
A click on the "Add to Cart" button for any product that's in a thus-associated class will send the user through the process of creating a node of the associated content type. That created node will then be associated with the product whose Add to Cart button was clicked, in the same way that uc_node_checkout creates the usual node-to-product associations.
It's possible to map a ctype to both a product and a class; this I think will actually work, meaning that if you create a node through Add Content it will map to the product you associated the ctype with, but if you create it by clicking on Add to Cart for a product-class-member product, the created node will map to the product that the Add to Cart button was for. At least it might work that way... I haven't tested this functionality and don't plan to since I have no foreseeable need for it.
Also added are Views 2 relationships that you can use to build views that relate ordered products to the node that was created when they were ordered. I've got the uc_views module installed; I'm not sure how useful the relationships will be without it.
Since it's helpful to confirm that the order actually completed you may want to use a patch I wrote for uc_views: http://drupal.org/node/505992. This fixes a bug that enables the Order Status filter (among others) for Ubercart orders.
I found it useful to relate the uc_order_products table back to node; a patch for uc_views that adds this relationship is at http://drupal.org/node/522198.
If you're not using uc_views, note that although it creates database 'view tables' which are not necessarily portable (depending on DB permissions and possibly underlying database architecture), the module and the functionality I've mentioned here should be usable even if you don't have permission to create views, since it doesn't make use of any of those tables.
echoz: Using Views in this way would seem to alleviate the need for some of the awkward aspects of the tutorial you mentioned; eg storing the event NID in the created content node is not necessary, you just relate them through the uc_node_checkout db table that's already storing that info. This eliminates needless data duplication and scales much more readily to mapping multiple products to one content type, which is something that, as I understand it, that tutorial doesn't cover.

intuited’s picture

Issue tags: -views, -patch, -class, -product class

PS Please ignore the sketchy commented-out code at the end of the patch. It's been hacked to bits and doesn't really make sense any more.

sanguis’s picture

subscribing

rszrama’s picture

Priority: Critical » Normal
Status: Active » Fixed

This was the whole reason Views support was added. With Views 2 installed, create a View that will list any product node you want to associate with a node type form in the View's default display. When any matching product is added to the cart, the customer will be redirected to the node add form.

fred0’s picture

rszrama: Thanks for that. It seems this is an poorly documented feature. I'd read all the documentation and tutorials for node checkout that I could find and none of them presented the use of views in this manner. My impression of the Views2 integration from all that I read was that it was meant to allow a workflow where one selected a node type form and were then asked to select a product from a pop-up menu. I was getting ready to spend several days writing my own version. So happy I don't have to!

rszrama’s picture

hehe Yeah, the documentation is in a poor state. Sorry for lagging behind.

socialnicheguru’s picture

I am new to ubercart and products.

I have a product with multiple attributes.

Each attribute combination creates a product sku. Ubercart defaults this to the sku or the base product.

Right now I have to go in and modify these skus for each attribute. (Can someone confirm this? Is there anyway to automatically created different product sku?)

I would like to associate a different uc_node_checkout content type to each product sku from an attribute.

Will uc_node_checkout allow me to do this?

would i have to create a view that returns the skus for the products and then manually select the products that i want the uc node checkout associated with?

wesjones’s picture

intuited,

i tried your patch but i keep getting the following error at the top of my site after i apply the patch:

Fatal error: require_once() [function.require]: Failed opening required './sites/all/modules/uc_node_checkout/uc_node_checkout.install' (include_path='.;C:\php5\pear') in C:\wamp\www\ads\includes\module.inc on line 262

Any idea why I would be getting this error? The site is down once i apply the patch. i get a white screen with the message above.

Thanks

fred0’s picture

wesoccer2003, per comment #9, you don't need the patch. Just use the Views2 function to relate a node type to products/product classes.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

glennnz’s picture

Hi Ryan

Functionally, this works perfectly. From a user's perspective though, it's a bit flaky (IMHO!!). Unless I'm missing something...

The reason is that my user has already pressed, "Add to cart" on my product node. They shouldn't need to select again which product they want to buy from the select list (or have I missed a setting...????)

In my site at the moment, the user sees these steps:

1. View product. Click "Add to Cart"
2. Page with a list of Views appears. Click the View title.
3. Page with a dropdown select appears with the products associated with that View.
4. Finally they get to enter information for the event registration.

Cheers

Glenn

For an example see http://203.118.157.191/chess4life

echoz’s picture

Not a page view, a view of Row style: Node (which has no fields). It's one click extra through your node checkout form.

rszrama’s picture

I'm not sure why a View is being displayed for you. This isn't normal... if they get there from a product add to cart button, it should go straight to the node/add form unless the View isn't working properly for some reason. Also, fwiw, you don't have to use the add to cart button. You could just throw an image button on a page that links straight to the node/add URL. When UCNC was originally developed, it wasn't intended for stores to even display the associated product nodes.

glennnz’s picture

Hi Ryan

I can see what's happening, but I've no idea why...

Originally I had three different tournaments, each with their own content type. To make the store more extensible (to allow for hundreds of different tournaments) I removed the extra content types, and made one, "Tournament Registration." Previously I had, "Tournament 1 Registration, Tournament 2 Registration," etc...

If you look at the URL as you go through the process, you can see the error. When I click on, "Add to Cart", I should get a URL of www.example.com/?q=node/add/tournament-registration&product_nid=83&qty=1. Instead I am getting www.example.com/?q=node/add/tournament-1-registration&product_nid=83&qty=1.

It is somehow remembering my old content types..... I've cleared the caches with no effect. Next I'll delete all my products and content types and start again...

Cheers

Glenn

--UPDATE--

Deleting my tournament products and re-entering them worked fine, I'm away laughing.

Maybe this is an issue that needs escalating to a bug?

Cheers

Glenn

glennnz’s picture

Ryan

Any plans to add Views support for D5 version?

Glenn

valariems’s picture

Just so you know, the problem glennnz was having is not isolated. I was also having the same (or very similar) problem.

A user would select a product from a view I had created that listed all the products. They should have been directed to the node content type I created for the user's registration information. Instead of taking them directly to that node, when they clicked "add to cart," it would take them to the "create content" page where all the content types that they had permissions to create were listed. Also, after they created their node, it would take them to another page where they had to reselect the product from a dropdown box.

This was only happening when I was using a view, rather than a product nid, in the settings in node checkout.

Like glennnz suggested, I deleted all the products, create new products, and everything worked as advertised.

I messed with this so long that I can't point specifically to what I did that caused this problem, and I apologize for that. I do know that somewhere along the line, I changed my Node Content Type name and type. Perhaps that's what broke everything with the existing products, even when I went back and made the related changed to the node checkout settings. I'm a newbie, so I'm kind of making a mess as I try to get everything to work.

intuited’s picture

Just wanted to let people know that #406740: Doesn't work when content type name has underscores seems to be the fix for this issue, which I'm gathering was just happening for tables whose names contained underscores. That issue is resolved in the current version of uc_node_checkout; I've updated and am now able to use a View in the same way I was using my patch before the update. With only one node type selected in the View filter, there's no need for the customer to select a node.

dsinnet’s picture

Is there anywhere that gives a more substantial overview of how to integrate views with UCNC as Im banging my head against a brick wall. I can't see how this is done. I can't see an option to add a node type to my relationships section in my product view.

Any ideas as this is a key feature on the site I'm developing.

I just need an image upload field for some product types and not others. My client (store owner) will need to create new products from time to time and I don't want to complicate teh procedure by making him create new node types and products as will confuse the hell out of him.

Thanks in advance

David

FranCarstens’s picture

Status: Active » Closed (fixed)

I'm not convinced NID and Views are sufficient. I'm opening this again.

Test Case:

Both NID and a Views version of Node Checkout is essential, however nothing exists in the middle. That's where a Class Version becomes important.

We have a store that runs a variety of product classes. Some of them require node checkout and some don't. So you're saying, "Just use Views" for those classes. That's great, until you want a general page that shows your collection of products in 1 view. Now you have to force your user to the second view for the NC Class, or remove the NC Class from the main products view; essentially telling your customer that product doesn't exist. Not Good.

An example of this can be found here: http://www.loktah.com/catalog/products

Albums require NC but other products don't. If NC handled class this wouldn't be a problem, but since it doesn't we're stuck somewhere in the middle. Either having to create a unique node type for every single album - get's a little clumpy when your collection is growing. Or removing albums from the product page - Not going to happen.

Considering this situation, and sure that it's not unique I vote for classes to be added as an option.

In the meantime I'll try the patch at #6 posted by intuited.

Cheers
Francois.

FranCarstens’s picture

Status: Closed (fixed) » Active

@dsinnet

In Views you have to select Node Type using Filter, not Relationships.

You can then go to .../admin/store/settings/node-checkout to link the View with your UCNC node type.

aidanlis’s picture

Version: 6.x-2.0-beta3 » 6.x-2.x-dev
Status: Closed (fixed) » Active

@mintsauce huh? you can create more than one view ... just create a view to filter on the node type.

Either way I think this is useful functionality, so bumping.

aidanlis’s picture

Title: Multiple products one node? » Allow node types to be associated with product classes
Status: Active » Postponed

This requires quite a few changes so I'm going to postpone this, if you'd like to sponsor the development please reopen.