How to integrate ReviewForest widgets in Shopware 6
No matter which of our 7 widgets you want to use — from the tree counter widget and the testimonial widget to the badge widgets — integrating them into your Shopware 6 store (version 6.7.x) always works the same way.
Your widget code (structure)
Section titled “Your widget code (structure)”Every widget consists of two building blocks that you copy into your store together:
- The script: it loads the functionality from our servers.
- The placeholder (div): it tells Shopware exactly where the widget should appear.
Here’s what the structure looks like:
<script src="https://widgets.reviewforest.org/main.js" defer></script>
<div class="reviewforest-app-YOUR-INDIVIDUAL-ID"></div>Step by step: integration via Shopping Experiences
Section titled “Step by step: integration via Shopping Experiences”This is the easiest way if you want to place the widget flexibly on your homepage or in a category.
- Open the admin area: Log in to your Shopware backend.
- Choose a layout: Go to Content > Shopping Experiences and open the layout for your page.
- Add a block: Click the plus icon (+) and, under the “Text” category, choose a simple Text block. Drag it to the spot where the widget should appear.
- Enable code mode: Click the text field you just placed. In the toolbar at the top you’ll find the
</>(source code) icon. Click it. - Insert the widget: Delete any sample text and paste your complete widget code (script + div) there.
- Save & check: Click Save in the top right. Reload your store in the browser to see the result.
What to watch out for
Section titled “What to watch out for”🛡️ The “security check” (CSP)
Section titled “🛡️ The “security check” (CSP)”Some stores have very strict security rules (Content Security Policy). If your widget doesn’t appear, Shopware is blocking the loading of external content.
- Solution: Ask your technical team to add the domain
reviewforest.orgto the “whitelist” (allow list).
🍪 Data protection & cookies
Section titled “🍪 Data protection & cookies”Since the widget loads data from ReviewForest, you should register it in your cookie consent tool (consent manager). That keeps you on the safe side when it comes to GDPR.
📱 Mobile view
Section titled “📱 Mobile view”Our widgets are “responsive,” so they adjust automatically. If it ever looks a bit too wide on a smartphone, your admin can help out with a single line of CSS (e.g. max-width: 100%;) so everything fits perfectly.
Pro tip: embed the widget globally in the footer
Section titled “Pro tip: embed the widget globally in the footer”If you want your ReviewForest widget to appear on every page of your store (at the bottom, above the legal notice or the payment methods), you’ll need to make a small change to your design code (theme).
Prerequisite: You should have access to your store’s files (via FTP or through your development agency) and use your own theme (don’t make changes directly in Shopware’s “Default” theme!).
Step 1: Find the right file
Section titled “Step 1: Find the right file”Navigate to the following path in your store directory:
YOUR_THEME/src/Resources/views/storefront/layout/footer/footer.html.twig
If the file doesn’t exist there yet, just create it. It’s used to extend Shopware’s default footer.
Step 2: Insert the code
Section titled “Step 2: Insert the code”Copy the following block into the file. It makes your widget appear in the right place without deleting the rest of the footer:
{% sw_extends '@Storefront/storefront/layout/footer/footer.html.twig' %}
{% block layout_footer_navigation %} {# The original footer content is preserved #} {{ parent() }}
{# This is where we embed your ReviewForest widget #} <div class="container"> <script src="https://widgets.reviewforest.org/main.js" defer></script> <div class="reviewforest-app-YOUR-INDIVIDUAL-ID" style="margin-top: 20px; text-align: center;"></div> </div>{% endblock %}Step 3: Clear the cache
Section titled “Step 3: Clear the cache”For Shopware to notice the change, you need to clear the cache. You can do this either in the admin area under Settings > System > Caches & indexes or via the console (terminal):
bin/console cache:clear
Step 4: Recompile the theme
Section titled “Step 4: Recompile the theme”In some cases you’ll need to rebuild the theme once so the script gets linked correctly:
bin/console theme:compile
What your technical team needs to know (short facts)
Section titled “What your technical team needs to know (short facts)”If you’d rather not do this yourself, just copy this part into an email to your agency:
- Goal: Embed the global ReviewForest widget in Shopware 6.7.x.
- Integration: Via a child theme in
footer.html.twig. - Placement: Ideally in the
layout_footer_navigationorlayout_footer_bottomblock. - Important (CSP): Please check the Content Security Policy. The domain
widgets.reviewforest.orgmust be allowed forscript-srcandconnect-srcso the widget can load its data. - Performance: The script uses
defer, so it doesn’t negatively affect rendering.