PluginProbe
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler / 1.6.5
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler v1.6.5
1.6.5 1.6.4 1.6.3 1.6.2 1.6.1 1.6.0 1.5.4 1.5.5 1.5.3 1.5.2 1.5.1 1.5.0 1.4.2 1.4.1 1.4.0 1.3.28 1.3.27 1.3.26 1.3.25 1.3.23 1.3.22 1.3.21 1.3.20 1.3.19 trunk All 48 releases
← All changes | app/Services/PDF/DefaultPdfStructures.php +54 -41 1.4.1 → 1.6.5 View file →
@@ -54,24 +54,24 @@
54 54 private static function buildReceiptBlocks(): array
55 55 {
56 56 $blocks = [];
57 57
58 - $blocks[] = self::header('RECEIPT');
58 + $blocks[] = self::header(__('RECEIPT', 'fluent-cart'));
59 59 $blocks[] = self::addressColumns();
60 60 $blocks[] = self::metaTable([
61 - 'Order Number' => '{{order.invoice_no}}',
62 - 'Order Date' => '{{order.created_at}}',
63 - 'Payment Method' => '{{order.payment_method_title}}',
64 - 'Payment Status' => '{{order.payment_status}}',
61 + __('Order Number', 'fluent-cart') => '{{order.invoice_no}}',
62 + __('Order Date', 'fluent-cart') => '{{order.created_at}}',
63 + __('Payment Method', 'fluent-cart') => '{{order.payment_method_title}}',
64 + __('Payment Status', 'fluent-cart') => '{{order.payment_status}}',
65 65 ]);
66 66 $blocks[] = self::itemsTable();
67 67 $blocks[] = self::summaryTable([
68 - 'Subtotal' => '{{order.subtotal_formatted}}',
69 - 'Discount' => '{{order.discount_total_formatted}}',
70 - 'Fees' => '{{order.fee_lines}}',
71 - 'Tax' => '{{order.tax_breakdown}}',
72 - 'Shipping' => '{{order.shipping_total_formatted}}',
73 - ], 'Total', '{{order.total_amount_formatted}}');
68 + __('Subtotal', 'fluent-cart') => '{{order.subtotal_formatted}}',
69 + __('Discount', 'fluent-cart') => '{{order.discount_total_formatted}}',
70 + __('Fees', 'fluent-cart') => '{{order.fee_lines}}',
71 + __('Tax', 'fluent-cart') => '{{order.tax_breakdown}}',
72 + __('Shipping', 'fluent-cart') => '{{order.shipping_total_formatted}}',
73 + ], __('Total', 'fluent-cart'), '{{order.total_amount_formatted}}');
74 74 $blocks[] = self::footer(__('Thank you for your purchase!', 'fluent-cart'));
75 75
76 76 return $blocks;
77 77 }
@@ -94,23 +94,23 @@
94 94 private static function buildRenewalReceiptBlocks(): array
95 95 {
96 96 $blocks = [];
97 97
98 - $blocks[] = self::header('RENEWAL RECEIPT');
98 + $blocks[] = self::header(__('RENEWAL RECEIPT', 'fluent-cart'));
99 99 $blocks[] = self::addressColumns();
100 100 $blocks[] = self::metaTable([
101 - 'Order Number' => '{{order.invoice_no}}',
102 - 'Renewal Date' => '{{order.created_at}}',
103 - 'Payment Method' => '{{order.payment_method_title}}',
104 - 'Payment Status' => '{{order.payment_status}}',
101 + __('Order Number', 'fluent-cart') => '{{order.invoice_no}}',
102 + __('Renewal Date', 'fluent-cart') => '{{order.created_at}}',
103 + __('Payment Method', 'fluent-cart') => '{{order.payment_method_title}}',
104 + __('Payment Status', 'fluent-cart') => '{{order.payment_status}}',
105 105 ]);
106 106 $blocks[] = self::itemsTable();
107 107 $blocks[] = self::summaryTable([
108 - 'Subtotal' => '{{order.subtotal_formatted}}',
109 - 'Discount' => '{{order.discount_total_formatted}}',
110 - 'Fees' => '{{order.fee_lines}}',
111 - 'Tax' => '{{order.tax_breakdown}}',
112 - ], 'Total', '{{order.total_amount_formatted}}');
108 + __('Subtotal', 'fluent-cart') => '{{order.subtotal_formatted}}',
109 + __('Discount', 'fluent-cart') => '{{order.discount_total_formatted}}',
110 + __('Fees', 'fluent-cart') => '{{order.fee_lines}}',
111 + __('Tax', 'fluent-cart') => '{{order.tax_breakdown}}',
112 + ], __('Total', 'fluent-cart'), '{{order.total_amount_formatted}}');
113 113 $blocks[] = self::footer(__('Thank you for your continued subscription!', 'fluent-cart'));
114 114
115 115 return $blocks;
116 116 }
@@ -135,19 +135,19 @@
135 135 private static function buildRefundNoticeBlocks(): array
136 136 {
137 137 $blocks = [];
138 138
139 - $blocks[] = self::header('REFUND NOTICE');
140 - $blocks[] = self::addressColumns('REFUND TO');
139 + $blocks[] = self::header(__('REFUND NOTICE', 'fluent-cart'));
140 + $blocks[] = self::addressColumns(__('REFUND TO', 'fluent-cart'));
141 141 $blocks[] = self::metaTable([
142 - 'Order Number' => '{{order.invoice_no}}',
143 - 'Order Date' => '{{order.created_at}}',
144 - 'Payment Method' => '{{order.payment_method_title}}',
142 + __('Order Number', 'fluent-cart') => '{{order.invoice_no}}',
143 + __('Order Date', 'fluent-cart') => '{{order.created_at}}',
144 + __('Payment Method', 'fluent-cart') => '{{order.payment_method_title}}',
145 145 ]);
146 146 $blocks[] = self::itemsTable();
147 147 $blocks[] = self::summaryTable([
148 - 'Original Total' => '{{order.total_amount_formatted}}',
149 - ], 'Refund Amount', '{{order.total_refund}}');
148 + __('Original Total', 'fluent-cart') => '{{order.total_amount_formatted}}',
149 + ], __('Refund Amount', 'fluent-cart'), '{{order.total_refund}}');
150 150 $blocks[] = self::footer(__('Your refund has been processed. Please allow a few business days for the amount to appear in your account.', 'fluent-cart'));
151 151
152 152 return $blocks;
153 153 }
@@ -173,24 +173,24 @@
173 173 private static function buildProformaInvoiceBlocks(): array
174 174 {
175 175 $blocks = [];
176 176
177 - $blocks[] = self::header('INVOICE');
177 + $blocks[] = self::header(__('INVOICE', 'fluent-cart'));
178 178 $blocks[] = self::addressColumns();
179 179 $blocks[] = self::metaTable([
180 - 'Invoice Number' => '{{order.invoice_no}}',
181 - 'Invoice Date' => '{{order.created_at}}',
182 - 'Payment Method' => '{{order.payment_method_title}}',
183 - 'Payment Status' => '{{order.payment_status}}',
180 + __('Invoice Number', 'fluent-cart') => '{{order.invoice_no}}',
181 + __('Invoice Date', 'fluent-cart') => '{{order.created_at}}',
182 + __('Payment Method', 'fluent-cart') => '{{order.payment_method_title}}',
183 + __('Payment Status', 'fluent-cart') => '{{order.payment_status}}',
184 184 ]);
185 185 $blocks[] = self::itemsTable();
186 186 $blocks[] = self::summaryTable([
187 - 'Subtotal' => '{{order.subtotal_formatted}}',
188 - 'Discount' => '{{order.discount_total_formatted}}',
189 - 'Fees' => '{{order.fee_lines}}',
190 - 'Tax' => '{{order.tax_breakdown}}',
191 - 'Shipping' => '{{order.shipping_total_formatted}}',
192 - ], 'Amount Due', '{{order.total_amount_formatted}}');
187 + __('Subtotal', 'fluent-cart') => '{{order.subtotal_formatted}}',
188 + __('Discount', 'fluent-cart') => '{{order.discount_total_formatted}}',
189 + __('Fees', 'fluent-cart') => '{{order.fee_lines}}',
190 + __('Tax', 'fluent-cart') => '{{order.tax_breakdown}}',
191 + __('Shipping', 'fluent-cart') => '{{order.shipping_total_formatted}}',
192 + ], __('Amount Due', 'fluent-cart'), '{{order.total_amount_formatted}}');
193 193 $blocks[] = self::footer(__('Thank you for your order. Please complete the payment to process your order.', 'fluent-cart'));
194 194
195 195 return $blocks;
196 196 }
@@ -207,10 +207,14 @@
207 207
208 208 /**
209 209 * Two-column FROM / BILL TO address block.
210 210 */
211 - private static function addressColumns(string $billingLabel = 'BILL TO'): array
211 + private static function addressColumns(?string $billingLabel = null): array
212 212 {
213 + if ($billingLabel === null) {
214 + $billingLabel = __('BILL TO', 'fluent-cart');
215 + }
216 +
213 217 return self::block('fluent-cart/receipt-addresses', ['billingLabel' => $billingLabel]);
214 218 }
215 219
216 220 /**
@@ -232,8 +236,17 @@
232 236 * Line-items table (delegated to the order variable).
233 237 */
234 238 private static function itemsTable(): array
235 239 {
240 + // No inner content. The block is dynamic — it registers with
241 + // `save: () => null` and renders through
242 + // ReceiptItemTableBlockEditor::render(), which ignores $content and emits
243 + // its own {{order.pdf_items_table}} placeholder built from these
244 + // attributes. Passing content here made blocksToContent() serialise an
245 + // open/close pair with `{{order.items_table}}` inside it, and the editor
246 + // then failed to validate the saved markup against a save() that produces
247 + // nothing. Every other receipt block already passes null and serialises
248 + // self-closing.
236 249 return self::block('fluent-cart/receipt-item-table', [
237 250 'headerBg' => self::WHITE,
238 251 'headerColor' => self::TEXT,
239 252 'bodyColor' => self::TEXT,
@@ -238,9 +251,9 @@
238 251 'headerColor' => self::TEXT,
239 252 'bodyColor' => self::TEXT,
240 253 'borderColor' => self::BORDER,
241 254 'fontSize' => 11,
242 - ], '{{order.items_table}}');
255 + ]);
243 256 }
244 257
245 258 /**
246 259 * Payment summary with optional sub-rows and a bold total row.