Include "Payment instructions" in customers email receipt.

Hey all,

I’ve setup a payment option for wire transfers and included all of the bank details in the “Payment instructions” field. This information shows up once an order is complete just as I want it to. However, I would also like “Payment instructions” to be included in the email invoice the customer receives. This would be very, very helpful and I was surprised it was not done this way by default. Has anyone done this before? Can you point me in the right direction?

Thanks!

I figured out how to do this. For anyone else interested, here is the procedure I used:



Simple method:

Open invoice.tpl file located in the skins/[CUSTOMER_ACTIVE_SKIN]/mail/orders directory.



Find the line

{* /Order totals *}



Add this right after:

```php

{if $order_info.payment_method.instructions}

{$lang.payment_instructions}



{$order_info.payment_method.instructions|unescape}

{/if}
```

Of course it would be better to do this via a hook which I will work on next. I may also try to figure out how to only included in the initial "open" status email so it doesn't get confusing for the customer.

For wich version is this? Because i do not find the payment instructions…

Ah, sorry. This is version 2.1. The “payment instructions” are a field under Adminstration > payment methods when you edit a payment method.

And how i can add a lang if this one paymend method is used?



For example:



If i customer pay per bankwire, i would like that only in this case this customer get on the invoice.tpl a information about the banwire details!



PS: I use version 2.0.15



I think it is that:



{if $order_info.payment_method.payment = “12”}

{$lang.bank_wire}

{/if}



but the if code is wrong! would like to insert the id from the payment…



Can somebody help me??



Thanls so much in advance!!!

I tried now this, but it does not work too :frowning:

```php

{if $order_info.payment_method_id ne 12}





{$order_info.payment_method.payment}


{$lang.bank_wire_text}

{$lang.bank_wire}

{$lang.total_sum} {include file="common_templates/price.tpl" value=$order_info.total}
{/if}
```

PLS help!

Come one, i need help please!

I kind of found a solution using hooks and only send payments instructions when the order have open status and the desire payment method is selected. Using DeGrey code.



Create a file named invoice.post.tpl at /skins/FAVORITE_SKIN/mail/addons/my_changes/hooks/orders



And copy the following code…where “5” is the payment method id which you only want to send payment instructions


```php



{if $order_info.status == 'O' && $order_info.payment_method.payment_id == '5' && $order_info.payment_method.instructions}

{$lang.payment_instructions}





{$order_info.payment_method.instructions|unescape}



{/if}


```

Is this still accurate for CS-Cart 4.3 ?



Its strange that CS-Cart does not have this by default.

[quote name='P-Pharma' timestamp='1430834901' post='213471']

Is this still accurate for CS-Cart 4.3 ?



Its strange that CS-Cart does not have this by default.

[/quote]



You can put the instructions to the description of the corresponding order status, isn't it?

Indeed. But is the order status description different per storefront?

How can we differentiate between orders with prepayment by bank and c.o.d. ?

We only have a 'open' order status. Maybe that can be changed to unpaid. But then we will still need to send different texts to customers who pay by bank and cod.

[quote name='P-Pharma' timestamp='1430839900' post='213486']

Indeed. But is the order status description different per storefront?

How can we differentiate between orders with prepayment by bank and c.o.d. ?

We only have a 'open' order status. Maybe that can be changed to unpaid. But then we will still need to send different texts to customers who pay by bank and cod.

[/quote]



You are right. In this case, try to create two files:


  • design/themes/YOUR_THEME/mail/templates/addons/my_changes/hooks/orders/invoice.post.tpl
  • design/backend/mail/templates/addons/my_changes/hooks/orders/invoice.post.tpl



    with the following content:


```php


{if $order_info.status == 'O' && $order_info.payment_method.payment_id == '5' && $order_info.payment_method.instructions}

{__('payment_instructions')}



{$order_info.payment_method.instructions nofilter}

{/if}

```

Then clear the cache and check the result (NOT TESTED!!!)

Am I correct that OPEN status equals UNPAID?

[quote name='P-Pharma' timestamp='1430924292' post='213575']

Am I correct that OPEN status equals UNPAID?

[/quote]



Do you mean default “Incomplete” status? The letter should be N

You are right. In this case, try to create two files:

- design/themes/YOUR_THEME/mail/templates/addons/my_changes/hooks/orders/invoice.post.tpl
- design/backend/mail/templates/addons/my_changes/hooks/orders/invoice.post.tpl

with the following content:

		 
{if $order_info.status == 'O' && $order_info.payment_method.payment_id == '5' && $order_info.payment_method.instructions}

{__('payment_instructions')}

{$order_info.payment_method.instructions nofilter}
{/if}
Then clear the cache and check the result (NOT TESTED!!!)

works great, thanks :grin:

works great, thanks :grin:

We are glad to help you