get( CheckoutFields::class )->get_order_additional_fields_with_values( $order, 'contact' ), Package::container()->get( CheckoutFields::class )->get_order_additional_fields_with_values( $order, 'order' ) ); return empty( $additional_field_values ) ? '' : $content; } /** * Extra data passed through from server to client for block. * * @param array $attributes Any attributes that currently are available from the block. * Note, this will be empty in the editor context when the block is * not in the post content on editor load. */ protected function enqueue_data( array $attributes = [] ) { parent::enqueue_data( $attributes ); $order_fields = Package::container()->get( CheckoutFields::class )->get_fields_for_location( 'order' ); $this->asset_data_registry->add( 'additionalFields', $order_fields ); $this->asset_data_registry->add( 'additionalOrderFields', $order_fields ); $this->asset_data_registry->add( 'additionalContactFields', Package::container()->get( CheckoutFields::class )->get_fields_for_location( 'contact' ) ); } }