Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- * Add total order price and total number of ordered products to header of email
- */
- $totals = $order->get_order_item_totals();
- $totalProducts = $order->get_item_count();
- ?>
- <?php
- if ($totals) {
- $i = 0;
- foreach ($totals as $total) {
- $i++;
- if (($total['label'] !== 'Zwischensumme:') && ($total['label'] !== 'Zahlungsmethode:')) :
- ?>
- <tr>
- <th scope="row" colspan="2" style="text-align:left; border: 1px solid #eee; font-family: 'Barlow Condensed', 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif;
- ">Gesamtzahl der bestellten Produkte:</th>
- <td style="text-align:left; border: 1px solid #eee;font-family: 'Barlow Condensed', 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif; font-weight:bold;
- "><?php echo $totalProducts; ?></td>
- </tr>
- <tr>
- <th></th>
- <td></td>
- </tr>
- <tr>
- <th scope="row" colspan="2" style="text-align:left; border: 1px solid #eee; <?php if ($i == 1) {
- echo 'border-top-width: 4px;';
- } ?>"><?php echo $total['label']; ?></th>
- <td style="text-align:left; border: 1px solid #eee; <?php if ($i == 1) {
- echo 'border-top-width: 4px;';
- } ?>"><?php echo $total['value']; ?>
- </td>
- </tr>
- <?php
- endif;
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement