WC_Importer_Tracking::track_product_importer_complete()publicWC 1.0

Send a Tracks event when the product importer has finished.

Method of the class: WC_Importer_Tracking{}

No Hooks.

Return

null. Nothing.

Usage

$WC_Importer_Tracking = new WC_Importer_Tracking();
$WC_Importer_Tracking->track_product_importer_complete();

WC_Importer_Tracking::track_product_importer_complete() code WC 7.7.0

public function track_product_importer_complete() {
	// phpcs:disable WordPress.Security.NonceVerification.Recommended
	if ( ! isset( $_REQUEST['nonce'] ) ) {
		return;
	}

	$properties = array(
		'imported' => isset( $_GET['products-imported'] ) ? absint( $_GET['products-imported'] ) : 0,
		'updated'  => isset( $_GET['products-updated'] ) ? absint( $_GET['products-updated'] ) : 0,
		'failed'   => isset( $_GET['products-failed'] ) ? absint( $_GET['products-failed'] ) : 0,
		'skipped'  => isset( $_GET['products-skipped'] ) ? absint( $_GET['products-skipped'] ) : 0,
	);
	// phpcs:enable

	WC_Tracks::record_event( 'product_import_complete', $properties );
}