Automattic\WooCommerce\Admin\Features\Blueprint\Exporters

ExportWCSettingsShipping::get_steps_for_zonesprivateWC 1.0

Retrieve shipping zones from the database.

Method of the class: ExportWCSettingsShipping{}

No Hooks.

Returns

Array. Steps for shipping zones.

Usage

// private - for code of main (parent) class only
$result = $this->get_steps_for_zones(): array;

ExportWCSettingsShipping::get_steps_for_zones() code WC 9.9.5

private function get_steps_for_zones(): array {
	global $wpdb;

	return array_map(
		fn( $zone ) => new RunSql( Util::array_to_insert_sql( $zone, $wpdb->prefix . 'woocommerce_shipping_zones', 'replace into' ) ),
		$wpdb->get_results( "SELECT * FROM {$wpdb->prefix}woocommerce_shipping_zones", ARRAY_A )
	);
}