It would be useful to be able to theme Order Adjustments individually to highlight/hide items as required.
Adding a class based on the label would make this easier & more reliable for most types and makes it 'do-able' in css instead of js.
Patch to follow.
Comments
Comment #2
andyd328Patch adds a class to each Adjustment in the form
order-total-line__adjustment--gst
using the twig template commerce-order-total-summary
Let me know if there's a better way or style to do this, happy to rework it.
Thanks!
Comment #3
andyd328Comment #4
andyd328Had another use for this patch, it seems it would be much better to add the adjustment Type and SourceId as classes and not the label.
Patch attached.
Comment #5
bojanz commentedMarked #3031826: Add adjustment type class for theming purpose on commerce order total summary as duplicate.
I definitely agree with adding a class for the adjustment type.
Unsure about the source though, cause the source ID is sometimes numeric (promotions, fees, shipping). It's only ever useful for taxes, but I'm not convinced there's a majority use case for styling one tax differently from the other?
Comment #6
finex commented@bojanz: IMHO styling different taxes is not probably as useful as styling adjustment types.
Comment #7
andyd328Thanks for the feedback.
I agree that the adjustment type is really the key item here, but if you did need to separate the sub types of taxes/adjustments you wouldn't be able to without the source as well.
For my uses just being able to identify the type works so happy to go with or without source. Patch attached with only adjustment type, also removed white space around twig | filter
Comment #9
bojanz commentedCommitted, thanks!