Closed (works as designed)
Project:
Commerce Core
Version:
8.x-2.0-rc3
Component:
Cart
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
20 Sep 2017 at 10:46 UTC
Updated:
28 Mar 2024 at 19:08 UTC
Jump to comment: Most recent
Comments
Comment #2
Ujval Shah commentedComment #3
willeaton commentedI believe this is done through theming. In your theme, open up the MYTHEME.theme file. Using twig debug mode you can identify the preprocess function you need to create, in this case:
commerce_cart_block
In there you can debug the variables provided, one of which is the icon. So lets say you want to change from #FFFFFF to #BEBEBE you would do the following:
By the same means you can change any other aspect of the cart block here, even providing more info to the twig file, which you can also overwrite.
Comment #4
willeaton commentedExtension...
Using the SVG icons provided you can actually change the image to whatever colour you want. I think this would actually make sense to be the default icon. Here is my code snippet in case it helps anyone in the future
Comment #5
mariogalan commentedVery useful, thanks @willeaton!
Comment #6
fahadurrehman commentedThanks for such a useful snippet. Is there any way we can change the viewBox value ?
Comment #7
rwilson0429 commentedThanks @willeaton. Using the code snippet in #4, the icon css is inline, so, I had to use the css !important attribute in an external css file to override the inline style.
Comment #8
Annelies Van der Wee commentedThank you all, works like a charm!
Comment #9
yurg commentedFor those found this in 2024: drupal_get_path() is deprecated.
Now it is \Drupal::service('extension.list.module')->getPath('commerce')