Closed (outdated)
Project:
Commerce Product Bundle
Version:
7.x-1.0-alpha6
Component:
Miscellaneous
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
6 Jan 2012 at 11:09 UTC
Updated:
14 Dec 2021 at 06:53 UTC
Jump to comment: Most recent
Comments
Comment #1
olafkarsten commentedUnfortunately, the integration of the two modules isn't complete yet (as statet somewhere at the project page) ;). It simply has not yet finished.
Comment #2
z_khn06 commentedAre there any alternative methods as I need to display the options as well as the bundle on the cart and order. Is it possible to refer to the options using some code and another custom field on the cart?
Comment #3
olafkarsten commentedz_khn06, I really would like to help you. But to be honest, I do not know that, but I really doubt, that there is a simple way yet. Someone have to code it :(. Sorry
Comment #4
chasematterhorn commentedAnyone?
Comment #5
Susurrus commentedI'd like to work on this as it'd be helpful for a website I'm building. Does anyone know where to start to do this?
Comment #6
bob.hinrichs commentedSame issue. We need this functionality to work also. Currently no suggestions, subscribing.
Comment #7
Nick Robillard commentedStill nothing a year later? I'm going to have to give this a go myself. If anyone has attempted, please let me know how far you got. (sandbox code or whatever would be greatly appreciated)
Comment #8
torreytoomajanian commentedHey I had this same problem over the past few days and figured I'd do my best to get to the bottom of it until a full integration with this bug fixed is finished. I was receiving this error when I would edit one of my product display nodes that contains a product reference field that references products with commerce_options attached (my site's t-shirts use sizes as options). What I found was that when I would go to edit the product display node itself, individually editing each product and then re-saving them using their respective inline entity forms would cause no problems. But if I only edited one of them or none at all, after saving the product display node I would receive the malformed bundle key error for an entity of type commerce_option. Upon checking my database, I realized that not individually editing and saving each product's inline entity form would place a NULL value under their respective product option fields, and would save them with the new node. That is what was throwing the error, as products that use commerce_options with add-to-cart forms require this set_id or throw you the error.
My workaround (which may not be the best, but is a short fix until we have an actual fix), was to implement a hook_entity_presave($entity, $type). When my product display nodes are saved, it loops through each product_id referenced by the product reference field, loads that product id, and checks it's commerce_option reference field to see if it has had a NULL set_id placed in it, rather than the appropriate one for that product type. If it is indeed NULL, I simply added the correct one and performed a commerce_product_save($product) on it. Since my commerce_option set_ids are named "{product_type}_options", it was easy to make this dynamic for all of my product types based on which type I was editing. I'll paste my code below, I hope this helps until we have a real fix!.
(This can probably be fixed in the same way via a hook_validate or hook_submit but I chose to go with hook_entity_presave().
Comment #9
olafkarsten commentedClosing. No development for D7 anymore.