Problem/Motivation
When displaying data from other data sources, e.g. order shipments, it is possible to have the order as a relationship in the view and the order ID as a contextual filter based upon that relationship. When this happens the Order Total plugin doesn't work as it's hardcoded to only work with three of Commerce core's entity types.
Proposed resolution
Expand the logic in OrderTotal::render() to check to see if one of the arguments is "order_id", ignoring the base entity it comes from.
Remaining tasks
Provide a patch/MR.
User interface changes
It will be possible to use the Order Total plugin on any view that has Order ID as an argument, not just with a few entity types from Commerce core.
API changes
n/a
Data model changes
n/a
Issue fork commerce-3570972
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 #3
damienmckennaInstead of looking for specific entitytype.field combinations it now checks for the field "order_id".
Comment #4
jsacksick commentedMerge requests must be on 3.x (not 3.0.x). Also, this file has recently changed to support order item ID arguments as well.
Comment #6
damienmckennaAh, thank you for pointing that out.
I've created a new MR against 3.x and updated the handling of order_item_id to work the same.
Comment #8
jsacksick commentedMerged, thanks!
Comment #10
damienmckennaThank you for the quick follow-up!