I have configured the product bundle module so that I can select various combinations. I have also used the commerce product option module with product attributes.

I have used the commerce product option to allow for additional information to be provided by the customer about the product.

On the cart I have enabled the product attributes field which shows all the products in the bundle but it makes the product options disappear.

I know they display correctly when the product bundle is not enabled on the product type.

Comments

olafkarsten’s picture

Title: Product Bundle on Cart Attribute View hides Product Options » complete the integration with Commerce Product Option
Category: bug » task

Unfortunately, the integration of the two modules isn't complete yet (as statet somewhere at the project page) ;). It simply has not yet finished.

z_khn06’s picture

Are 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?

olafkarsten’s picture

z_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

chasematterhorn’s picture

Anyone?

Susurrus’s picture

I'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?

bob.hinrichs’s picture

Version: 7.x-1.0-alpha5 » 7.x-1.0-alpha6

Same issue. We need this functionality to work also. Currently no suggestions, subscribing.

Nick Robillard’s picture

Still 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)

TorreyToomajanian’s picture

Hey 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().

function gng_entity_presave($entity, $type) {

        // If it is a Product Display Node
	if (isset($entity->field_product_reference)) {
		foreach ($entity->field_product_reference['und'] as $product_reference) {
			$product_id = $product_reference['product_id'];
			$product = commerce_product_load($product_id);

                        //If the set_id is empty, add the appropriate type and save
			if (isset($product->field_product_options) && empty($product->field_product_options['und'][0]['set_id'])) {
				$product->field_product_options['und'][0]['set_id'] = $product->type . '_options';
				commerce_product_save($product);
			}
		}
	}
}
olafkarsten’s picture

Issue summary: View changes
Status: Active » Closed (outdated)

Closing. No development for D7 anymore.