Hello,
I am unsure if this is possible yet and I understand we are at early stages of development of this fine module, but I would like to know if the following is possible.

I have configured my product called Tshirt Bundle so that when you view its display, you can select size, design, color, and type, all of which affect the product price, so as you select each dropdown it modifies the price accordingly. When you click the Add to cart button, it puts my product in the cart, and sets the price correctly - this is wonderful. the real issue here is that after shopping for a few different t-shirts, the cart has several items named tshirt - bundle all with different prices. I am not too concerned about tracking stock at this point, just that the end user experience not be confusing. Is it then possible to have the cart display what selections were made under the item somehow, I have hacked away at a variety of different aspects that modify display, but it seems that only modifying the CART VIEW really changes the cart, I have tried a variety of things to do this in the view but have been unsuccessful. If there is a way to do this , I would love to know, I am not afraid to hack the view, or the module or write one, but I am have no clue where to start and would appreciate even a hint at the direction to take.
Thanks for any and all help.
Franco

Comments

xbrianx’s picture

Would love to know how to do this as well

codefactory’s picture

Me too. Apparently the views "Line Items" (orders) and "Shopping cart form" need customization. Any hint will be appreciated.

codefactory’s picture

I came up with this quick and dirty hack. This is not a universal solution but a mere example of what can be done:

The idea was to create a rule action that would update the line_item label (which by default holds the base/bundle product SKU) to incorporate the SKUs of the selected subitems

Therefore I modified the commerce_product_bundle.rules.inc file and added the following code snippets:

1) in the hook_rules_action_info() hook implementation

   $actions['commerce_product_bundle_set_description'] = array(
    'label' => t('Set the description of a bundle.'),
    'parameter' => array(
      'line_item' => array(
        'type' => 'commerce_line_item',
        'label' => t('Sub line item'),
      ),
    ),
    'group' => t('Commerce Product Bundle'),
  );

2) the actual rule action function

function commerce_product_bundle_set_description($line_item){
	$wrapper = entity_metadata_wrapper('commerce_line_item', $line_item);
	$sub_items = commerce_product_bundle_get_sub_line_items($line_item);
	$description_str=$wrapper->line_item_label->value();
	if (count($sub_items) > 0){
		foreach ($sub_items as $sub_item){
			$description_str+="-".$sub_item->line_item_label;
		}
		$wrapper->line_item_label->set($description_str);
	}
	
}

Then I was able to overide the default bundle pricing rule. I.e. I added my newly created action. Now the subitems SKUs show in the order view

I m following the thread for a more robust solution

codefactory’s picture

Issue summary: View changes

grammar

olafkarsten’s picture

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

Closing. No development for D7 anymore.