Tour Master – How to add a note in the invoice email

The developer documentation assumes you have knowledge and coding skills. While we created these docs to help you achieve things not available in the original features, we do not provide support if something doesn’t work when referencing the developer documentation. If the example code doesn’t work for you, please debug it yourself or hire a freelancer to help with debugging.

All customizations will be lost when you update our theme/plugin to a new version in the future. To avoid this, you must use filters and actions: https://developer.wordpress.org/plugins/hooks/.

I will show you how to add a note in the invoice email today.

First, open this file: /wp-content/plugins/tourmaster/include/mail-util.php around the price breakdown section and you will get the default code look like below:

// price breakdown
if( !empty($result->pricing_info) ){
    $pricing_info = json_decode($result->pricing_info, true);
    echo '<div>'; // tourmaster-invoice-price-breakdown
    echo '<div style="padding: 18px 25px; font-size: 14px; font-weight: 700; text-transform: uppercase; color: #454545; background-color: #f3f3f3" >'; // tourmaster-invoice-price-head
    echo '<span style="width: 80%; float: left;" >' . esc_html__('Description', 'tourmaster') . '</span>'; // tourmaster-head
    echo '<span style="overflow: hidden;" >' . esc_html__('Total', 'tourmaster') . '</span>'; // tourmaster-tail
    echo '</div>'; // tourmaster-invoice-price-head

    echo tourmaster_get_tour_invoice_price_email($result->tour_id, $pricing_info['price-breakdown'], $booking_detail);

    echo '<div style="font-weight: bold; padding: 18px 25px; border-width: 1px 0px 2px; border-style: solid; border-color: #e1e1e1;" >'; // tourmaster-invoice-total-price
    echo '<span style="float: left; margin-left: 55%; width: 25%; font-size: 15px;" >' . esc_html__('Total', 'tourmaster') . '</span> '; // tourmaster-head
    echo '<span style="display: block; overflow: hidden; font-size: 16px;" >' . tourmaster_money_format($result->total_price) . '</span>'; // tourmaster-tail
    echo '</div>'; // tourmaster-invoice-total-price

    echo '</div>'; // tourmaster-invoice-price-breakdown
}

Then change it like the code below:

// price breakdown
if( !empty($result->pricing_info) ){
    $pricing_info = json_decode($result->pricing_info, true);
    echo '<div>'; // tourmaster-invoice-price-breakdown
    echo '<div style="padding: 18px 25px; font-size: 14px; font-weight: 700; text-transform: uppercase; color: #454545; background-color: #f3f3f3" >'; // tourmaster-invoice-price-head
    echo '<span style="width: 80%; float: left;" >' . esc_html__('Description', 'tourmaster') . '</span>'; // tourmaster-head
    echo '<span style="overflow: hidden;" >' . esc_html__('Total', 'tourmaster') . '</span>'; // tourmaster-tail
    echo '</div>'; // tourmaster-invoice-price-head

    echo tourmaster_get_tour_invoice_price_email($result->tour_id, $pricing_info['price-breakdown'], $booking_detail);

    echo '<div style="font-weight: bold; padding: 18px 25px; border-width: 1px 0px 2px; border-style: solid; border-color: #e1e1e1;" >'; // tourmaster-invoice-total-price
    echo '<span style="float: left; margin-left: 55%; width: 25%; font-size: 15px;" >' . esc_html__('Total', 'tourmaster') . '</span> '; // tourmaster-head
    echo '<span style="display: block; overflow: hidden; font-size: 16px;" >' . tourmaster_money_format($result->total_price) . '</span>'; // tourmaster-tail
    echo '</div>'; // tourmaster-invoice-total-price

    // THE NOTE IN THE INVOICE EMAIL
    echo '<div style="padding: 18px 25px; font-size: 14px; font-weight: 700; text-transform: uppercase; color: #454545; background-color: #f3f3f3" >'; // tourmaster-invoice-price-note
    echo '<span style="width: 100%;" >' . esc_html__('Note', 'tourmaster') . '</span>'; // tourmaster-head
    echo '</div>'; // tourmaster-invoice-price-head
    echo '<span style="display:block;font-size:13px; padding-top: 20px;">'. esc_html__('My note here','tourmaster') .'</span>';
    // END THE NOTE IN THE INVOICE EMAIL

    echo '</div>'; // tourmaster-invoice-price-breakdown
}

Then you will get the result like my screenshot if everything correct.