Custom "No Products" messages and images per category for Shopware 6.7 with optional parent category inheritance.
Live Demo: Try all OXID eShop and Shopware plugins by Markus Michalski live — no installation, no risk. demo.markus-michalski.net
| 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 |
| CSP Compatible | No inline styles — all styling via CSS classes (strict Content Security Policy compatible) |
1. Add Private Repository
{"repositories": [{"type": "composer","url": "https://packeton.markus-michalski.net"}]}
The repository credentials will be provided after license purchase.
2. Install Plugin
composer require mmd/sw67-empty-category
3. Activate Plugin
bin/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 uses BEM-style CSS classes for all layout and alignment — no inline styles are used, making it fully compatible with strict Content Security Policies (CSP).
<div class="mmd-empty-category-message your-custom-class">
<div class="mmd-empty-category-image-wrapper mmd-empty-category-image-wrapper--align-center">
<img class="mmd-empty-category-image mmd-empty-category-image--size-medium" ...>
</div>
<div class="mmd-empty-category-text mmd-empty-category-text--align-center">
Your message content
</div>
</div>
| Class | Variants | Description |
|---|---|---|
mmd-empty-category-image-wrapper--align-{value} |
left, center, right |
Image container alignment |
mmd-empty-category-image--size-{value} |
small (150px), medium (250px), large (400px) |
Image max-width |
mmd-empty-category-text--align-{value} |
left, center, right |
Text alignment |
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 (e.g., 250px) |
getImageJustify() |
string | CSS justify-content value (e.g., center) |
getTextAlignCss() |
string | CSS text-align value (e.g., center) |
| 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 filterstyle-src policiesThis Plugin is released under the GNU General Public License v3.
See LICENSE for details.
For customers who purchased this plugin through the Shopware Store, technical support is provided exclusively through the official Shopware support ticket system in your Shopware account. For general, project-related, or commercial inquiries outside the scope of the Store framework, you can reach me at support@markus-michalski.net.