Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
We need a Resolved Price price field formatter. This will show the resolved price (discounted, sale, whatever). It should also have a setting to show the original price.
Comment | File | Size | Author |
---|---|---|---|
#7 | create_a_calculated-2803241-7.patch | 352.33 KB | mglaman |
#4 | create_a_calculated-2803241-4.patch | 7.42 KB | mglaman |
Comments
Comment #2
mglamanComment #3
mglamanDiscussed with bojanz. Since this will have the ability to show taxes that are included, renaming to PriceCalculatedFormatter, "Calculated".
Comment #4
mglamanInitial WIP from before.
Comment #5
bojanz CreditAttribution: bojanz at Centarro commentedI think it makes sense to extend the Default formatter to reduce code.
Comment #6
mglamanDiscussed w/ bojanz. Going to remove the "show original price" option to reduce complexity when working with multiple currencies.
Comment #7
mglamanExtended base class, uses price resolver.
We should add tests
Comment #9
bojanz CreditAttribution: bojanz at Centarro commentedHere we go.
Comment #10
agoradesign CreditAttribution: agoradesign commentedbtw, the 'show_original_price' key is still present in field.formatter.settings.commerce_price_calculated schema definition, although not used (or is it??)
Comment #12
hockey2112 CreditAttribution: hockey2112 commentedWas this committed? It appears that it is not available in Commerce 8.x-2.24. For example, the commerce_cart_services.yml still contains "class: Drupal\commerce_cart\OrderItemMatcher" instead of "class: Drupal\commerce_cart\LineItemMatcher".
Comment #13
mglamanYes. We renamed LineItems to OrderItems after this. Look for "Calculated price" field formatter.
Comment #14
hockey2112 CreditAttribution: hockey2112 commentedAh, got it, thanks! Is there any way to break out and display just the tax amount on a per-product or per-order basis in Views?