Liquid code payment icons

Can you modify this Liquid code to include only the payment icons for Visa, Mastercard, Bancontact, and PayPal, so that the icons appear correctly on my Shopify product page?" Theme = Dawn

Hey @KobeBroos ,

Sure! In the Dawn theme, payment icons are usually rendered using the {{ shop.enabled_payment_types }} object inside a loop that outputs all the accepted payment methods. To show only Visa, Mastercard, Bancontact, and PayPal, you’ll want to filter the payment types manually.

Here’s a Liquid snippet you can use on your Shopify product page (or in your footer, if you’re modifying the payment icons section there):

{% assign allowed_payment_types = "visa,master,bancontact,paypal" | split: "," %}

  

    {% for type in shop.enabled_payment_types %}
      {% if allowed_payment_types contains type %}
        - 
      {% endif %}
    {% endfor %}
  

  

If you want help implementing this, please feel free to reach out to me. Thanks!

Optional CSS (to style the message and icons):

.payment-icons {
  display: flex;
  gap: 10px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.payment-icon svg {
  width: 40px;
  height: auto;
}
.payment-icons-wrapper p {
  font-size: 14px;
  color: #555;
}

Let me know if you’d like me to help implement it directly in your theme files or want it shown on a specific page (like product or cart only).Please feel free to reach out!

Best Regards,

Rajat

Shopify Expert

Hi Rajat,

I would like to show the payment icons on the product page & footer. Can you help me with that?

If I copy paste the above, it doesn’t work unfortunately…