Where you can achieve what your competitors can’t


Payment Icons on Shopify

Code will detect and display enabled payment methods automatically :

<style>
.icon-list-custom {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  justify-content: center;
  margin: 0;
  gap: 8px;
  padding: 0;
  margin-top: -1rem;
}

/* Base size (Desktop and larger screens) */
.icon-list-custom .icon-svg {
  width: 38px;
  height: 24px;
  display: block;
}

/* Mobile size (Screens smaller than 768px) */
@media only screen and (max-width: 767px) {
  .icon-list-custom .icon-svg {
    width: 34px;
    height: 24px;
  }
}
</style>

<ul class="icon-list-custom" role="list">
  {% for type in shop.enabled_payment_types %}
    <li>{{ type | payment_type_svg_tag: class: 'icon-svg' }}</li>
  {% endfor %}
</ul>

Code with manually defined payment icons :

<style>
  .icon-list-custom {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    justify-content: center;
    margin: 0;
    gap: 8px;
    padding: 0;
    margin-top: -1rem;
  }

  .icon-list-custom .icon-svg {
    width: 38px;
    height: 24px;
    display: block;
  }

  @media only screen and (max-width: 767px) {
    .icon-list-custom .icon-svg {
      width: 34px;
      height: 24px;
    }
  }
</style>

{%- assign desired_types = 'visa,apple_pay,google_pay,paypal,master' | split: ',' -%}

<ul class="icon-list-custom" role="list">
  {%- for desired in desired_types -%}
    <li>
      {{ desired | payment_type_svg_tag: class: 'icon-svg' }}
    </li>
  {%- endfor -%}
</ul>