display card type

Is it possible to display the credit card type (visa, mastercard, etc) within the email template? thanks
Comments
  • fc_adamfc_adam FoxyCart Team
    @freshjones,

    It is - and our default HTML email does include that information next to the masked credit card number. It looks like we may have added that to the template after you set yours to a custom template though - so yours isn't displaying that information.

    Within your custom HTML email - look for this code:
      	{% if payment_type == 'plastic' and cc_number_masked %}
    <h3 style="{{ h3_style }}">{{ config.lang.checkout_payment_method|raw }}</h3>{{ cc_number_masked }}<br style="{{ br_style }}"><br style="{{ br_style }}">
    {% endif %}
    And replace the {{ cc_number_masked }} portion with this:
    {{ cc_number_masked }} {% if cc_type|lower in ['amex','discover', 'maestro', 'mastercard', 'solo', 'switch', 'visa'] %}<img src="https://{{ config.store_domain }}/static/images/payment_logos/email/{{cc_type|lower}}.png" width="35" style="margin: 0;padding: 0;font-family: Verdana, Helvetica, Arial, sans-serif;max-width: 100%;position: relative;top: 6px;">{% endif %}
    That should get it displaying a image of the payment card logo. If you just wanted to display the type as text, you would replace it just like this:
    {{ cc_number_masked }} ({{ cc_type }})
  • cool thanks
Sign In or Register to comment.