there is a file named PriceCalculatedFormatter.php but it doesn't appear in the list within views.
This is because that formatter implements this method:
public static function isApplicable(FieldDefinitionInterface $field_definition) { $entity_type = \Drupal::entityTypeManager()->getDefinition($field_definition->getTargetEntityTypeId()); return $entity_type->entityClassImplements(PurchasableEntityInterface::class); }
That method indicates that the formatter will not be offered as an option if the price field is not on a purchasable entity (i.e. Product Variation); the total price and unit price fields that you see in the cart view are fields on the Order Item.
The rationale is explained in a comment on #3190313-6: Calculated price field formatter on products does not consider coupons that the user has applied → :
The calculated price formatter was never designed to show discounts coming from coupons. In fact, it was never designed to be used in a real order / cart context. The cart knows all of its discounts and coupons, it doesn't need the calculated price formatter to repeat the calculations. The point of the formatter is to show a product in the catalog with a valid offer applied (e.g. price list for that day/customer, discount for that product category, etc).
I think the implication is that Commerce Core is designed to calculate all adjustments, across all line items, in one shot and then display all of them in a single flat list as components of the order total.