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

Command icon 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

damienmckenna created an issue. See original summary.

damienmckenna’s picture

Status: Active » Needs review

Instead of looking for specific entitytype.field combinations it now checks for the field "order_id".

jsacksick’s picture

Version: 3.0.x-dev » 3.x-dev
Status: Needs review » Needs work

Merge requests must be on 3.x (not 3.0.x). Also, this file has recently changed to support order item ID arguments as well.

damienmckenna’s picture

Status: Needs work » Needs review

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

jsacksick’s picture

Status: Needs review » Fixed

Merged, thanks!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

damienmckenna’s picture

Thank you for the quick follow-up!

Status: Fixed » Closed (fixed)

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