Automattic\WooCommerce\Internal\ProductFeed\Mapping

UcpProductMapper::build_variant_list_price │ private │ WC 1.0

Build a variant's list price when it is genuinely discounted.

Compares against the effective price so expired or scheduled sales are excluded.

Метод класса: UcpProductMapper{}

Хуков нет.

Возвращает

array|null.

Использование

// private - только в коде основоного (родительского) класса
$result = $this->build_variant_list_price( $prices, $currency );
$prices(массив) (обязательный)
Store API prices data.
$currency(строка) (обязательный)
ISO 4217 currency code.

Код UcpProductMapper::build_variant_list_price() WC 11.3.0

private function build_variant_list_price( $prices, string $currency ) {
	if ( (int) $prices['regular_price'] <= (int) $prices['price'] ) {
		return null;
	}

	return $this->price( $prices['regular_price'], $currency );
}