The Foxy forums are on the move!

We're in the process of moving our forums over to a new system, and so these forums are now read-only.
If you have a question about your store in the meantime, please don't hesitate to reach out to us via email.

display card type

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

    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.