It seems like attributes are really just a simplified version of CCK fields that can only be placed on Product nodes.

It seems more Drupalish to be able to mark any content type as a "product" and ditch Attribute module (and possibly Product module as well) in favour of CCK.

This would give a lot more flexibility to add, for example, a node reference field pointing to another related product ("Choose the monitor to come with your computer") or something else I'm not thinking of atm. :P

Comments

Island Usurper’s picture

My initial reaction was "No! They're totally different!" But then I got to thinking a bit more about it, and now I'm interested.

The main reason CCK wasn't used in the first place is because adding a product to the cart isn't the same thing as creating a node. You don't usually see the fields' forms when the node is viewed. Also, the add to cart form isn't a node form at all. Putting the widgets in the add to cart form isn't a big deal, but I don't see an obvious way to get CCK to handle the data when there aren't any node hooks involved.

It'd be really cool to see if we could pull it off, though.

rszrama’s picture

Status: Active » Closed (won't fix)

I think the main difference here is that attributes are user selectable and can modify the product price, weight, and SKU. It seems like the meta-issue here is what we should consider a product, and there has been talk about this related to fields getting into core. However, even if we change what constitutes a product, I think attributes will continue to be a special case that might not really fit into CCK.

I'm not really sure how to mark this issue, but I'm going to put it "won't fix" right now since it's a feature request that isn't feasible in itself. We'll revisit what to do about products w/ 3.x.

trungonly’s picture

Status: Closed (won't fix) » Active

Buzz - I facing problem is need of adding attribute options programmatically, instead of adding options manually in admin panel. So I'm thinking of CCK widgets, which allows us to gather data from many sources, like node references or so.

Let's see I need an attribute which lists the DVD nodes as options, and DVD price (CCK field of DVD content type) as adjustment price for option.

This case the DVD nodes should be gathered dynamically from database, instead of manually entered one time in store admin panel.

Do you think I should create a new add-on module for this purpose, based on uc_attribute? Since we see uc_attribute does not provide any other hooking API, however it uses Drupal's hooks like hook_nodeapi, form_alter etc...

tr’s picture

Status: Active » Closed (won't fix)

@trungonly: I don 't see how your question is related to this old, closed issue. You should start a discussion on ubercart.org if you want help figuring out how to do what you want.

trungonly’s picture

@TR: Just clarify that I did not ask how to do, but asked should I do an improvement based on uc_attribute for CCK field, that would solve problem of this issue. Actually an attempt made by me, but I will request a CVS project only if it's useful for other people.

trungonly’s picture

The module now is here:

http://drupal.org/node/923708

trungonly’s picture