Markus Michalski FAQ

Product Snippets: Troubleshooting and FAQ

Product Snippets for Shopware - typical problems with symptom, check and solution: placeholders showing in the shop, changes not visible, HTML missing on product cards, plus known limitations and FAQ

Deutsche Version

Back to overview

Product Snippets: Troubleshooting and FAQ

Live Demo: Try this and other plugins live — no installation, no risk: demo.markus-michalski.net

Troubleshooting

Symptom: The placeholder {{snippet:...}} appears unchanged in the shop.

Check:

  1. Does a snippet with exactly this identifier exist and is Active switched on? Unknown and inactive snippets are not replaced.
  2. Does the identifier consist only of letters, digits, hyphens and underscores? A placeholder with other characters is not recognized, see Identifier rules.
  3. Is content stored for the language in which you view the shop? If it is missing, the placeholder stays in place. If the content exists but is empty, the placeholder disappears and nothing is shown.
  4. Is the placeholder in a place where the plugin replaces it, that is in the product description of the CMS product layout or on a product card? Nothing is replaced in CMS text elements, category descriptions or custom fields, see Storefront Integration.
  5. Is the description output through one of the effective plugin templates? If your theme overrides the block, it has to apply the mmd_snippets filter itself.

Solution: Fix the cause you found, then run bin/console cache:clear.

Symptom: I changed a snippet, but the shop still shows the old state.

Check: Did you change only the content or the name, or did you toggle Active? Such changes do not trigger a cache invalidation, see Technical Details. A deactivated snippet therefore stays visible, and a newly activated one does not appear yet.

Solution: Run bin/console cache:clear or wait up to one hour. If you use an HTTP cache, the cached product page may additionally contain the old state, so you have to clear that cache as well.

Symptom: The formatting of the snippet is missing on the product card in the listing.

Check: Is it the description preview of a product card?

Solution: This is intended. On product cards the description is reduced to plain text with striptags after the replacement. The formatting is kept in the product description of the product layout.

Symptom: An element or attribute from the content is missing in the output.

Check: Does the content contain scripts, event attributes or other unsafe parts?

Solution: Shopware's HTML sanitizer removes such parts when the content is inserted. Use regular HTML instead.

Symptom: A snippet with uppercase letters in the identifier cannot be created.

Check: Is there already a snippet that differs only in case?

Solution: The identifier is unique regardless of case. Choose a different name.

Symptom: The admin menu entry is missing or the admin interface misbehaves.

Check: Did you clear the browser cache and activate the plugin after the installation?

Solution: Clear the browser cache, run bin/console assets:install and bin/console cache:clear, and reload the administration. The browser console shows further errors.

Known limitations

FAQ

Is the content inserted exactly as I enter it? No. The content is cleaned with Shopware's HTML sanitizer, unsafe parts are removed.

How many database queries are there? One cache lookup per distinct identifier of a description, plus a repository search on a miss. After that the content stays in the cache for an hour.

Can I use the mmd_snippet() function in product descriptions? No. It only works in Twig templates. In stored content use the placeholder syntax.

What happens on uninstall? The tables and with them all snippets are dropped, unless you keep the user data. See Installation.