Skip to content

Commit

Permalink
Only show switcher if we have more than one store
Browse files Browse the repository at this point in the history
  • Loading branch information
lukeholder committed Jan 30, 2025
1 parent cf6a774 commit 91d6531
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/templates/_layouts/store-management.twig
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,12 @@
{% set store = craft.commerce.stores.getStoreByHandle(storeHandle) %}
{% set defaultCrumbs = [
{ label: 'Commerce'|t('commerce'), url: url('commerce') },
storeSwitcher,
] %}

{% if craft.commerce.stores.getAllStores().count() > 1 %}
{% set defaultCrumbs = defaultCrumbs|merge(storeSwitcher) %}
{% endif %}

{% set crumbs = not isIndex ? defaultCrumbs|merge(crumbs is not defined ? [] : crumbs) : defaultCrumbs %}

{% set title = title is not defined ? 'Store Management'|t('commerce') : title %}
Expand Down

0 comments on commit 91d6531

Please sign in to comment.