G
G
gladislav992020-10-13 12:55:27
opencart
gladislav99, 2020-10-13 12:55:27

How to change OpenCart email template?

Good afternoon, tell me how to remove the shipping cost in the letter template? (I understand that it is taken from the array, but I can’t understand where exactly)5f85798c63d2d763269222.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Pashok Doom, 2020-10-14
@Benzin102

Letter template in /catalog/view/theme/your theme/template/mail/order.tpl
Totals are displayed line by line in this piece (in default OS 2):

<?php foreach ($totals as $total) { ?>
      <tr>
        <td style="font-size: 12px;	border-right: 1px solid #DDDDDD; border-bottom: 1px solid #DDDDDD; text-align: right; padding: 7px;" colspan="4"><b><?php echo $total['title']; ?>:</b></td>
        <td style="font-size: 12px;	border-right: 1px solid #DDDDDD; border-bottom: 1px solid #DDDDDD; text-align: right; padding: 7px;"><?php echo $total['text']; ?></td>
      </tr>
<?php } ?>

And the array is formed in /catalog/model/checkout/order.php in the addOrderHistory function here:
// Order Totals
$order_total_query = $this->db->query("SELECT * FROM `" . DB_PREFIX . "order_total` WHERE order_id = '" . (int)$order_id . "' ORDER BY sort_order ASC");

foreach ($order_total_query->rows as $total) {
  $data['totals'][] = array(
    'title' => $total['title'],
    'text'  => $this->currency->format($total['value'], $order_info['currency_code'], $order_info['currency_value']),
  );
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question