WC_REST_System_Status_V2_Controller::get_settings()publicWC 1.0

Get some setting values for the site that are useful for debugging purposes. For full settings access, use the settings api.

Method of the class: WC_REST_System_Status_V2_Controller{}

No Hooks.

Return

Array.

Usage

$WC_REST_System_Status_V2_Controller = new WC_REST_System_Status_V2_Controller();
$WC_REST_System_Status_V2_Controller->get_settings();

WC_REST_System_Status_V2_Controller::get_settings() code WC 8.7.0

public function get_settings() {
	// Get a list of terms used for product/order taxonomies.
	$term_response = array();
	$terms         = get_terms( 'product_type', array( 'hide_empty' => 0 ) );
	foreach ( $terms as $term ) {
		$term_response[ $term->slug ] = strtolower( $term->name );
	}

	// Get a list of terms used for product visibility.
	$product_visibility_terms = array();
	$terms                    = get_terms( 'product_visibility', array( 'hide_empty' => 0 ) );
	foreach ( $terms as $term ) {
		$product_visibility_terms[ $term->slug ] = strtolower( $term->name );
	}

	// Return array of useful settings for debugging.
	return array(
		'api_enabled'                    => 'yes' === get_option( 'woocommerce_api_enabled' ),
		'force_ssl'                      => 'yes' === get_option( 'woocommerce_force_ssl_checkout' ),
		'currency'                       => get_woocommerce_currency(),
		'currency_symbol'                => get_woocommerce_currency_symbol(),
		'currency_position'              => get_option( 'woocommerce_currency_pos' ),
		'thousand_separator'             => wc_get_price_thousand_separator(),
		'decimal_separator'              => wc_get_price_decimal_separator(),
		'number_of_decimals'             => wc_get_price_decimals(),
		'geolocation_enabled'            => in_array(
			get_option( 'woocommerce_default_customer_address' ),
			array(
				'geolocation_ajax',
				'geolocation',
			),
			true
		),
		'taxonomies'                     => $term_response,
		'product_visibility_terms'       => $product_visibility_terms,
		'woocommerce_com_connected'      => ConnectionHelper::is_connected() ? 'yes' : 'no',
		'enforce_approved_download_dirs' => wc_get_container()->get( Download_Directories::class )->get_mode() === Download_Directories::MODE_ENABLED,
		'order_datastore'                => WC_Data_Store::load( 'order' )->get_current_class_name(),
		'HPOS_feature_screen_enabled'    => wc_get_container()->get( Automattic\WooCommerce\Internal\Features\FeaturesController::class )->feature_is_enabled( 'custom_order_tables' ),
		'HPOS_enabled'                   => OrderUtil::custom_orders_table_usage_is_enabled(),
		'HPOS_sync_enabled'              => wc_get_container()->get( Order_DataSynchronizer::class )->data_sync_is_enabled(),
	);
}