Automattic\WooCommerce\Admin\Features\OnboardingTasks\Tasks

Purchase::get_paid_products_and_themes()public staticWC 1.0

Get purchaseable and remaining products.

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

No Hooks.

Return

Array. purchaseable and remaining products and themes.

Usage

$result = Purchase::get_paid_products_and_themes();

Code of Purchase::get_paid_products_and_themes() WC 6.7.0

public static function get_paid_products_and_themes() {
	$relevant_products = OnboardingProducts::get_relevant_products();

	$profiler_data = get_option( OnboardingProfile::DATA_OPTION, array() );
	$theme         = isset( $profiler_data['theme'] ) ? $profiler_data['theme'] : null;
	$paid_theme    = $theme ? OnboardingThemes::get_paid_theme_by_slug( $theme ) : null;
	if ( $paid_theme ) {

		$relevant_products['purchaseable'][] = $paid_theme;

		if ( isset( $paid_theme['is_installed'] ) && false === $paid_theme['is_installed'] ) {
			$relevant_products['remaining'][] = $paid_theme['title'];
		}
	}
	return $relevant_products;
}