# woocommerce-pos/1.10.1/includes/Templates/Adapters/Html_Output_Adapter.php

WCPOS – Point of Sale (POS) plugin for WooCommerce, version 1.10.1. 41 lines.

- Page: https://pluginprobe.com/plugins/woocommerce-pos/1.10.1/code/includes/Templates/Adapters/Html_Output_Adapter.php
- Raw: https://pluginprobe.com/plugins/woocommerce-pos/1.10.1/raw/includes/Templates/Adapters/Html_Output_Adapter.php
- Modified: 2026-05-15T18:12:48+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/woocommerce-pos/1.10.1/code/includes/Templates/Adapters/Html_Output_Adapter.php#L10-L20`.

```php
<?php
/**
 * HTML output adapter.
 *
 * @package WCPOS\WooCommercePOS\Templates\Adapters
 */

namespace WCPOS\WooCommercePOS\Templates\Adapters;

use WCPOS\WooCommercePOS\Interfaces\Receipt_Output_Adapter_Interface;

/**
 * Html_Output_Adapter class.
 */
class Html_Output_Adapter implements Receipt_Output_Adapter_Interface {
	/**
	 * Transform receipt payload to HTML representation.
	 *
	 * @param array $receipt_data Canonical payload.
	 * @param array $context      Optional context.
	 *
	 * @return string
	 */
	public function transform( array $receipt_data, array $context = array() ): string {
		if ( isset( $context['html'] ) && \is_string( $context['html'] ) ) {
			return wp_kses_post( $context['html'] );
		}

		$order_number = isset( $receipt_data['order']['number'] ) ? (string) $receipt_data['order']['number'] : '';
		$total        = isset( $receipt_data['totals']['total_incl'] ) ? (float) $receipt_data['totals']['total_incl'] : 0;

		return sprintf(
			'<div class="wcpos-receipt" data-order="%s"><strong>%s</strong>: %s</div>',
			esc_attr( $order_number ),
			/* translators: Short WCPOS UI label; keep concise. */
			esc_html__( 'Order', 'woocommerce-pos' ),
			wp_kses_post( wc_price( $total ) )
		);
	}
}

```
