WordPress at Your Fingertips
function is not described

WC_Product::get_availability_text() protected WC 1.0

Get availability text based on stock status.

{} It's a method of the class: WC_Product{}

Hooks from the method
Return

String.

Usage

// protected - for code of main (parent) or child class
$result = $this->get_availability_text();

Code of WC_Product::get_availability_text() WC 5.5.2

<?php
protected function get_availability_text() {
	if ( ! $this->is_in_stock() ) {
		$availability = __( 'Out of stock', 'woocommerce' );
	} elseif ( $this->managing_stock() && $this->is_on_backorder( 1 ) ) {
		$availability = $this->backorders_require_notification() ? __( 'Available on backorder', 'woocommerce' ) : '';
	} elseif ( ! $this->managing_stock() && $this->is_on_backorder( 1 ) ) {
		$availability = __( 'Available on backorder', 'woocommerce' );
	} elseif ( $this->managing_stock() ) {
		$availability = wc_format_stock_for_display( $this );
	} else {
		$availability = '';
	}
	return apply_filters( 'woocommerce_get_availability_text', $availability, $this );
}