Automattic\WooCommerce\Admin\Features\Blueprint\Importers

ImportSetWCTaxRates::process()publicWC 1.0

Process the import of WooCommerce tax rates.

Method of the class: ImportSetWCTaxRates{}

No Hooks.

Return

StepProcessorResult.

Usage

$ImportSetWCTaxRates = new ImportSetWCTaxRates();
$ImportSetWCTaxRates->process( $schema ): StepProcessorResult;
$schema(object) (required)
The schema object containing import details.

ImportSetWCTaxRates::process() code WC 9.7.1

public function process( $schema ): StepProcessorResult {
	$this->result = StepProcessorResult::success( SetWCTaxRates::get_step_name() );

	foreach ( $schema->values->rates as $rate ) {
		$this->add_rate( $rate );
	}

	foreach ( $schema->values->locations as $location ) {
		$this->add_location( $location );
	}

	return $this->result;
}