Automattic\WooCommerce\Internal\Admin

CustomerEffortScoreTracks::run_on_product_import()publicWC 1.0

Maybe enqueue the CES survey on product import, if step is done.

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

Хуков нет.

Возвращает

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

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

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

Код CustomerEffortScoreTracks::run_on_product_import() WC 8.7.0

public function run_on_product_import() {
	// We're only interested in when the importer completes.
	if ( empty( $_GET['step'] ) || 'done' !== $_GET['step'] ) { // phpcs:ignore CSRF ok.
		return;
	}

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

	$this->enqueue_to_ces_tracks(
		array(
			'action'         => self::IMPORT_PRODUCTS_ACTION_NAME,
			'title'          => __(
				'How easy was it to import products?',
				'woocommerce'
			),
			'firstQuestion'  => __(
				'The product import process is easy to complete.',
				'woocommerce'
			),
			'secondQuestion' => __(
				'The product import process meets my needs.',
				'woocommerce'
			),
			'onsubmit_label' => $this->onsubmit_label,
			'pagenow'        => 'product_page_product_importer',
			'adminpage'      => 'product_page_product_importer',
			'props'          => (object) array(),
		)
	);
}