Define an OrderItems widget leveraging our Inline Form API

Created on 22 November 2023, 10 months ago
Updated 22 August 2024, 25 days ago

Describe your bug or feature request.

Currently, we rely on the Inline entity form module and its "Inline entity form - Complex" widget for the order items widget editing on the order edit form.

This is the last piece of functionality within Commerce relying on IEF.
There is still no stable release of Inline Entity form, and we've got several bug reports to date because of the minimum-stability from composer project templates (See 📌 Update the Composer constraint for Inline Entity Form Fixed , 🐛 can't install commerce, error Closed: duplicate or 🐛 Commerce module installation fails on fresh drupal website Closed: duplicate and there are others).

As soon as we build our own widget, we should be able to drop the IEF dependency from the commerce.info.yml and we can update the widget on new installs.
Unfortunately, I don't really think we can remove the IEF dependency from the composer.json as the module is likely used elsewhere on existing installs.
We could either create a change record and drop the IEF dependency completely, or.. Just do this from the 3.x branch...
In any case, here's what needs to happen:

  • Define an "order_item" Inline form plugin.
  • Create an OrderItemsWidget from commerce_order leveraging the "order_item" Inline form plugin

The select list offering the order item type selection should take into account the "order type" setting at the order item type level. In other words, only order items using the order type being edited should be offered.

Perhaps we could take this opportunity to implement some improvements such as displaying the "SKU" in the order items table for instance... In a later phase, we could probably defining an additional widget that performs the add/edit/deletion from within modals, but I'd suggest to just stick with having the exact same feature rebuilt within Commerce.

Thoughts?

📌 Task
Status

Active

Version

3.0

Component

Order

Created by

🇮🇱Israel jsacksick

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @jsacksick
  • First commit to issue fork.
  • 🇮🇱Israel jsacksick

    One cool addition could be to change the UX for creating order items.
    For example, instead of offering an order item type select list, we could first require referencing the purchasable entity, and then call the the createFromPurchasableEntity() method, so that the order item type is determined based on the purchasable entity, rather than requiring a non technical user to figure out the right order item type to use.

    Could be great to investigate this alternative UX.

  • Pipeline finished with Success
    25 days ago
    Total: 453s
    #261738
  • Pipeline finished with Success
    18 days ago
    Total: 585s
    #268440
  • Pipeline finished with Failed
    11 days ago
    Total: 426s
    #275001
Production build 0.71.5 2024