Automattic\WooCommerce\Internal\Admin

CustomerEffortScoreTracks::enqueue_ces_survey_for_search()publicWC 1.0

Enqueue the CES survey on using search dynamically.

Method of the class: CustomerEffortScoreTracks{}

No Hooks.

Return

null. Nothing (null).

Usage

$CustomerEffortScoreTracks = new CustomerEffortScoreTracks();
$CustomerEffortScoreTracks->enqueue_ces_survey_for_search( $search_area, $page_now, $admin_page );
$search_area(string) (required)
Search area such as "product" or "shop_order".
$page_now(string) (required)
Value of window.pagenow.
$admin_page(string) (required)
Value of window.adminpage.

CustomerEffortScoreTracks::enqueue_ces_survey_for_search() code WC 9.3.3

public function enqueue_ces_survey_for_search( $search_area, $page_now, $admin_page ) {
	if ( $this->has_been_shown( self::SEARCH_ACTION_NAME ) ) {
		return;
	}

	$this->enqueue_to_ces_tracks(
		array(
			'action'         => self::SEARCH_ACTION_NAME,
			'title'          => __(
				'How easy was it to use search?',
				'woocommerce'
			),
			'firstQuestion'  => __(
				'The search feature in WooCommerce is easy to use.',
				'woocommerce'
			),
			'secondQuestion' => __(
				'The search\'s functionality meets my needs.',
				'woocommerce'
			),
			'onsubmit_label' => $this->onsubmit_label,
			'pagenow'        => $page_now,
			'adminpage'      => $admin_page,
			'props'          => (object) array(
				'search_area' => $search_area,
			),
		)
	);
}