Automattic\WooCommerce\Internal\Admin

CustomerEffortScoreTracks::enqueue_ces_survey_for_search()publicWC 1.0

Enqueue the CES survey on using search dynamically.

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

Хуков нет.

Возвращает

null. Ничего (null).

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

$CustomerEffortScoreTracks = new CustomerEffortScoreTracks();
$CustomerEffortScoreTracks->enqueue_ces_survey_for_search( $search_area, $page_now, $admin_page );
$search_area(строка) (обязательный)
Search area such as "product" or "shop_order".
$page_now(строка) (обязательный)
Value of window.pagenow.
$admin_page(строка) (обязательный)
Value of window.adminpage.

Код CustomerEffortScoreTracks::enqueue_ces_survey_for_search() 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,
			),
		)
	);
}