Automattic\WooCommerce\Internal\Admin
CustomerEffortScoreTracks::run_on_product_import
Maybe enqueue the CES survey on product import, if step is done.
Method of the class: CustomerEffortScoreTracks{}
No Hooks.
Returns
null. Nothing (null).
Usage
$CustomerEffortScoreTracks = new CustomerEffortScoreTracks(); $CustomerEffortScoreTracks->run_on_product_import();
CustomerEffortScoreTracks::run_on_product_import() CustomerEffortScoreTracks::run on product import code WC 10.3.3
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(),
)
);
}