Files
Commerce/custom/email/order-details-template.php
2025-08-12 15:04:56 +02:00

98 lines
3.7 KiB
PHP

<?php
//defined(security_key) or exit;
template_order_email_header('');
include './custom/translations/translations_'.strtoupper($_SESSION['country_code']).'.php';
include './custom/settings/settings.php';
//GET USER COUNTRY FROM ID
$country = isset($countries_in_scope[$address_country]) ? (${$countries_in_scope[$address_country]} ?? $countries_in_scope[$address_country]) : "";
?>
</tr>
<tr><td><br></td></tr>
<tr>
<td>
<?=$address_name?><br>
<?=$address_street?><br>
<?=$address_zip?>, <?=$address_city?><br>
<?=$country?>
</td>
</tr>
<tr><td><br></td></tr>
<tr>
<td>
<p><b><?=$order_number_text ?? 'Order' ?>:</b> <?=$order_id?></p>
<p><b><?=$order_date_text ?? 'Date'?>:</b><?php echo date("Y-m-d");?></p>
</td>
</tr>
<tr>
<td>
<h1><?=$order_email_message_1?></h1>
<p><?=$order_email_message_2?></p>
</td>
</tr>
</table>
</div>
</header>
<main>
<div class="content-wrapper" style="width:100%;max-width:700px;margin:auto;">
<div class="table order-table">
<table>
<thead>
<tr>
<th><?=$tr_product ?? 'Product' ?></th>
<th><?=$tr_options ?? 'Options' ?></th>
<th><?=$tr_quantity ?? 'Quantity'?></th>
<th><?=$tr_price ?? 'Price' ?></th>
<th style="text-align:right;"><?=$tr_total?></th>
</tr>
</thead>
<tbody>
<?php foreach($products['products'] as $product): ?>
<?php
if (isset($product['options']) && $product['options'] !=''){
$prod_options = '';
foreach ($product['options'] as $prod_opt){
$prod_options .= (${$prod_opt} ?? $prod_opt).', ';
}
}
?>
<tr>
<td><?=${$product['meta']['name']} ?? $product['meta']['name']?></td>
<td><?=htmlspecialchars(substr($prod_options, 0,-2), ENT_QUOTES)?></td>
<td><?=$product['quantity']?></td>
<td><?=currency_code?><?=number_format($product['options_price'],2)?></td>
<td class="num"><?=number_format($product['options_price'] * $product['quantity'],2)?></td>
</tr>
<?php endforeach; ?>
<tr class="item-list-end">
<td colspan="5"></td>
</tr>
<tr>
<td colspan="4" class="subtotal"><?=$total_subtotal?></td>
<td class="num"><?=currency_code?><?=number_format($subtotal,2)?></td>
</tr>
<tr>
<td colspan="4" class="subtotal"><?=$total_discount?></td>
<td class="num"><?=currency_code?><?=number_format($discounttotal,2)?></td>
</tr>
<tr>
<td colspan="4" class="shipping"><?=$total_shipping?></td>
<td class="num"><?=currency_code?><?=number_format($shippingtotal,2)?></td>
</tr>
<tr>
<td colspan="4" class="tax"><?=$total_vat?></td>
<td class="num" style="border-bottom: 1px solid #0e0f10;"><?=currency_code?><?=number_format($taxtotal,2)?></td>
</tr>
<tr>
<td colspan="4" class="total"><?=$total_total?></td>
<td class="num"><?=currency_code?><?=number_format($total,2)?></td>
</tr>
</tbody>
</table>
</div>
</div>
<?php template_order_email_footer(); ?>