Automattic\WooCommerce\Blocks\BlockTypes
MiniCart::get_cart_price_markup()
Returns the markup for the cart price.
Метод класса: MiniCart{}
Хуков нет.
Возвращает
Строку
.
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->get_cart_price_markup( $attributes );
- $attributes(массив) (обязательный)
- Block attributes.
Код MiniCart::get_cart_price_markup() MiniCart::get cart price markup WC 7.7.0
protected function get_cart_price_markup( $attributes ) { if ( isset( $attributes['hasHiddenPrice'] ) && false !== $attributes['hasHiddenPrice'] ) { return; } $cart = $this->get_cart_instance(); $cart_contents_total = $cart->get_subtotal(); if ( $cart->display_prices_including_tax() ) { $cart_contents_total += $cart->get_subtotal_tax(); } return '<span class="wc-block-mini-cart__amount">' . esc_html( wp_strip_all_tags( wc_price( $cart_contents_total ) ) ) . '</span> ' . $this->get_include_tax_label_markup(); }