Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Ability to overwrite the mini cart icon #7072

Closed
wants to merge 1 commit into from

Conversation

thirumani02
Copy link

Sometimes, themes may need to add their own cart icon to keep the consistency with their other icons. I believe filtering the icon would help to overwrite the icon.

Changelog

Line 379 & Line 383 - Wrapping the icon with apply_filters.

Sometimes, themes may need to add their own cart icon to keep the consistency with their other icons. I believe filtering the icon would help to overwrite the icon.
@Aljullu
Copy link
Contributor

Aljullu commented Sep 12, 2022

Thanks for opening this PR, @thirumani02! Really appreciated for your effort to improve the Mini Cart block.

We agree this is a valid use case and we would like to offer the possibility to customize that icon. However, I'm not sure a PHP filter is the best option here.

Let me explain the reasons:

  • We are planning to allow changing the icon from the editor at some point (see Mini Cart > alternative icons #6868). This will allow users to directly change the icon from the UI, without needing to dig into the code. Introducing a PHP filter that overrides that option might be confusing for users.
  • We acknowledge that some themes might want to set a custom icon to provide a more curated look and feel. In those cases, however, we would like to experiment if there is a better API we can offer than a PHP filter. One idea would be to add an attribute in theme.json to allow themes to define a custom Mini Cart icon.

Let us know if you would like to explore #6868 or the theme.json approach and we will be happy to help. In the meanwhile, however, I will close this PR.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants