Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Similar to the thrust of #2906024: Replace the cart block view with a Twig template, this allows the use of a twig template to render the order item table that is used in the order view, for instance to work around views limitations regarding non-product variation purchasable entities. Backwards-compatible as the default is to use the current view.
Also resolves an @todo
to allow the view to be configurable.
Comment | File | Size | Author |
---|
Issue fork commerce-3018517
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
bradjones1Forgot the new template file.
Comment #3
bradjones1Comment #6
bradjones1Adding formatter schema - who knew they had them!
Comment #8
bradjones1Fixes typo prompting test fail.
Comment #9
Hubbs CreditAttribution: Hubbs at Acro Commerce commentedTested patch functionality and it applies clean and works as expected. No issues found.
Could still use a code review.
Comment #10
Hubbs CreditAttribution: Hubbs at Acro Commerce commentedI found one functionality issue that should be addressed.
This patch allows us to select the View to use for the Order item table within the Order type's 'Manage display' settings. This aspect works great.
Where there is an issue is the same View is then also used when viewing an order as an admin via 'Admin menu > Commerce > Orders > Edit'. On the site frontend, the view can be styled and made to look however we want, but the same styling doesn't come through to the admin theme. There is massive potential for the backend admin order item table to appear broken. I'm actually experiencing this right now.
A proposed solution would be to also allow the selection of the View to use within the Order type's 'Manage form display' (I think) or to simply just use the default View in the admin area.
Comment #11
bradjones1@Hubbs - thanks for the review and thoughts regarding views.
I'm of the opinion that if an admin is going to be selecting/changing views for Commerce components, they should know about the limitations regarding theming, and providing safeguards against this case is out of scope for what would be needed here, but perhaps I'm wrong.
Perhaps a maintainer can relay their thoughts on this, particularly since the goal here is to further decopule Commerce from views entirely.
Comment #12
bradjones1Re-rolled for 2.13.
Would still like to get input from a maintainer on the questions above.
Comment #13
bradjones1Re-rolled for -dev (basically 2.14)
Comment #15
bradjones1Re-rolled into an MR.
Comment #16
bradjones1Probably needs rework to track changes similar to what was done in #3119159: commerce_order_item_table needs to filter out orphan order items