Views support for adjustments

Created on 29 January 2017, over 8 years ago
Updated 17 June 2025, about 2 months ago

I'd like to be able to display adjustments in order and order item views.

See https://github.com/drupalcommerce/commerce/pull/622.

✨ Feature request
Status

Closed: won't fix

Version

2.0

Component

Views integration

Created by

πŸ‡ΊπŸ‡ΈUnited States steveoliver

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States AaronBauman Philadelphia

    Reviving this because I'd like to add shipping and tax to the orders view.

    There are two "Adjustment" fields that show up in views - for Orders and Order Items - but they don't render anything.

    Is Commerce supporting adjustments in views now?
    And if not, is it still too painful to add support?

  • πŸ‡ΊπŸ‡ΈUnited States lisastreeter

    A possible alternative to adding Views support for adjustment fields is to add two new Price fields to your order type for "ShippingTotal" and "TaxTotal" and then create a late-running order processor to update those fields by calculating totals for the shipping and tax adjustment types. Using the collectAdjustments() Order method gets you both the order and order item adjustments. You'd just need to iterate through the adjustments to calculate the total and save it to each of the two total fields. Then you could include those fields in any Views.

    If you need to display more details about the adjustments (instead of just the total amount), you could do something similar to populate some other standard field type.

Production build 0.71.5 2024