Now that #1462120: Use CTools plugins for IPF callbacks has been done, work on abstracting out products from the inline form has been completed. This means we can support any other entity types (and other modules can add support for their own entity types as well). The next logical step is supporting line items.
This is a huge feature request in the Commerce queue, because the current Commerce line item widget doesn't support fields attached to the line item entity.
Basically, a commerce_line_item.inc plugin should be created (the code in commerce_product.inc can be used as a start), and a widget should be defined for the "commerce_line_item_reference" field type (just like we do for commerce_product_reference fields currently).
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | support-line-items-1462136-8.patch | 8.74 KB | bojanz |
| #7 | support-line-items-1462136-3.patch | 6.88 KB | roam2345 |
| #4 | support-line-items-1462136-2.patch | 11.3 KB | roam2345 |
| #1 | support-line-items-1462136-0.patch | 1.12 KB | roam2345 |
| #3 | support-line-items-1462136-1.patch | 7.25 KB | roam2345 |
Comments
Comment #1
roam2345 commentedHere is the first pass at this patch.
- Right now we have some of our fields throwing some validation errors on submission.. not sure if that is our own issue or something wrong here yet.
- The bundle has been set to an empty array()
$settings['bundles'] = array();not sure off hand what this needs to be as we don't have this available as products do in the core entity.- I also have not added the additional css for the new labels
- Im not sure if we should even display the ID of the line items maybe the label is enough?
The reset seems to work right now.
Comment #2
roam2345 commentedchange statue to reflect the patch still needs some work.
Comment #3
roam2345 commentedFixed the bum patch that missed the additional file.
Comment #4
roam2345 commentedSome more clean up.
- Bundles is now set to use the $instance['bundle'] still think this is wrong. But a better option than before.
- CSS add for label.
- Dropped the ID as pretty sure thanks not wanted.
Right now the main issue left looks like the custom entities out there like commerce_shipping.. that throws an illegal choice error. Not sure where that ownership lies here with this module to fix or with shipping...
Also we use the group module for a really large line item and even use the multi step form part of that, the bad news about that is that that modules multistep form actions (if clicked) break this module. So again question is on the owner ship of who should be disabling those bits added to the form?
Then lastly this should probably go in a separate issue, when one has the case of this inline form used on fields that them selves use the inline form we end up causing malformed entity exceptions... We most probably want to disable this inline form if its a child of one already.
Comment #5
roam2345 commentedrolled against 0f32fcce1fbbeb497a7817b54f998a5b7ab97e5d
Comment #6
bojanz commentedHey, you didn't upload the patch!
My last commit should make it easy to specify line items fields that should go into the table:
http://drupalcode.org/project/inline_entity_form.git/commitdiff/c6d28dd?...
Thinking about having a UI for that as well. See #1521274: Investigate a UI for configuring table columns (which fields and in what order) for the full story.
I'm almost done with the product part, so I can give line items a push, once you share your latest code.
Comment #7
roam2345 commentedHere is that latest reroll of the patch against the latest head.
- fixes as we worked through them in IRC.
- added quantity default field after our chat, not sure if I should be adding the other fields there as well assumed the loop at the bottom of the line item form was doing that. http://cl.ly/350H2M1Y1y300P3p1004
- some other misc cleanup.
Comment #8
bojanz commentedHere's an improved version (additional columns in the table, tweaked inline form).
It's really close to a version I'd commit. Will return to it shortly.
Comment #9
bojanz commentedCommitted after a few more tweaks.
EDIT: Looks like the push is timing out. Will retry in the morning.
Comment #10.0
(not verified) commentedExpanded the text.