Right now the table shows only SKU and Title for referenced products. There should be a way for the user to change that (reorder, add / remove columns).
Since we ruled out the embedded views approach for now, Ryan suggested we try with a custom entity view mode.

This is also the only product-specific part of the widget, so abstracting it out will allow us to move further ahead in supporting other entity types such as line items.

CommentFileSizeAuthor
#1 1459156-first-try.patch5.21 KBbojanz

Comments

bojanz’s picture

Status: Active » Needs review
StatusFileSize
new5.21 KB

Here's a first stab at trying to abstract this out. It's pretty clean on the callback side (commerce_product.forms.inc, which should btw probably become just commerce_product.inc) anda bit hacky on the IPF side. Open for brighter ideas.

Not sure how to proceed with view modes, because I don't think there's a way of specifying default settings ("show sku", "hide title", etc). The default settings (sku and title shown, nothing else) would work for products, but not for line items (which need at least the price as well).
Perhaps we could declare a view mode, but have a field widget setting that says whether it should be used, and have it off by default? Unsure.

bojanz’s picture

Title: Abstract out the display of products and make it user configurable » Abstract out the display of products
Status: Needs review » Fixed

Tweaked for latest git change, and committed:
http://drupalcode.org/sandbox/rszrama/1181848.git/commitdiff/dd4902e
Not perfectly happy with the approach, but it gets us where we need to be.
We can discuss the entity_view() approach in another issue. Moving on.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Sinan Erdem’s picture

Version: » 7.x-1.x-dev
Issue summary: View changes

Hello,

What is the output of this issue? Can we edit the list now? How?

Thanks