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

Comments

roam2345’s picture

Status: Needs work » Active
StatusFileSize
new1.12 KB

Here 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.

roam2345’s picture

Status: Active » Needs work

change statue to reflect the patch still needs some work.

roam2345’s picture

StatusFileSize
new7.25 KB

Fixed the bum patch that missed the additional file.

roam2345’s picture

Status: Active » Needs work
StatusFileSize
new11.3 KB

Some 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.

roam2345’s picture

Version: » 7.x-1.x-dev
Status: Needs work » Needs review

rolled against 0f32fcce1fbbeb497a7817b54f998a5b7ab97e5d

bojanz’s picture

Hey, 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.

roam2345’s picture

StatusFileSize
new6.88 KB

Here 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.

bojanz’s picture

StatusFileSize
new8.74 KB

Here'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.

bojanz’s picture

Status: Needs review » Fixed

Committed after a few more tweaks.

EDIT: Looks like the push is timing out. Will retry in the morning.

Status: Fixed » Closed (fixed)

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

Anonymous’s picture

Issue summary: View changes

Expanded the text.