Google Shopping PRO für Shopware 6

Unser Plugin "Google Shopping PRO für Shopware 6" unterstützt Dich bei der Pflege der Produktdaten für Deine Produkte im Google Shopping.

Hier geht es zum Plugin im Shopware Community Store:
Google Shopping PRO Plugin für Shopware 6

Funktionalitäten

  • Du kannst pro Artikel/Variante alle notwendigen Werte für Google Shopping angeben.
  • Der Produktname und die Produktbeschreibung kann angegeben werden.
  • Google Shopping Kategorien können einfach per Dropdown-Menü festgelegt werden.
  • Es können bis zu 5 Custom Labels verwendet werden.

Installationsanleitung

  1. Installiere und aktiviere das Plugin.
  2. Öffne YOUR_SHOP_URL/lenz_google_shopping/update_taxonomy um die Google Shopping Kategorien einmalig zu importieren.
  3. Nun muss das Google Shopping für Shopware 6 eingerichtet werden. Eine genaue Anleitung findest Du im nächsten Abschnitt.
  4. Nun muss der Google Shopping Feed im Merchant Center eingerichtet werden. Eine genaue Anleitung findest Du hier:  Shopware Feed in Google Merchant Center einrichten

Google Shopping für Shopware 6 einrichten

Nach der Installation des Plugins kann Google Shopping für Shopware 6 eingerichtet werden, hier ist die genaue Anleitung.

Klicke nun auf "Kataloge -> Dynamische Produktgruppen" und erstelle eine neue Produktgruppe. Gib als Namen "Google Shopping Produktgruppe" an und gib als Regel "Aktiv: Ja" ein. Damit sind alle Produkte eingeschlossen, die Aktiv sind. Die Regeln lassen sich weiter einschränken.

Lege anschließend einen neuen Sales-Channel vom Typ "Product comparision" an.
Wähle die folgenden Einstellungen auf der nun erscheinenden Seite:

Einstellung
 
Wert
 
Template Google Shopping (XML)
Name Google Shopping Feed
Storefront Verkaufskanal Storefront des Shops für den der Feed angelegt wird
Dateiname google-shopping-feed.xml
Verschlüsselung UTF-8
Dateiformat XML
Varianten als eigene Produkte exportieren Ja
Generierungsintervall Live
Per Scheduler generieren deaktiviert
Dynamische Produktgruppe Google Shopping Produktgruppe
Status Aktiv


Speicher nun. Es erscheinen die zusätzlichen Tabs "Theme" und "Template". Klicke auf "Template". Befülle die drei Blöcke mit den nachfolgend definierten Werten und speicher die Seite erneut.

Header row / Kopfzeile

<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0" xmlns:g="http://base.google.com/ns/1.0" xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
        <atom:link href="{{ productExport.salesChannelDomain.url }}/export/{{ productExport.accessKey }}/{{ productExport.fileName }}" rel="self" type="application/rss+xml" />
        <title>{{ context.salesChannel.name }}</title>
        <description>{# change your shop's description #}</description>
        <link>{{ productExport.salesChannelDomain.url }}</link>
        <language>{{ productExport.salesChannelDomain.language.locale.code }}</language>
        <image>
            <url>{# add your logo URL #}</url>
            <title>{{ context.salesChannel.name }}</title>
            <link>{{ productExport.salesChannelDomain.url }}</link>
        </image>

Product row / Produktzeile

{# Entferne diese Zeile, um alle Produkte zu Google Shopping zu übertragen #}
{#% if product.customFields and product.customFields.lenz_google_shopping_active is defined and product.customFields.lenz_google_shopping_active == 1 %#}

{% set sizeByOption = '' %}
{% set colorByOption = '' %}
{% set genderByOption = '' %}

{% for group in product.sortedProperties %}
    {% for option in group.options %}
        {% if group.name == "Größe" and option.id in product.optionIds %}
            {% set sizeByOption = option.name %}
        {% endif %}

        {% if group.name == "Farbe" and option.id in product.optionIds %}
            {% set colorByOption = option.name %}
        {% endif %}

        {% if group.name == "Geschlecht" %}
            {% set genderByOption = option.name %}
        {% endif %}
    {% endfor %}
{% endfor %}

{% set imageCounter = 0 %}
<item>
    <g:id>{{ product.productNumber }}</g:id>
    <g:title>{% if product.customFields.lenz_google_shopping_title is defined and product.customFields.lenz_google_shopping_title != "" %}{{ product.customFields.lenz_google_shopping_title|escape }}{% else %}{{ product.translated.name|escape }}{% endif %}</g:title>
    <g:description>{{ product.translated.description|striptags|escape }}</g:description>
    <link>{{ seoUrl('frontend.detail.page', {'productId': product.id}) }}</link>
    {% for key, media in product.media|sort((a, b) => a.position <=> b.position) %}
        {% if imageCounter == 0 %}
            <g:image_link>{{ media.media.url }}</g:image_link>
        {% elseif imageCounter < 10 %}
            <g:additional_image_link>{{ media.media.url }}</g:additional_image_link>
        {% endif %}

        {% set imageCounter = imageCounter + 1 %}
    {% endfor %}
    <g:availability>{% spaceless %}
        {% if product.availableStock >= product.minPurchase and product.deliveryTime %}
            in_stock
        {% elseif (product.availableStock < product.minPurchase) and product.deliveryTime and product.restockTime %}
            preorder
        {% else %}
            out_of_stock
        {% endif %}
    {% endspaceless %}</g:availability>
	{% if product.customFields.lenz_google_shopping_expiration_date is defined and product.customFields.lenz_google_shopping_expiration_date != '' %}<g:expiration_date>{{ product.customFields.lenz_google_shopping_expiration_date }}</g:expiration_date>{% endif %}
    {% if product.price.first.listPrice.gross is defined and product.price.first.listPrice.gross > product.calculatedListingPrice.to.unitPrice %}
        <g:price>{{ product.price.first.listPrice.gross|number_format(context.currency.decimalPrecision, '.', '') }} {{ context.currency.isoCode }}</g:price>
        <g:sale_price>{{ product.calculatedListingPrice.to.unitPrice|number_format(context.currency.decimalPrecision, '.', '') }} {{ context.currency.isoCode }}</g:sale_price>
    {% else %}
        <g:price>{{ product.calculatedListingPrice.to.unitPrice|number_format(context.currency.decimalPrecision, '.', '') }} {{ context.currency.isoCode }}</g:price>
    {% endif %}
    {% if product.purchaseunit and product.referenceunit and product.unit %}
        <g:unit_pricing_measure>{{ product.purchaseunit }} {{ product.unit.name|replace({'Stück': 'ct', 'Stck.': 'ct', 'm²': 'sqm', 'Milliliter': 'ml', 'Liter': 'l', 'Kilogramm': 'kg', 'Gramm': 'g', 'Zentimeter': 'cm', 'Meter': 'm'}) }}</g:unit_pricing_measure>
	<g:unit_pricing_base_measure>{{ product.referenceunit }} {{ product.unit.name|replace({'Stück': 'ct', 'Stck.': 'ct', 'm²': 'sqm', 'Milliliter': 'ml', 'Liter': 'l', 'Kilogramm': 'kg', 'Gramm': 'g', 'Zentimeter': 'cm', 'Meter': 'm'}) }}</g:unit_pricing_base_measure>
    {% endif %}
    <g:google_product_category>{% if product.customFields.lenz_google_shopping_category_number is defined %}{{ product.customFields.lenz_google_shopping_category_number }}{% else %}{# Default product category here #}{% endif %}</g:google_product_category>
    <g:product_type>{% if product.categories|length > 0 %}{{ product.categories.first.getBreadCrumb|slice(1)|join(' > ')|raw|escape }}{% endif %}</g:product_type>
    {% if product.manufacturer is defined and product.manufacturer is not null %}<g:brand>{{ product.manufacturer.name|escape }}</g:brand>{% endif %}
    <g:gtin>{{ product.ean|escape }}</g:gtin>
    <g:mpn>{{ product.manufacturerNumber|escape }}</g:mpn>
	<g:identifier_exists>{% if product.ean or (product.manufacturer is defined and product.manufacturer is not null and product.manufacturer.name and product.manufacturerNumber) %}yes{% else %}no{% endif %}</g:identifier_exists>
	<g:condition>{% if product.customFields.lenz_google_shopping_condition is defined and product.customFields.lenz_google_shopping_condition != '' %}{{ product.customFields.lenz_google_shopping_condition|escape }}{% else %}new{% endif %}</g:condition>
    <g:adult>{% if product.customFields.lenz_google_shopping_adult is defined and product.customFields.lenz_google_shopping_adult != '' %}yes{% else %}no{% endif %}</g:adult>
    {% if product.customFields.lenz_google_shopping_multipack is defined and product.customFields.lenz_google_shopping_multipack != '' %}<g:multipack>{{ product.customFields.lenz_google_shopping_multipack|escape }}</g:multipack>{% endif %}
    {% if product.customFields.lenz_google_shopping_is_bundle is defined and product.customFields.lenz_google_shopping_is_bundle != '' %}<g:is_bundle>yes</g:is_bundle>{% endif %}
    {% if product.customFields.lenz_google_shopping_energy_efficiency_class is defined and product.customFields.lenz_google_shopping_energy_efficiency_class != '' %}<g:energy_efficiency_class>{{ product.customFields.lenz_google_shopping_energy_efficiency_class|escape }}</g:energy_efficiency_class>{% endif %}
    {% if product.customFields.lenz_google_shopping_min_energy_efficiency_class is defined and product.customFields.lenz_google_shopping_min_energy_efficiency_class != '' %}<g:min_energy_efficiency_class>{{ product.customFields.lenz_google_shopping_min_energy_efficiency_class|escape }}</g:min_energy_efficiency_class>{% endif %}
    {% if product.customFields.lenz_google_shopping_max_energy_efficiency_class is defined and product.customFields.lenz_google_shopping_max_energy_efficiency_class != '' %}<g:max_energy_efficiency_class>{{ product.customFields.lenz_google_shopping_max_energy_efficiency_class|escape }}</g:max_energy_efficiency_class>{% endif %}
    {% if product.customFields.lenz_google_shopping_age_group is defined and product.customFields.lenz_google_shopping_age_group != '' %}<g:age_group>{{ product.customFields.lenz_google_shopping_age_group|escape }}</g:age_group>{% endif %}
    {% if product.customFields.lenz_google_shopping_color is defined and product.customFields.lenz_google_shopping_color != '' %}<g:color>{{ product.customFields.lenz_google_shopping_color|escape }}</g:color>{% elseif colorByOption != "" %}<g:color>{{ colorByOption|escape}}</g:color>{% endif %}
    {% if product.customFields.lenz_google_shopping_gender is defined and product.customFields.lenz_google_shopping_gender != '' %}<g:gender>{{ product.customFields.lenz_google_shopping_gender|escape }}</g:gender>{% elseif genderByOption != "" %}<g:gender>{{ genderByOption|escape }}</g:gender>{% endif %}
    {% if product.customFields.lenz_google_shopping_material is defined and product.customFields.lenz_google_shopping_material != '' %}<g:material>{{ product.customFields.lenz_google_shopping_material|escape }}</g:material>{% endif %}
    {% if product.customFields.lenz_google_shopping_pattern is defined and product.customFields.lenz_google_shopping_pattern != '' %}<g:pattern>{{ product.customFields.lenz_google_shopping_pattern|escape }}</g:pattern>{% endif %}
    {% if product.customFields.lenz_google_shopping_size is defined and product.customFields.lenz_google_shopping_size != '' %}<g:size>{{ product.customFields.lenz_google_shopping_size|escape }}</g:size>{% elseif sizeByOption != '' %}<g:size>{{ sizeByOption }}</g:size>{% endif %}
    {% if product.customFields.lenz_google_shopping_size_type is defined and product.customFields.lenz_google_shopping_size_type != '' %}<g:size_type>{{ product.customFields.lenz_google_shopping_size_type|escape }}</g:size_type>{% endif %}
    {% if product.customFields.lenz_google_shopping_size_system is defined and product.customFields.lenz_google_shopping_size_system != '' %}<g:size_system>{{ product.customFields.lenz_google_shopping_size_system|escape }}</g:size_system>{% endif %}
    {% if product.customFields.lenz_google_shopping_item_group_id is defined and product.customFields.lenz_google_shopping_item_group_id != '' %}<g:item_group_id>{{ product.customFields.lenz_google_shopping_item_group_id|escape }}</g:item_group_id>{% elseif product.parentId is not null %}<g:item_group_id>{{ product.parentId|escape }}</g:item_group_id>{% endif %}
    {% if product.customFields.lenz_google_shopping_product_highlight is defined and product.customFields.lenz_google_shopping_product_highlight != '' %}<g:product_highlight>{{ product.customFields.lenz_google_shopping_product_highlight|escape }}</g:product_highlight>{% endif %}
    <g:custom_label_0>{% if product.customFields.lenz_google_shopping_custom_label0 is defined %}{{ product.customFields.lenz_google_shopping_custom_label0|escape }}{% endif %}</g:custom_label_0>
    <g:custom_label_1>{% if product.customFields.lenz_google_shopping_custom_label1 is defined %}{{ product.customFields.lenz_google_shopping_custom_label1|escape }}{% endif %}</g:custom_label_1>
    <g:custom_label_2>{% if product.customFields.lenz_google_shopping_custom_label2 is defined %}{{ product.customFields.lenz_google_shopping_custom_label2|escape }}{% endif %}</g:custom_label_2>
    <g:custom_label_3>{% if product.customFields.lenz_google_shopping_custom_label3 is defined %}{{ product.customFields.lenz_google_shopping_custom_label3|escape }}{% endif %}</g:custom_label_3>
    <g:custom_label_4>{% if product.customFields.lenz_google_shopping_custom_label4 is defined %}{{ product.customFields.lenz_google_shopping_custom_label4|escape }}{% endif %}</g:custom_label_4>
    {% if product.customFields.lenz_google_shopping_promotion_id is defined and product.customFields.lenz_google_shopping_promotion_id != '' %}<g:promotion_id>{{ product.customFields.lenz_google_shopping_promotion_id|escape }}</g:promotion_id>{% endif %}
    {% if product.customFields.lenz_google_shopping_excluded_destination is defined and product.customFields.lenz_google_shopping_excluded_destination != '' %}<g:excluded_destination>{{ product.customFields.lenz_google_shopping_excluded_destination|escape }}</g:excluded_destination>{% endif %}
    {% if product.customFields.lenz_google_shopping_included_destination is defined and product.customFields.lenz_google_shopping_included_destination != '' %}<g:included_destination>{{ product.customFields.lenz_google_shopping_included_destination|escape }}</g:included_destination>{% endif %}
	<g:shipping>
        <g:country>DE</g:country>
        <g:service>Standard</g:service>
        <g:price>
                {% if product.shippingFree %}
                        {{ 0.00|currency }}
                {% else %}
                        {{ 4.95|currency }}{# change your default delivery costs #}
                {% endif %}
        </g:price>
    </g:shipping>	
    {% if product.customFields.lenz_google_shopping_shipping_label is defined and product.customFields.lenz_google_shopping_shipping_label != '' %}<g:shipping_label>{{ product.customFields.lenz_google_shopping_shipping_label|escape }}</g:shipping_label>{% endif %}
    {% if product.weight %}<g:shipping_weight>{{ product.weight|escape }} kg</g:shipping_weight>{% endif %}
    {% if product.customFields.lenz_google_shopping_transit_time_label is defined and product.customFields.lenz_google_shopping_transit_time_label != '' %}<g:transit_time_label>{{ product.customFields.lenz_google_shopping_transit_time_label|escape }}</g:transit_time_label>{% endif %}
    {% if product.customFields.lenz_google_shopping_max_handling_time is defined and product.customFields.lenz_google_shopping_max_handling_time != '' %}<g:max_handling_time>{{ product.customFields.lenz_google_shopping_max_handling_time|escape }}</g:max_handling_time>{% endif %}
    {% if product.customFields.lenz_google_shopping_min_handling_time is defined and product.customFields.lenz_google_shopping_min_handling_time != '' %}<g:min_handling_time>{{ product.customFields.lenz_google_shopping_min_handling_time|escape }}</g:min_handling_time>{% endif %}
    {% if product.customFields.lenz_google_shopping_tax_category is defined and product.customFields.lenz_google_shopping_tax_category != '' %}<g:tax_category>{{ product.customFields.lenz_google_shopping_tax_category|escape }}</g:tax_category>{% endif %}
</item>

{# Entferne diese Zeile, um alle Produkte zu Google Shopping zu übertragen #}
{#% endif %#}

Footer row / Fußzeile

</channel>
</rss>

Hinweis: Passe die {{ 4.95|currency }} durch die Versandkosten an, die in Deinem Shop gelten oder pflege die Versandkosten im Google Merchant Center ein! Beispiel für 10 € Versandkosten: {{ 10.00|currency }}

Du hast nun alle Schritte im Shopware 6 Shop vorgenommen. Nun kannst Du den Feed im Google Merchant Center einrichten. Lies dazu die folgende Anleitung: Shopware Feed in Google Merchant Center einrichten

Weitere Snippets

Versandkostenfrei ab 100 €

<g:shipping>
    <g:country>DE</g:country>
    <g:service>Standard</g:service>
    <g:price>
        {% if product.calculatedListingPrice.to.unitPrice < 100 %}
            {{ 3.90|currency }}{# change your default delivery costs #}
        {% else %}
            {{ 0.00|currency }}{# change your default delivery costs #}
        {% endif %}
        
    </g:price>
</g:shipping>