WC_Abstract_Order::get_formatted_line_subtotal()
Gets line subtotal - formatted for display.
Метод класса: WC_Abstract_Order{}
Хуки из метода
Возвращает
Строку
.
Использование
$WC_Abstract_Order = new WC_Abstract_Order(); $WC_Abstract_Order->get_formatted_line_subtotal( $item, $tax_display );
- $item(объект) (обязательный)
- Item to get total from.
- $tax_display(строка)
- Incl or excl tax display mode.
По умолчанию: ''
Код WC_Abstract_Order::get_formatted_line_subtotal() WC Abstract Order::get formatted line subtotal WC 9.7.1
public function get_formatted_line_subtotal( $item, $tax_display = '' ) { $tax_display = $tax_display ? $tax_display : get_option( 'woocommerce_tax_display_cart' ); if ( 'excl' === $tax_display ) { $ex_tax_label = $this->get_prices_include_tax() ? 1 : 0; $subtotal = wc_price( $this->get_line_subtotal( $item ), array( 'ex_tax_label' => $ex_tax_label, 'currency' => $this->get_currency(), ) ); } else { $subtotal = wc_price( $this->get_line_subtotal( $item, true ), array( 'currency' => $this->get_currency() ) ); } return apply_filters( 'woocommerce_order_formatted_line_subtotal', $subtotal, $item, $this ); }