PluginProbe
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler / 1.7.1
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler v1.7.1
1.7.1 1.7.0 1.6.6 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 All 51 releases
← All changes | app/Views/emails/parts/subscription_item.php +302 -7 1.3.21 → 1.7.1 View file →
@@ -32,9 +32,9 @@
32 32 <tbody style="width:100%">
33 33 <tr style="width:100%">
34 34 <td style="width:80%">
35 35 <p style="font-size:14px;font-weight:600;color:rgb(17,24,39);margin-bottom:2px;line-height:24px;margin-top:16px">
36 - <?php echo esc_html($subscription->item_name); ?>
36 + <?php echo esc_html($subscription->display_item_name); ?>
37 37 </p>
38 38 </td>
39 39 <td style="width:20%;text-align:right">
40 40 <p style="font-size:14px;color:rgb(17,24,39);margin:0px;line-height:24px;margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px">
@@ -53,11 +53,19 @@
53 53 style="background-color:rgb(249,250,251);padding:16px;border-radius:8px;margin-bottom:24px;border-width:1px;border-color:rgb(229,231,235)">
54 54 <tbody>
55 55 <tr>
56 56 <td>
57 - <?php if ($order && $order->tax_total > 0): ?>
57 + <?php
58 + $subTaxSummary = ($order instanceof \FluentCart\App\Models\Order)
59 + ? \FluentCart\App\Services\Renderer\Receipt\TaxSummaryHelper::computeTaxSummary($order)
60 + : ['shouldRender' => false];
61 + $isReverseCharge = $order && $order->isReverseChargeTaxOrder();
62 + $subShowSubtotal = $order && $order->subtotal != $order->total_amount;
63 + ?>
64 + <?php if ($subShowSubtotal || !empty($subTaxSummary['shouldRender'])): ?>
58 65 <table align="center" width="100%" border="0" cellpadding="0" cellspacing="0" role="presentation">
59 66 <tbody style="width:100%">
67 + <?php if ($subShowSubtotal): ?>
60 68 <tr style="width:100%">
61 69 <td style="width:70%">
62 70 <p style="font-size:14px;color:rgb(55,65,81);margin:0px;line-height:24px;">
63 71 <?php esc_html_e('Subtotal', 'fluent-cart'); ?>
@@ -68,24 +76,311 @@
68 76 <?php echo esc_html(\FluentCart\App\Helpers\Helper::toDecimal($order->subtotal)); ?>
69 77 </p>
70 78 </td>
71 79 </tr>
80 + <?php endif; ?>
81 +
82 + <?php if (!empty($subTaxSummary['shouldRender'])):
83 + $subFoldedRateLines = \FluentCart\Framework\Support\Arr::get($subTaxSummary, 'foldedRateLines', []);
84 + $subIncludedInPrices = (int) \FluentCart\Framework\Support\Arr::get($subTaxSummary, 'includedInPrices', 0);
85 + $subPayableTax = (int) \FluentCart\Framework\Support\Arr::get($subTaxSummary, 'payableTax', 0);
86 + $subTotalOrderTax = (int) \FluentCart\Framework\Support\Arr::get($subTaxSummary, 'totalOrderTax', 0);
87 + $subIsReverseCharge = !empty($subTaxSummary['isReverseCharge']);
88 + $subDisplayMode = \FluentCart\Framework\Support\Arr::get($subTaxSummary, 'displayMode', '');
89 + $subSimpleLine = \FluentCart\Framework\Support\Arr::get($subTaxSummary, 'simpleLine');
90 + ?>
91 + <?php if ($subDisplayMode === 'simplified' && !empty($subSimpleLine)): ?>
72 92 <tr style="width:100%">
73 93 <td style="width:70%">
74 - <p style="font-size:14px;color:rgb(55,65,81);margin:0px;line-height:24px;">
75 - <?php esc_html_e('Tax', 'fluent-cart');
76 - echo esc_html($order->tax_behavior == 2 ? __(' (Included)', 'fluent-cart') : __(' (Excluded)', 'fluent-cart'));
94 + <p style="font-size:14px;font-weight:700;color:rgb(17,24,39);margin:0px;line-height:24px;">
95 + <?php echo esc_html($subSimpleLine['label']); ?>
96 + </p>
97 + </td>
98 + <td style="width:30%;text-align:right">
99 + <p style="font-size:14px;font-weight:700;color:rgb(17,24,39);margin:0px;line-height:24px;">
100 + <?php echo esc_html($subSimpleLine['value']); ?>
101 + </p>
102 + </td>
103 + </tr>
104 + <?php endif; ?>
105 +
106 + <?php if ($subDisplayMode !== 'simplified'): ?>
107 + <?php
108 + $subRcReversedTotal = (int) \FluentCart\Framework\Support\Arr::get($subTaxSummary, 'reversedTaxTotal', 0);
109 + $subRcReversedShipping = (int) \FluentCart\Framework\Support\Arr::get($subTaxSummary, 'reversedShippingTax', 0);
110 + $subRcReversedValue = $subRcReversedTotal > 0
111 + ? \FluentCart\App\Helpers\Helper::toDecimal($subRcReversedTotal)
112 + : __('Charge reversed', 'fluent-cart');
113 + ?>
114 + <?php if (!empty($subFoldedRateLines)): ?>
115 + <tr style="width:100%">
116 + <td colspan="2" style="padding:4px 0;">
117 + <table width="100%" style="border-spacing:0;border-collapse:collapse;table-layout:fixed;">
118 + <tbody>
119 + <tr>
120 + <td style="width:58%;font-size:11px;text-transform:uppercase;color:rgb(107,114,128);font-weight:600;padding:2px 12px 2px 0;border:none;white-space:nowrap;">
121 + <?php esc_html_e('Rate', 'fluent-cart'); ?>
122 + </td>
123 + <td style="width:24%;font-size:11px;text-transform:uppercase;color:rgb(107,114,128);font-weight:600;padding:2px 12px 2px 0;text-align:right;border:none;white-space:nowrap;">
124 + <?php esc_html_e('Taxable base', 'fluent-cart'); ?>
125 + </td>
126 + <td style="width:18%;font-size:11px;text-transform:uppercase;color:rgb(107,114,128);font-weight:600;padding:2px 0;text-align:right;border:none;white-space:nowrap;">
127 + <?php esc_html_e('Tax', 'fluent-cart'); ?>
128 + </td>
129 + </tr>
130 + <?php foreach ($subFoldedRateLines as $subFoldedLine):
131 + $subFoldedColor = !empty($subFoldedLine['inclusive']) ? 'rgb(107,114,128)' : 'rgb(17,24,39)';
77 132 ?>
133 + <tr>
134 + <td style="width:58%;font-size:14px;line-height:20px;padding:3px 12px 3px 0;border:none;color:<?php echo esc_attr($subFoldedColor); ?>;white-space:normal;word-break:break-word;overflow-wrap:break-word;vertical-align:top;">
135 + <?php echo esc_html($subFoldedLine['label']); ?>
136 + </td>
137 + <td style="width:24%;font-size:13px;line-height:20px;padding:3px 12px 3px 0;text-align:right;border:none;color:rgb(107,114,128);white-space:nowrap;vertical-align:top;">
138 + <?php echo esc_html(\FluentCart\App\Helpers\Helper::toDecimal($subFoldedLine['base'])); ?>
139 + </td>
140 + <td style="width:18%;font-size:13px;line-height:20px;padding:3px 0;text-align:right;border:none;color:<?php echo esc_attr($subFoldedColor); ?>;white-space:nowrap;vertical-align:top;">
141 + <?php echo esc_html(\FluentCart\App\Helpers\Helper::toDecimal($subFoldedLine['tax'])); ?>
142 + </td>
143 + </tr>
144 + <?php endforeach; ?>
145 + </tbody>
146 + </table>
147 + </td>
148 + </tr>
149 + <?php if ($subIsReverseCharge): ?>
150 + <tr style="width:100%">
151 + <td style="width:70%;border-top:1px solid rgb(229,231,235);padding-top:4px;">
152 + <p style="font-size:14px;font-weight:700;color:rgb(17,24,39);margin:0px;line-height:24px;">
153 + <?php esc_html_e('VAT reversed', 'fluent-cart'); ?>
78 154 </p>
79 155 </td>
156 + <td style="width:30%;text-align:right;border-top:1px solid rgb(229,231,235);padding-top:4px;">
157 + <p style="font-size:14px;font-weight:700;color:rgb(17,24,39);margin:0px;line-height:24px;">
158 + <?php echo esc_html($subRcReversedValue); ?>
159 + </p>
160 + </td>
161 + </tr>
162 + <?php else: ?>
163 + <tr style="width:100%">
164 + <td style="width:70%;border-top:1px solid rgb(229,231,235);padding-top:4px;">
165 + <p style="font-size:14px;font-weight:700;color:rgb(17,24,39);margin:0px;line-height:24px;">
166 + <?php esc_html_e('Total tax', 'fluent-cart'); ?>
167 + </p>
168 + </td>
169 + <td style="width:30%;text-align:right;border-top:1px solid rgb(229,231,235);padding-top:4px;">
170 + <p style="font-size:14px;font-weight:700;color:rgb(17,24,39);margin:0px;line-height:24px;">
171 + <?php echo esc_html(\FluentCart\App\Helpers\Helper::toDecimal($subTotalOrderTax)); ?>
172 + </p>
173 + </td>
174 + </tr>
175 + <?php if ($subIncludedInPrices > 0): ?>
176 + <tr style="width:100%">
177 + <td style="width:70%">
178 + <p style="font-size:13px;color:rgb(107,114,128);margin:0px;line-height:22px;">
179 + <?php esc_html_e('of which included in prices', 'fluent-cart'); ?>
180 + </p>
181 + </td>
80 182 <td style="width:30%;text-align:right">
81 - <p style="font-size:14px;color:rgb(55,65,81);margin:0px;line-height:24px;">
82 - <?php echo esc_html(\FluentCart\App\Helpers\Helper::toDecimal($order->tax_total)); ?>
183 + <p style="font-size:13px;color:rgb(107,114,128);margin:0px;line-height:22px;">
184 + <?php echo esc_html(\FluentCart\App\Helpers\Helper::toDecimal($subIncludedInPrices)); ?>
83 185 </p>
84 186 </td>
85 187 </tr>
188 + <?php endif; ?>
189 + <?php if ($subPayableTax > 0 && $subIncludedInPrices > 0): ?>
190 + <tr style="width:100%">
191 + <td style="width:70%;border-top:1px solid rgb(229,231,235);padding-top:4px;">
192 + <p style="font-size:14px;font-weight:700;color:rgb(17,24,39);margin:0px;line-height:24px;">
193 + <?php esc_html_e('Payable now (added)', 'fluent-cart'); ?>
194 + </p>
195 + </td>
196 + <td style="width:30%;text-align:right;border-top:1px solid rgb(229,231,235);padding-top:4px;">
197 + <p style="font-size:14px;font-weight:700;color:rgb(17,24,39);margin:0px;line-height:24px;">
198 + <?php echo esc_html(\FluentCart\App\Helpers\Helper::toDecimal($subPayableTax)); ?>
199 + </p>
200 + </td>
201 + </tr>
202 + <?php endif; ?>
203 + <?php endif; ?>
204 + <?php elseif ($subIsReverseCharge): ?>
205 + <?php if (!empty($subTaxSummary['showRcShippingRow']) && $subRcReversedShipping > 0): ?>
206 + <tr style="width:100%">
207 + <td style="width:70%">
208 + <p style="font-size:14px;color:rgb(107,114,128);margin:0px;line-height:24px;">
209 + <?php esc_html_e('Added on shipping', 'fluent-cart'); ?>
210 + </p>
211 + </td>
212 + <td style="width:30%;text-align:right">
213 + <p style="font-size:14px;color:rgb(107,114,128);margin:0px;line-height:24px;">
214 + <span style="text-decoration:line-through;opacity:0.6;"><?php echo esc_html(\FluentCart\App\Helpers\Helper::toDecimal($subRcReversedShipping)); ?></span>
215 + </p>
216 + </td>
217 + </tr>
218 + <?php endif; ?>
219 + <tr style="width:100%">
220 + <td style="width:70%">
221 + <p style="font-size:14px;font-weight:700;color:rgb(17,24,39);margin:0px;line-height:24px;">
222 + <?php esc_html_e('Tax reversed', 'fluent-cart'); ?>
223 + </p>
224 + </td>
225 + <td style="width:30%;text-align:right">
226 + <p style="font-size:14px;font-weight:700;color:rgb(17,24,39);margin:0px;line-height:24px;">
227 + <?php echo esc_html($subRcReversedValue); ?>
228 + </p>
229 + </td>
230 + </tr>
231 + <?php else: ?>
232 + <?php
233 + $subFeeRowsList = \FluentCart\Framework\Support\Arr::get($subTaxSummary, 'feeTaxLineRows', []);
234 + $subTaxRateLines = \FluentCart\Framework\Support\Arr::get($subTaxSummary, 'taxRateLines', []);
235 + $subShippingLines = \FluentCart\Framework\Support\Arr::get($subTaxSummary, 'shippingTaxLines', []);
236 + $subProductTaxRowCount = !empty($subTaxRateLines)
237 + ? count($subTaxRateLines)
238 + : (int) ($subTaxSummary['inclusiveTax'] > 0) + (int) ($subTaxSummary['exclusiveTax'] > 0);
239 + $subRowCount = $subProductTaxRowCount + count($subFeeRowsList) + (int) ($subTaxSummary['shippingTax'] > 0);
240 + $subShouldShowBreakdown = !empty($subTaxRateLines)
241 + || !empty($subShippingLines)
242 + || $subRowCount >= 2
243 + || ($subRowCount === 1 && !($subTaxSummary['payableTax'] > 0 || $subTaxSummary['inclusiveTax'] > 0 || (int) \FluentCart\Framework\Support\Arr::get($subTaxSummary, 'inclusiveFeeTax', 0) > 0));
244 + ?>
245 + <?php if (!empty($subTaxRateLines) && $subShouldShowBreakdown): ?>
246 + <?php foreach ($subTaxRateLines as $subTaxRateLine):
247 + $subTaxRateColor = !empty($subTaxRateLine['inclusive']) ? 'rgb(107,114,128)' : 'rgb(17,24,39)';
248 + $subTaxRateWeight = !empty($subTaxRateLine['inclusive']) ? 'normal' : '600';
249 + ?>
250 + <tr style="width:100%">
251 + <td style="width:70%">
252 + <p style="font-size:14px;font-weight:<?php echo esc_attr($subTaxRateWeight); ?>;color:<?php echo esc_attr($subTaxRateColor); ?>;margin:0px;line-height:24px;">
253 + <?php echo esc_html($subTaxRateLine['label']); ?>
254 + </p>
255 + </td>
256 + <td style="width:30%;text-align:right">
257 + <p style="font-size:14px;font-weight:<?php echo esc_attr($subTaxRateWeight); ?>;color:<?php echo esc_attr($subTaxRateColor); ?>;margin:0px;line-height:24px;">
258 + <?php echo esc_html(\FluentCart\App\Helpers\Helper::toDecimal($subTaxRateLine['order_tax'])); ?>
259 + </p>
260 + </td>
261 + </tr>
262 + <?php endforeach; ?>
263 + <?php endif; ?>
264 + <?php if (empty($subTaxRateLines) && $subTaxSummary['inclusiveTax'] > 0 && $subShouldShowBreakdown): ?>
265 + <tr style="width:100%">
266 + <td style="width:70%">
267 + <p style="font-size:14px;color:rgb(107,114,128);margin:0px;line-height:24px;">
268 + <?php esc_html_e('Included in item prices', 'fluent-cart'); ?>
269 + </p>
270 + </td>
271 + <td style="width:30%;text-align:right">
272 + <p style="font-size:14px;color:rgb(107,114,128);margin:0px;line-height:24px;">
273 + <?php echo esc_html(\FluentCart\App\Helpers\Helper::toDecimal($subTaxSummary['inclusiveTax'])); ?>
274 + </p>
275 + </td>
276 + </tr>
277 + <?php endif; ?>
278 + <?php if (empty($subTaxRateLines) && $subTaxSummary['exclusiveTax'] > 0 && $subShouldShowBreakdown): ?>
279 + <tr style="width:100%">
280 + <td style="width:70%">
281 + <p style="font-size:14px;font-weight:600;color:rgb(17,24,39);margin:0px;line-height:24px;">
282 + <?php esc_html_e('Added on products', 'fluent-cart'); ?>
283 + </p>
284 + </td>
285 + <td style="width:30%;text-align:right">
286 + <p style="font-size:14px;font-weight:600;color:rgb(17,24,39);margin:0px;line-height:24px;">
287 + <?php echo esc_html(\FluentCart\App\Helpers\Helper::toDecimal($subTaxSummary['exclusiveTax'])); ?>
288 + </p>
289 + </td>
290 + </tr>
291 + <?php endif; ?>
292 + <?php if ($subShouldShowBreakdown): ?>
293 + <?php foreach ($subFeeRowsList as $subFeeRow):
294 + $subFeeColor = $subFeeRow['inclusive'] ? 'rgb(107,114,128)' : 'rgb(17,24,39)';
295 + $subFeeWeight = $subFeeRow['inclusive'] ? 'normal' : '600';
296 + ?>
297 + <tr style="width:100%">
298 + <td style="width:70%">
299 + <p style="font-size:14px;font-weight:<?php echo esc_attr($subFeeWeight); ?>;color:<?php echo esc_attr($subFeeColor); ?>;margin:0px;line-height:24px;">
300 + <?php echo esc_html($subFeeRow['display_label']); ?>
301 + </p>
302 + </td>
303 + <td style="width:30%;text-align:right">
304 + <p style="font-size:14px;font-weight:<?php echo esc_attr($subFeeWeight); ?>;color:<?php echo esc_attr($subFeeColor); ?>;margin:0px;line-height:24px;">
305 + <?php echo esc_html(\FluentCart\App\Helpers\Helper::toDecimal($subFeeRow['tax_amount'])); ?>
306 + </p>
307 + </td>
308 + </tr>
309 + <?php endforeach; ?>
310 + <?php endif; ?>
311 + <?php if ($subTaxSummary['shippingTax'] > 0 && $subShouldShowBreakdown):
312 + $subIsShippingInclusive = (bool) \FluentCart\Framework\Support\Arr::get($subTaxSummary, 'isShippingInclusive', false);
313 + $subShippingColor = $subIsShippingInclusive ? 'rgb(107,114,128)' : 'rgb(17,24,39)';
314 + $subShippingWeight = $subIsShippingInclusive ? 'normal' : '600';
315 + if (!empty($subShippingLines)):
316 + foreach ($subShippingLines as $subShLine): ?>
317 + <tr style="width:100%">
318 + <td style="width:70%">
319 + <p style="font-size:14px;font-weight:<?php echo esc_attr($subShippingWeight); ?>;color:<?php echo esc_attr($subShippingColor); ?>;margin:0px;line-height:24px;">
320 + <?php echo esc_html($subShLine['label']); ?>
321 + </p>
322 + </td>
323 + <td style="width:30%;text-align:right">
324 + <p style="font-size:14px;font-weight:<?php echo esc_attr($subShippingWeight); ?>;color:<?php echo esc_attr($subShippingColor); ?>;margin:0px;line-height:24px;">
325 + <?php echo esc_html(\FluentCart\App\Helpers\Helper::toDecimal($subShLine['shipping_tax'])); ?>
326 + </p>
327 + </td>
328 + </tr>
329 + <?php endforeach;
330 + else: ?>
331 + <tr style="width:100%">
332 + <td style="width:70%">
333 + <p style="font-size:14px;font-weight:<?php echo esc_attr($subShippingWeight); ?>;color:<?php echo esc_attr($subShippingColor); ?>;margin:0px;line-height:24px;">
334 + <?php echo esc_html($subIsShippingInclusive ? __('Included in shipping prices', 'fluent-cart') : __('Added on shipping', 'fluent-cart')); ?>
335 + </p>
336 + </td>
337 + <td style="width:30%;text-align:right">
338 + <p style="font-size:14px;font-weight:<?php echo esc_attr($subShippingWeight); ?>;color:<?php echo esc_attr($subShippingColor); ?>;margin:0px;line-height:24px;">
339 + <?php echo esc_html(\FluentCart\App\Helpers\Helper::toDecimal($subTaxSummary['shippingTax'])); ?>
340 + </p>
341 + </td>
342 + </tr>
343 + <?php endif; ?>
344 + <?php endif; ?>
345 + <?php if ($subTaxSummary['payableTax'] > 0): ?>
346 + <tr style="width:100%">
347 + <td style="width:70%;border-top:1px solid rgb(229,231,235);padding-top:4px;">
348 + <p style="font-size:14px;font-weight:700;color:rgb(17,24,39);margin:0px;line-height:24px;">
349 + <?php esc_html_e('Total payable tax', 'fluent-cart'); ?>
350 + </p>
351 + </td>
352 + <td style="width:30%;text-align:right;border-top:1px solid rgb(229,231,235);padding-top:4px;">
353 + <p style="font-size:14px;font-weight:700;color:rgb(17,24,39);margin:0px;line-height:24px;">
354 + <?php echo esc_html(\FluentCart\App\Helpers\Helper::toDecimal($subTaxSummary['payableTax'])); ?>
355 + </p>
356 + </td>
357 + </tr>
358 + <?php endif; ?>
359 + <?php if ($subTaxSummary['inclusiveTax'] > 0 || $subTaxSummary['inclusiveFeeTax'] > 0): ?>
360 + <tr style="width:100%">
361 + <td style="width:70%">
362 + <p style="font-size:14px;font-weight:normal;color:rgb(107,114,128);margin:0px;line-height:24px;">
363 + <?php esc_html_e('Total tax in this order', 'fluent-cart'); ?>
364 + </p>
365 + </td>
366 + <td style="width:30%;text-align:right">
367 + <p style="font-size:14px;font-weight:normal;color:rgb(107,114,128);margin:0px;line-height:24px;">
368 + <?php echo esc_html(\FluentCart\App\Helpers\Helper::toDecimal($subTaxSummary['totalOrderTax'])); ?>
369 + </p>
370 + </td>
371 + </tr>
372 + <?php endif; ?>
373 + <?php endif; ?>
374 + <?php endif; ?>
375 + <?php endif; ?>
86 376 </tbody>
87 377 </table>
378 + <?php if ($isReverseCharge): ?>
379 + <div style="font-size:12px;color:rgb(55,65,81);margin-top:4px;margin-bottom:4px;">
380 + <?php echo '* ' . esc_html(\FluentCart\App\Modules\Tax\TaxModule::getReverseChargeNoticeText()); ?>
381 + </div>
382 + <?php endif; ?>
88 383 <hr style="border-color:rgb(209,213,219);margin-top:8px;margin-bottom:8px;width:100%;border:none;border-top:1px solid #eaeaea">
89 384 <?php endif; ?>
90 385 <table align="center" width="100%" border="0" cellpadding="0" cellspacing="0" role="presentation">
91 386 <tbody style="width:100%">