Automattic\WooCommerce\Admin\API

OnboardingTasks::is_experiment_product_task()publicWC 1.0

Method of the class: OnboardingTasks{}

No Hooks.

Return

null. Nothing (null).

Usage

$OnboardingTasks = new OnboardingTasks();
$OnboardingTasks->$template_path = __DIR__ . '/Templates/' . $template_name . '_product.csv';

OnboardingTasks::is_experiment_product_task() code WC 8.7.0

$template_path = __DIR__ . '/Templates/' . $template_name . '_product.csv';
$template_path = apply_filters( 'woocommerce_product_template_csv_file_path', $template_path, $template_name );

$import = self::import_sample_products_from_csv( $template_path );

if ( is_wp_error( $import ) || ! is_array( $import['imported'] ) || 0 === count( $import['imported'] ) ) {
	return new \WP_Error(
		'woocommerce_rest_product_creation_error',
		/* translators: %s is template name */
		__( 'Sorry, creating the product with template failed.', 'woocommerce' ),
		array( 'status' => 500 )