using %if statements to display bank details in order to confirmation email.

Highlighted
New Member
2 0 0

Hi,

Woudl anyone know what code i should use so that when i client decides to check out using the Bank Deposit payment gateway,  my bank details and deposit instructions will come out in the order confirmation email.

If the payment was made online then the default email of shopify is fine. But when my clients decide to pay offline via bank deposit, i would like the confrimation email to include the deposit instructions along with my bank details.

Below is the current code that i put but it doesn't seem to work :(

 

<p style="margin:0;padding-bottom:1em"><span style="line-height: 1.6em;"> {% if transaction.gateway=='Bank Deposit'%}You can deposit your payment to our BDO Savings Account Number ######. Once the deposit has been made kindly email us a copy of your deposit slip at inquire@gmail.com. For mobile fund transfers, a screen shot of the confirmation page will do. We will send you an email confirming the receipt of your payment within 24-hours. The items you ordered will be held for you for 2 business days. If we do not receive an email with your confirmation of payment within the time given, your order will automatically be cancelled.
{% endif %}
</span></p>

0 Likes
Highlighted
Shopify Staff
Shopify Staff
75 0 19

Hey Isabel!

You are super close, but the %if statement has to be contained in a %forloop in this type of situation. :) 

Should be something like this:

{% for gateway in unique_gateways %}
{% if unique_gateways contains 'Bank Deposit'%}
<p style="margin:0;padding-bottom:1em"><span style="line-height: 1.6em;"> You can deposit your payment to our BDO Savings Account Number ######. Once the deposit has been made kindly email us a copy of your deposit slip at inquire@gmail.com. For mobile fund transfers, a screen shot of the confirmation page will do. We will send you an email confirming the receipt of your payment within 24-hours. The items you ordered will be held for you for 2 business days. If we do not receive an email with your confirmation of payment within the time given, your order will automatically be cancelled.
</span></p>
{% endif %}
{%endfor%}

I tested this out myself and it worked for me so let me know if you have trouble!

Cheers,

Wesley | Shopify Guru

2 Likes
Highlighted
New Member
2 0 0

Thank you so so much for this! Sorry I just saw this message now. Will let you know if it works :)

0 Likes
Highlighted
New Member
4 0 0

I just tried this with my custom payment options but no luck.

{% for gateway in unique_gateways %}
<tr>
<td align="center" valign="top" style="border-collapse:collapse;mso-table-lspace:0;mso-table-rspace:0">
<table border="0" cellpadding="0" cellspacing="0" class="templateRow" width="100%" style="border-collapse:collapse;mso-table-lspace:0;mso-table-rspace:0">
<tbody>
<tr>
<td class="rowContainer kmFloatLeft firstColumn" valign="top" width="50%" style="border-collapse:collapse;mso-table-lspace:0;mso-table-rspace:0">
<table border="0" cellpadding="0" cellspacing="0" class="kmTextBlock" width="100%" style="border-collapse:collapse;mso-table-lspace:0;mso-table-rspace:0">
<tbody class="kmTextBlockOuter">
<tr>
<td class="kmTextBlockInner" valign="top" style="border-collapse:collapse;mso-table-lspace:0;mso-table-rspace:0;">
<table align="left" border="0" cellpadding="0" cellspacing="0" class="kmTextContentContainer" width="100%" style="border-collapse:collapse;mso-table-lspace:0;mso-table-rspace:0">
<tbody>
<tr>
<td class="kmTefxtContent" valign="top" style='border-collapse:collapse;mso-table-lspace:0;mso-table-rspace:0;color:#222;font-family:"Helvetica Neue", Arial;font-size:14px;line-height:130%;text-align:left;padding-top:9px;padding-bottom:9px;padding-left:18px;padding-right:18px;'>
{% if unique_gateways contains 'Deposito en Oxxo.'%}
...
{% endif %}
{% if unique_gateways contains ' Deposito O Transferencia Bancaria'%}
...
{% endif %}
{% if unique_gateways contains 'PayPal Express Checkout'%}
...
{% endif %}
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</tbody>
</table>
</td>
</tr>
{%endfor%}

 

0 Likes
Highlighted
New Member
4 0 0

My mistake, works perfectly.

Terriffic contribution, thanks Wesley!

0 Likes
Highlighted
New Member
4 0 0

is there a way to use the 'payment instructions' defined on a custom payment method as a liquid variable or something like that?

 

0 Likes
Highlighted
New Member
2 0 0

Hey Wesley, I would love to the following message in the Payment Instructions of the Bank Deposit: "Please transfer the order amount of 25€ to our bank account number 1234567 and mention your order number #123". Is it possible to use the liquid variables {{ order.total_price }}  or {{ order_number }} in the  Payment Instructions? Unfortunately, it does not work for the Additional Details of the Bank Deposit.

 

0 Likes