Variable Name

On my invoice template, I have a line that to describe the method of payment

{{__("PAYMENT")}} : {{p.payment}}

This gets displayed as PAYMENT : Phone ordering on the invoice which is fine.

However, when I change the code to {{__("PAYMENT METHOD")}} : {{p.payment}} , it displays it as _PAYMENT METHOD: Phone ordering

Can anyone advise me what I'm doing wrong? I don't know why it is adding an underscore to the start of the line now, just because I'm adding an extra word?

If you want just to change display name from PAYMENT to PAYMENT METHOD you do not need to create extra language variable for that.

Just go to Administrtion > Translations

in the search field write PAYMENT, find the needed value and change it to PAYMENT METHOD

But if you want to create new variable then change to {{__("PAYMENT_METHOD")}} on the invoice, and add extra variable in Administrtion > Translations > Add new variable

Variable = PAYMENT_METHOD

Value = PAYMENT METHOD

Creating the new variable worked great, I'll have to remember that in future 8)

Any time you see the name prefixed with an underscore character ('_') that means that it is a language variable that doesn't exist and needs to be added or corrected.