Actually every kind of node can be turned into a product.
But in the subproduct module, subproducts are only enabled for the "product" type node.
So, if you turn an image into a product, the subproducts don't work.

I attached a quick fix to that.I just removed the check for the "product" type node.

CommentFileSizeAuthor
#3 subproducts_0.patch516 bytesCerel
subproduct_5.patch495 bytesCerel

Comments

Cerel’s picture

Title: Subproduct : Enabling subproducts for every kind of node. » Enabling subproducts for every kind of node.
Component: other » subproducts

I think with taking out the comment (which the patch does not) the patch could be commited.

nedjo’s picture

Agreed, we need to relax this restriction. Remove the comment as well and this is RTBC.

Cerel’s picture

StatusFileSize
new516 bytes

Here's the updated patch, sorry for the delay.

Cerel’s picture

Status: Needs review » Reviewed & tested by the community

I'm marking this RTBC as it's a small patch (two lines) and has been aproved by nedjo.

kevinconaway’s picture

Would this mean that any type of product would support variations?

Cerel’s picture

Short answer : No.

For a product to support variations it has to be coded in that way (it's easy, only one line to add to the code).

This patch allows any node that has been turned into a product that supports variations to work.

So, for example. Let's say you use the apparel module. That module offers you the apparel product, and that product supports variations.
Now, let's say you add an image. The turn that image into an apparel product.
With this patch, you can make the variations work for that image.

Without this patch, only the "product" node can have variations.
With this patch, any kind of node (once turned into products) can have variations.

I hope it's more clear.

kevinconaway’s picture

Cerel,

Thanks for the clarification. Do you know what it would take to be able to add custom variations to a single product only and not system wide?

Cerel’s picture

In the actual state of the code you can't "add custom variations to a product".

Actually, you create variations wich are independent of the product. Then you "assign" those variations to the products you want.

I've also had some problems with the actual approch, as you have to at least choose one "variable" for each variation available when you create your product. I've created an issue for that, it's here : http://drupal.org/node/70519

If you go see that issue, you can see that brmassa proposed some patches to fix that. I've also solved that issue in a similar way.
Once i clean the code and decide what is the best way, i'll create some patches. But it think my patches will look very similar to brmassa's. So maybe you can try those, maybe they'll fix your issues.

I hope i helped you.

nedjo’s picture

Status: Reviewed & tested by the community » Fixed

Applied, thanks.

Anonymous’s picture

Status: Fixed » Closed (fixed)