Automattic\WooCommerce\Internal\Admin

CustomerEffortScoreTracks::run_on_update_options()publicWC 1.0

Enqueue the CES survey trigger for setting changes.

Method of the class: CustomerEffortScoreTracks{}

No Hooks.

Return

null. Nothing (null).

Usage

$CustomerEffortScoreTracks = new CustomerEffortScoreTracks();
$CustomerEffortScoreTracks->run_on_update_options();

CustomerEffortScoreTracks::run_on_update_options() code WC 8.7.0

public function run_on_update_options() {
	// $current_tab is set when WC_Admin_Settings::save_settings is called.
	global $current_tab;
	global $current_section;

	if ( $this->has_been_shown( self::SETTINGS_CHANGE_ACTION_NAME ) ) {
		return;
	}

	$props = array(
		'settings_area' => $current_tab,
	);

	if ( $current_section ) {
		$props['settings_section'] = $current_section;
	}

	$this->enqueue_to_ces_tracks(
		array(
			'action'         => self::SETTINGS_CHANGE_ACTION_NAME,
			'title'          => __(
				'How easy was it to update your settings?',
				'woocommerce'
			),
			'firstQuestion'  => __(
				'The settings screen is easy to use.',
				'woocommerce'
			),
			'secondQuestion' => __(
				'The settings screen\'s functionality meets my needs.',
				'woocommerce'
			),
			'onsubmit_label' => $this->onsubmit_label,
			'pagenow'        => 'woocommerce_page_wc-settings',
			'adminpage'      => 'woocommerce_page_wc-settings',
			'props'          => (object) $props,
		)
	);
}