• Resolved Sho-Down

    (@sho-down)


    Hi. I have a lot of products and purchase options on each page so the SVG loads A LOT which increases my DOM size. This code is loading 70+ times on each page:

    <svg class="edd-icon edd-icon-check" xmlns="https://www.w3.org/2000/svg" width="28" height="28" viewbox="0 0 28 28" aria-hidden="true">
    <path d="M26.11 8.844c0 .39-.157.78-.44 1.062L12.234 23.344c-.28.28-.672.438-1.062.438s-.78-.156-1.06-.438l-7.782-7.78c-.28-.282-.438-.673-.438-1.063s.156-.78.438-1.06l2.125-2.126c.28-.28.672-.438 1.062-.438s.78.156 1.062.438l4.594 4.61L21.42 5.656c.282-.28.673-.438 1.063-.438s.78.155 1.062.437l2.125 2.125c.28.28.438.672.438 1.062z"/>
    </svg>

    I want to replace EDD’s svg code with a locally hosted font icon, is this possible through my functions.php file? I see it’s called from edd’s template-functions.php file but not sure how to replace the svg with something like:

    <i class="fa fa-check"></i>
Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi @sho-down

    The icon ‘edd-icon edd-icon-check’ is coming from the template function ‘edd_get_purchase_link’.

    File location is : /easy-digital-downloads/includes/template-functions.php

    The above icon can not be changed via templating method but there is a filter named ‘edd_purchase_download_form’. With the help of this filter you can write your custom code and replace the SVG icon with your Fa icon.

    I hope it helps.

    Thread Starter Sho-Down

    (@sho-down)

    @pratik-jain thanks for the reply Pratik, I’ll tap into that filter to change the icon.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Replace the SVG “edd-icon-check” with a font icon’ is closed to new replies.