= $escaper->escapeHtml($label) ?>
= /* @noEscape */ implode('', array_map([$escaper, 'escapeHtml'], $formatAddress($address))) ?: $escaper->escapeHtml('-') ?>
getOrder(); $items = $block->getItems(); $shipping = $block->decodeAddress($order['shipping_address'] ?? null); $billing = $block->decodeAddress($order['billing_address'] ?? null); $currency = (string)($order['currency'] ?? ''); $discountAmount = abs((float)($order['discount_amount'] ?? 0)); $couponCode = trim((string)($order['coupon'] ?? '')); $hasDiscount = $discountAmount > 0.0001 || $couponCode !== ''; $formatMoney = static fn ($value): string => number_format((float)$value, 2, '.', ','); $formatQty = static fn ($value): string => (string)(int)round((float)$value); $formatAddress = static function (array $address): array { return array_values(array_filter([ $address['name'] ?? '', trim((string)($address['street'] ?? '') . ' ' . (string)($address['unit'] ?? '')), trim((string)($address['city'] ?? '') . ' ' . (string)($address['region'] ?? '') . ' ' . (string)($address['postcode'] ?? '')), $address['country'] ?? '', $address['telephone'] ?? '', ], static fn ($value): bool => trim((string)$value) !== '')); }; ?>
= $escaper->escapeHtml(__('Placed on %1', $order['ordered_at'] ?: '-')) ?>
| = $escaper->escapeHtml(__('Product')) ?> | = $escaper->escapeHtml(__('SKU')) ?> | = $escaper->escapeHtml(__('Price')) ?> | = $escaper->escapeHtml(__('Qty')) ?> | = $escaper->escapeHtml(__('Subtotal')) ?> |
|---|---|---|---|---|
| = $escaper->escapeHtml($item['product_name'] ?: $item['sku']) ?> | = $escaper->escapeHtml($item['sku']) ?> | = $escaper->escapeHtml(trim($currency . ' ' . $formatMoney($item['price']))) ?> | = $escaper->escapeHtml($formatQty($item['qty'])) ?> | = $escaper->escapeHtml(trim($currency . ' ' . $formatMoney($item['row_total']))) ?> |
| = $escaper->escapeHtml(__('Product Subtotal')) ?> | = $escaper->escapeHtml(trim($currency . ' ' . $formatMoney($order['product_total'] ?? 0))) ?> | |||
| = $escaper->escapeHtml(__('Discount')) ?> = $escaper->escapeHtml(__('Coupon: %1', $couponCode)) ?> | -= $escaper->escapeHtml(trim($currency . ' ' . $formatMoney($discountAmount))) ?> | |||
| = $escaper->escapeHtml(__('Shipping')) ?> | = $escaper->escapeHtml(trim($currency . ' ' . $formatMoney($order['shipping_amount']))) ?> | |||
| = $escaper->escapeHtml(__('Tax')) ?> | = $escaper->escapeHtml(trim($currency . ' ' . $formatMoney($order['tax_amount']))) ?> | |||
| = $escaper->escapeHtml(__('Fee')) ?> | = $escaper->escapeHtml(trim($currency . ' ' . $formatMoney($order['fee_amount']))) ?> | |||
| = $escaper->escapeHtml(__('Grand Total')) ?> | = $escaper->escapeHtml(trim($currency . ' ' . $formatMoney($order['grand_total'] ?? 0))) ?> | |||
= $escaper->escapeHtml($order['shipping_method'] ?: '-') ?>
= $escaper->escapeHtml(__('Carrier: %1', $order['carrier'])) ?>= $escaper->escapeHtml($order['payment_method'] ?: '-') ?>
= $escaper->escapeHtml(__('Transaction: %1', $order['payment_transaction_id'])) ?>