WC_Cart::get_product_price()publicWC 1.0

Get the product row price per item.

Method of the class: WC_Cart{}

Hooks from the method

Return

String. formatted price

Usage

$WC_Cart = new WC_Cart();
$WC_Cart->get_product_price( $product );
$product(WC_Product) (required)
Product object.

WC_Cart::get_product_price() code WC 9.4.2

public function get_product_price( $product ) {
	if ( $this->display_prices_including_tax() ) {
		$product_price = wc_get_price_including_tax( $product );
	} else {
		$product_price = wc_get_price_excluding_tax( $product );
	}
	return apply_filters( 'woocommerce_cart_product_price', wc_price( $product_price ), $product );
}