Summary
In .shopware-extension.yml, the store image field priority sorts images ascending:
Specifies the order of the image ascending the given priority.
(internal/extension/config.go, ConfigStoreImage.Priority, mirrored in config_schema.json)
So the image with the lowest value is shown first in the store gallery. That is the behavior of a position, not a priority.
Why this is confusing
Everywhere else in the Shopware/Symfony ecosystem, "priority" means "higher value wins / runs first":
- Symfony event listener priorities (higher = earlier)
- Service decoration priorities
- Even within this repo:
internal/markdown/markdown.go uses "Priority < 1000 makes it win over the default"
A developer reading priority: 1 vs priority: 7 can reasonably assume the image with priority 7 is shown first — and end up with their cover image at the end of the slider. The only hint to the actual behavior is one sentence in the schema description.
Suggestion
Rename the field to position (or order), which matches the ascending semantics and also matches the wording used in the Shopware admin/store context:
store:
images:
- file: src/Resources/store/images/en/01-cover.png
position: 1 # shown first
To stay backwards compatible, priority could be kept as a deprecated alias for a few releases (with a deprecation notice during extension validate / account producer extension info push).
If a rename is not wanted, at minimum the schema description could be made more explicit, e.g.:
Position of the image in the store gallery. Images are sorted ascending — the lowest value is shown first.
Happy to open a PR for either variant if you let me know which direction you prefer.
Summary
In
.shopware-extension.yml, the store image fieldprioritysorts images ascending:(
internal/extension/config.go,ConfigStoreImage.Priority, mirrored inconfig_schema.json)So the image with the lowest value is shown first in the store gallery. That is the behavior of a position, not a priority.
Why this is confusing
Everywhere else in the Shopware/Symfony ecosystem, "priority" means "higher value wins / runs first":
internal/markdown/markdown.gouses "Priority < 1000 makes it win over the default"A developer reading
priority: 1vspriority: 7can reasonably assume the image with priority 7 is shown first — and end up with their cover image at the end of the slider. The only hint to the actual behavior is one sentence in the schema description.Suggestion
Rename the field to
position(ororder), which matches the ascending semantics and also matches the wording used in the Shopware admin/store context:To stay backwards compatible,
prioritycould be kept as a deprecated alias for a few releases (with a deprecation notice duringextension validate/account producer extension info push).If a rename is not wanted, at minimum the schema description could be made more explicit, e.g.:
Happy to open a PR for either variant if you let me know which direction you prefer.