- πΊπΈ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
andtax
adjustment types. Using thecollectAdjustments()
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.