Thank you for the great module.

I was curious though, do you think it would be possible to change the functionality from a commerce product to a commerce line item?

I tried to alter the module from

if (empty($form['locked']) && $instance['entity_type'] == 'commerce_product' 

to

if (empty($form['locked']) && $instance['entity_type'] == 'commerce_line_item'

But this returns the error:

Notice: Undefined index: replace_taxonomy_field in commerce_taxonomy_field_product_attribute_form_field_ui_field_edit_form_alter() (line 28 of /Applications/MAMP/htdocs/drupal-7.8/sites/all/modules/commerce_taxonomy_field_product_attribute/commerce_taxonomy_field_product_attribute.module).

Figured out, needed to change:

$commerce_cart_settings = commerce_cart_field_instance_attribute_settings($instance); 

to

$commerce_cart_settings = commerce_cart_field_instance_access_settings($instance);

But this is where I get stuck... I'll keep delving into the code and post updates but if you have any suggestions on where to go, or what should be changed, I would greatly appreciate it. Thanks

Comments

liupascal’s picture

I am not sure I understand what is the expected behavior. You want to display the taxonomy image field when a line item is displayed ?
If yes I assume you re using a view, you could easily set up some relationship (line item to product and product to taxonomy) to display the taxonomy image field.
If you re not using views you can try making different entity display view mode and get the taxonomy image displayed
Otherwise, this modules hooks on the add to cart form display, you d be better off making a new module rather than tweaking this one

timodwhit’s picture

Sorry for the confusion:

So I have created a custom line item that allows the user to pick the filling (popcorn in tins). The line item has a taxonomy reference field with radios as the widget. This field is then used as an "add to cart" function. I would like to display these taxonomy terms as images.

The problem I am running into is figuring out how the cart processes the line items vs. attributes. Since the terms are part of the add to cart function, I thought the module might be useful as a base.

Does that make more sense?

Thanks for the help and suggestions.

liupascal’s picture

You're using a custom line item entity then ? And your custom line item have a taxonomy term reference field ?

I've never done that before but I guess there must be some equivalent of the product add to cart form for the line item, you might then have to hook on it.

I wouldn't use this module as a base for this as you're dealing with line item here. The only bit of code you might reuse is where the taxonomy image field is displayed.. but that's just a few lines of code.

liupascal’s picture

Status: Active » Closed (won't fix)

Closing this topic since no feedback

timodwhit’s picture

Im going to get to this in a few months, the priority was to release the site. Thanks for the help.