
This guide provides a step-by-step walkthrough for adding a MapCosmos store locator widget to your Shopware storefront.
š If you havenāt created a widget yet, follow our setup guide first.
Since Shopware templates are Twig-based, youāll insert the MapCosmos snippet into a CMS page or theme template.
1. Go to Content ā Shopping Experiences in your Shopware admin.

2. Create a new Layout (or edit an existing one).
3.
4. Add a Custom HTML element to the section where you want the locator.

5. Paste the MapCosmos snippet into the HTML field and delta the sample text.

6. Click Save ā Assign layout to page ā View in storefront to see the real output.
If you prefer a dedicated page for the locator:
Inside it, paste:
{% sw_extends '@Storefront/storefront/base.html.twig' %}
{% block base_content %}
<h1>Find a Store</h1>
<script type="text/javascript" src="https://widget.mapcosmos.com/map-widget.js?key=WIDGET_KEY" async></script>
<div id="map-cosmos-map-widget"></div>
{% endblock %}Clear the cache and recompile theme:
bin/console cache:clear
bin/console theme:compile
ā
Search instantly for nearby locations
ā
Get directions with one click (Google/Apple Maps)
ā
Filter results by category, product, or service
ā
Access opening hours, parking, and accessibility details
ā
Download PDFs like catalogs or menus directly
š Start with MapCosmos free today and add a powerful, responsive store locator to your Shopware storefront in minutes.