I wanted to change the shopping cart icon in magento 2 and make to change color on mouse hover. I found the block name I dont find how to change the image icon in the block.
thanks in advance
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It only takes a minute to sign up.
Sign up to join this communityI wanted to change the shopping cart icon in magento 2 and make to change color on mouse hover. I found the block name I dont find how to change the image icon in the block.
thanks in advance
In your extended file either _minicart.less or _extend.less
app/design/frontend/vendorname/themename/Magento_Checkout/web/css/source/module/_minicart.less
app/design/frontend/vendorname/themename/Magento_Theme/web/css/source/_extend.less
add below css class and alter you style as per requirements here default css is written and cart icon is coming via Luma Icons with content value "\e611"
you can change them to font-awesome icons or your custom image using background image
.minicart-wrapper .action.showcart::before,
.minicart-wrapper .action.showcart.active::before {
-webkit-font-smoothing: antialiased;
font-size: 22px;
line-height: 28px;
color: #8f8f8f;
content: '\e611';
font-family: 'luma-icons';
margin: 0;
vertical-align: top;
display: inline-block;
font-weight: normal;
overflow: hidden;
speak: none;
text-align: center;
}
.minicart-wrapper .action.showcart:hover::before{
color:#333;
}
I hope this will work for you. If you are using font awsome icons on your site then that will better option and color changing will be flawless
Thanks