Automattic\WooCommerce\Internal\Admin

CustomerEffortScoreTracks::add_script_track_product_categoriespublicWC 1.0

Appends a script to footer to trigger CES on adding product categories.

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

Хуков нет.

Возвращает

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

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

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

Код CustomerEffortScoreTracks::add_script_track_product_categories() WC 10.4.3

public function add_script_track_product_categories() {
	if ( $this->has_been_shown( self::ADD_PRODUCT_CATEGORIES_ACTION_NAME ) ) {
		return;
	}

	$handle = 'wc-tracks-customer-effort-score-product-categories';
	wp_register_script( $handle, '', array( 'jquery' ), WC_VERSION, true );
	wp_enqueue_script( $handle );
	wp_add_inline_script(
		$handle,
		$this->get_script_track_edit_php(
			self::ADD_PRODUCT_CATEGORIES_ACTION_NAME,
			__( 'How easy was it to add product category?', 'woocommerce' ),
			__( 'The product category details screen is easy to use.', 'woocommerce' ),
			__( "The product category details screen's functionality meets my needs.", 'woocommerce' )
		)
	);
}