Automattic\WooCommerce\Internal\DataStores\Orders

OrdersTableDataStore::update_address_index_meta()privateWC 1.0

Helper function to update billing and shipping address metadata.

Method of the class: OrdersTableDataStore{}

No Hooks.

Return

null. Nothing.

Usage

// private - for code of main (parent) class only
$result = $this->update_address_index_meta( $order, $changes );
$order(\WC_Abstract_Order) (required)
Order Object
$changes(array) (required)
Array of changes.

OrdersTableDataStore::update_address_index_meta() code WC 7.1.0

private function update_address_index_meta( $order, $changes ) {
	// If address changed, store concatenated version to make searches faster.
	foreach ( array( 'billing', 'shipping' ) as $address_type ) {
		if ( isset( $changes[ $address_type ] ) ) {
			$order->update_meta_data( "_{$address_type}_address_index", implode( ' ', $order->get_address( $address_type ) ) );
		}
	}
}