Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save carolineschnapp/d92d85334239bde62257 to your computer and use it in GitHub Desktop.
Save carolineschnapp/d92d85334239bde62257 to your computer and use it in GitHub Desktop.
Replace monochrome methods of payment in Timber-based themes to colorful SVG icons

What you have

Alt text

What you want

Alt text

How to get it

  1. Open theme.liquid file in the online code editor.

  2. Look for this code:

    <li>
      <span class="icon-fallback-text">
        <span class="icon icon-{{type}}" aria-hidden="true"></span>
        <span class="fallback-text">{{ type | replace: '_',' '}}</span>
      </span>
    </li>
  3. Replace with:

    <li>
      <img width="50" height="31" src="{{ type | payment_type_img_url }}">
    </li>
@akvrmvlakis
Copy link

  1. = The code is wrong and doesn't work the correct code is the following:

<li> <span class="icon-fallback-text"> <img width="50" height="31" src="{{ type | payment_type_img_url }}"> </span> </li>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment