• Resolved pritchs

    (@pritchs)


    Hi Ewout,

    Since the definition (at least in the Oxford dictionary) of “invoice” is: “A list of goods sent or services provided, with a statement of the sum due for these; a bill.” I don’t want to call a receipt for payment an invoice. Woocommerce and about everyone else seems to think “invoice” covers both and maybe it does, but I would like to call each by its (IMO) correct title.

    So, if the order is paid, I would like to have the title say “Receipt” and the label for the total to read “Amount Paid” or some such.

    If the order payment type is “invoice”, then the title should say “Invoice” and the label for the total line, should say something like, “Total Due”.

    I’ve found the following lines in invoice template that see to control these two items, but I don’t know how to modify them.

    Title:
    <?php if( $this->has_header_logo() ) echo $this->get_title(); ?>
    Total Label:
    <th class="description"><span><?php echo $total_data['label']; ?></span></th>

    I think I can handle the label issue with something like this:

    <?php if ($template_type == 'invoice' && $payment_method == 'Net30') { ?>
            <th class="description"><span><?php echo "Total Due"; ?>}</span></th>
            <?php } else { ?>
            <th class="description"><span><?php echo "Total Paid"; ?>}</span></th>
       <?php     }?>

    [Moderator note: code fixed. Please wrap code in the backtick character or use the code button.]

    However, the title has me stumped. Any help you can provide would be appreciated.

    Steve Pritchard

    • This topic was modified 6 years, 11 months ago by bdbrown.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor Ewout

    (@pomegranate)

    Hi Steve,
    You can apply the same logic to the title:

    
    <?php
    if ( $this->order->get_payment_method() == 'Net30') {
        echo 'Invoice';
    } else {
        echo 'Receipt';
    }
    ?>
    

    Ewout

    Thread Starter pritchs

    (@pritchs)

    OK, your code worked… of course! ??

    However, the statement I suggested for the label on the total line doesn’t. When I echo template_type, it’s empty.

    <?php echo 'template type = ' . $template_type ?>

    There is plenty of code that you have posted that has that variable in it so I must be doing something wrong, but I don’t know what.

    Again any suggestions would be appreciated.
    Steve Pritchard

    Plugin Contributor Ewout

    (@pomegranate)

    Glad to hear that works for you!
    If you’re in the invoice.php template file, then you can omit that line because it would always be ‘invoice’ anyway ??
    But if you do need to check: $this->get_type() should do the trick.

    Ewout

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Invoice form label and label for total line’ is closed to new replies.