Archived topic
WooCommerce change cart icon
16 replies · Started by Jamal on June 24, 2017
Hi
Is there any way to change cart icon to fa-shopping-basket ?
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 :)
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.
Perfect, works as intended. Thanks guys !
No problem :)
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
This should help: https://docs.generatepress.com/article/generate_woocommerce_menu_cart_icon/
Let me know :)
Doesn't seem to work unfortunately. It removes old icon but doesn't replace it with fa-shopping-basket
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>';
}
Yes Tom i have done exactly that. This is a screenshot from the frontend [ Screenshot removed ]
Ah, so the filter is working, but the icon isn't.
Are you using the Font Awesome essentials filter by chance?
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
Hmm, can you link me to the site?
Link removed
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).