I'm testing my Ubercart site and have added the Roles feature to a Product Kit-enabled product (i.e. when you purchase multiple products as a kit, you're assigned a role).
However this doesn't seem to work. When the order status gets changed to 'completed', the 'renew roles' conditional action is run (I know as I added a 'display message' action to it), but no roles are assigned.
To find out what the issue was, I started going through the uc_roles_action_order_renew() function, adding dpm()'s to see what was happening. It seems that when it loops through the order's products (foreach ($order->products as $product)
), it get's the two individual product node ID's that make up the kit. But in the database, the role is attached to the kit's node ID and that's why it doesn't work.
As far as I can tell, this is a bug that should be fixable by simply adding another check to the aforementioned function that checks the product kit's node ID as well as the individual products that make up the kit...
Comment | File | Size | Author |
---|---|---|---|
#9 | 1029760-product-kit-disable-features.patch | 572 bytes | longwave |
Comments
Comment #1
swarad07Any leads on this. ?
Comment #2
longwaveI don't think this has ever worked. I guess it does make sense to allow roles to be attached to a kit rather than the individual products, but kits have to be dealt with as a special case in lots of parts of Ubercart.
Comment #3
TR CreditAttribution: TR commentedLet's fix this in 7.x-3.x first.
Comment #4
Island Usurper CreditAttribution: Island Usurper commentedIn order for this to work, for any product feature like files and roles, the feature has to be transferred from the kit node to one of the cart items. Product kits don't exist in the cart, so the features attached to it aren't ever seen by the checkout hooks.
Comment #5
TR CreditAttribution: TR commentedI think in the long run, this is something that will be addressed by #525612: Allow any node type to become a product. As a side effect, I think that issue obsoletes product kits, which become simply a node with two or more product references that's been turned into a product. Although I guess it also implies a computed price field (to calculate kit discount) rather than a fixed price field. A standard computed price field probably makes sense anyway because it would enable all sorts of other good things. I'm not a big fan of product kits because they address such a small use case. I would avoid building up too much infrastructure that is kit-specific, and avoid requiring modules like uc_roles to deal with kits differently than products.
Comment #6
sumitmadan CreditAttribution: sumitmadan commentedI have a problem on product kit it is not assigning the role i want.
Let me clear I want to create a package on more than one product for that I am assigning a diffrent role on feature option in edit of product-kit content type.But it is assigning the role of first product after completing the order.
Have you any solution of this problem???
Comment #7
TR CreditAttribution: TR commentedComment #8
longwaveComment #9
longwaveThis trivial patch disables product features for product kits, as roles and file downloads will never work without significant code changes.
Comment #10
longwaveCommitted to both branches.