[Resolved] WooCommerce change cart icon

Home Forums Support [Resolved] WooCommerce change cart icon

Home Forums Support WooCommerce change cart icon

Viewing 15 posts - 1 through 15 (of 17 total)
  • Author
    Posts
  • #338487
    Jamal

    Hi

    Is there any way to change cart icon to fa-shopping-basket ?

    #338507
    Leo
    Staff
    Customer Support

    Hi Jamal,

    I could be wrong about this but I think you can simply add a custom link with the cart page as the URL and preferable icon as the navigation label.

    Just tried it I didn’t see anything wrong with that.

    Perhaps Tom would have a cooler way πŸ™‚

    #338528
    Tom
    Lead Developer
    Lead Developer

    Right now you would have to overwrite the icon:

    .cart-contents .fa-shopping-cart:before {
        content: "\f291";
    }

    I’ll be sure to add a filter here so it’s easier in the future.

    #338682
    Jamal

    Perfect, works as intended. Thanks guys !

    #338842
    Tom
    Lead Developer
    Lead Developer

    No problem πŸ™‚

    #366520
    Jamal

    This is no longer working after updating to GP 1.4. How can i apply the filter generate_woocommerce_menu_cart_icon ? Returning my new icon doesn’t do the trick. Thanks in advance

    #366725
    Tom
    Lead Developer
    Lead Developer
    #367002
    Jamal

    Doesn’t seem to work unfortunately. It removes old icon but doesn’t replace it with fa-shopping-basket

    #367282
    Tom
    Lead Developer
    Lead Developer

    So you’ve done this?:

    add_filter( 'generate_woocommerce_menu_cart_icon', 'tu_change_wc_menu_cart_icon' );
    function tu_change_wc_menu_cart_icon() {
        return '<i class="fa fa-shopping-basket" aria-hidden="true"></i>';
    }
    #367512
    Jamal

    Yes Tom i have done exactly that. This is a screenshot from the frontend [ Screenshot removed ]

    #367664
    Tom
    Lead Developer
    Lead Developer

    Ah, so the filter is working, but the icon isn’t.

    Are you using the Font Awesome essentials filter by chance?

    #367764
    Jamal

    No i checked that first thing. As usual, it must be something im doing wrong but can’t figure out what. After updating theme, this method was no longer working as well https://generatepress.com/forums/topic/woocommerce-change-cart-icon/#post-338528

    #368043
    Tom
    Lead Developer
    Lead Developer

    Hmm, can you link me to the site?

    #368228
    Jamal

    Link removed

    #368369
    Tom
    Lead Developer
    Lead Developer

    You’re using a plugin that is taking over the Font Awesome file: https://fungi.cannysolutions.se/wp-content/plugins/load-more-products-for-woocommerce/css/font-awesome.min.css

    It’s essential for developers who are enqueuing Font Awesome to add the version number, this way WordPress will use the latest version.

    It seems this developer hasn’t added a version number, so it uses the WP version (4.8).

    The current version of FA is 4.7, so WP is loading their stylesheet, even though they’re truly using FA 4.3 (which likely doesn’t have that icon in it).

Viewing 15 posts - 1 through 15 (of 17 total)
  • You must be logged in to reply to this topic.