Custom "No Products" messages and images per category for Shopware 6.7 with optional parent category inheritance.
| Feature | Description |
|---|---|
| Custom Empty Messages | Define individual HTML messages per category when no products are available |
| Category Images | Add optional images (e.g., sad smiley) to empty category states |
| Image Size Control | Small (150px), Medium (250px), or Large (400px) |
| Flexible Alignment | Separate image and text alignment (left, center, right) |
| CSS Classes | Add custom CSS classes for individual styling |
| Parent Inheritance | Optionally inherit empty messages from parent categories |
| Multi-Language | German and English translations included |
Installation via the Shopware Store is recommended. After download, you can install the plugin directly from the backend.
composer require mmd/sw67-empty-category
bin/console plugin:install --activate MmdEmptyCategory
bin/console cache:clear
custom/plugins/MmdEmptyCategorybin/console plugin:refresh
bin/console plugin:install --activate MmdEmptyCategory
bin/console cache:clear
| Field | Description |
|---|---|
| Message | HTML text shown when category has no products |
| Image | Optional image to display (e.g., a sad smiley) |
| Image Size | Small (150px), Medium (250px), Large (400px) |
| Image Alignment | Left, Center, Right |
| Text Alignment | Left, Center, Right |
| CSS Classes | Additional CSS classes for custom styling |
| Inherit from Parent | Use parent category message if no own message defined |
A "Christmas Specials" category that is empty outside the season:
Message:
<h3>Coming Soon!</h3>
<p>Our Christmas specials will be available from November. Check back soon!</p>
Image: A festive placeholder image
Image Size: Large
Text Alignment: Center
A category where products are temporarily unavailable:
Message:
<p>All products in this category are currently sold out.
We're working hard to restock - please check back soon!</p>
CSS Class: alert-warning
Parent category "Electronics" with message:
<p>No products available in this category at the moment.</p>
Child categories "Smartphones", "Tablets", "Laptops" all set Inherit from Parent: Yes
Result: All child categories show the parent's message without needing individual configuration.
When "Inherit from Parent" is enabled and no custom message is defined:
The plugin outputs structured HTML that you can style:
<div class="mmd-empty-category-message your-custom-class">
<div class="mmd-empty-category-image-wrapper">
<img class="mmd-empty-category-image" ...>
</div>
<div class="mmd-empty-category-text">
Your message content
</div>
</div>
Add this to your theme's SCSS:
.mmd-empty-category-message {
padding: 2rem;
background: #f8f9fa;
border-radius: 8px;
text-align: center;
.mmd-empty-category-image {
margin-bottom: 1rem;
}
.mmd-empty-category-text {
color: #666;
h3 {
color: #333;
margin-bottom: 0.5rem;
}
}
}
The plugin provides a Twig function for custom template usage:
{% set emptyMessage = mmd_empty_category_message(category) %}
{% if emptyMessage.hasContent() %}
{{ emptyMessage.message|sw_sanitize }}
{% endif %}
| Method | Returns | Description |
|---|---|---|
hasContent() |
bool | Has message or image |
hasMessage() |
bool | Has text message |
hasImage() |
bool | Has image URL |
getImageMaxWidth() |
string | CSS max-width value |
getImageJustify() |
string | CSS justify-content value |
getTextAlignCss() |
string | CSS text-align value |
| Property | Type | Description |
|---|---|---|
message |
string | HTML message content |
imageUrl |
string | Media URL |
cssClass |
string | Sanitized CSS classes |
imageSize |
string | small, medium, large |
imageAlign |
string | left, center, right |
textAlign |
string | left, center, right |
sw_sanitize filterThis Plugin is released under the GNU General Public License v3.
See LICENSE for details.
For questions, issues, or contributions:
Markus Michalski
Email: support@markus-michalski.net
GitHub: markus-michalski/shopware6-empty-category-67