Automattic\WooCommerce\Internal\Email
OrderPriceFormatter::get_formatted_item_subtotal
Gets item subtotal - formatted for display in emails.
Method of the class: OrderPriceFormatter{}
No Hooks.
Returns
String. Formatted item subtotal.
Usage
$result = OrderPriceFormatter::get_formatted_item_subtotal( $order, $item, $tax_display ): string;
- $order(WC_Abstract_Order) (required)
- Order instance.
- $item(WC_Order_Item) (required)
- Item to get unit price from.
- $tax_display(string) (required)
- 'incl' or 'excl' tax display mode.
OrderPriceFormatter::get_formatted_item_subtotal() OrderPriceFormatter::get formatted item subtotal code WC 10.3.3
public static function get_formatted_item_subtotal( WC_Abstract_Order $order, WC_Order_Item $item, string $tax_display ): string {
$includes_tax = 'excl' !== $tax_display;
$item_subtotal = $order->get_item_subtotal( $item, $includes_tax );
return self::format_price( $order, $item_subtotal, $includes_tax );
}