Google Shopping Local Inventory Feed (Shopware 6)

In dieser Anleitung findest Du die Templates, die Du verwenden musst um einen Google Shopping Local Inventory Feed für Shopware 6 zu erstellen.

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>

Footer row / Fußzeile

</channel>
</rss>

Product row / Produktzeile

<item>
	<g:store_code></g:store_code>
	<g:id>{{ product.productNumber }}</g:id>
	<g:quantity>{{ product.availableStock }}</g:quantity>
	{% if product.calculatedPrices.first and product.calculatedPrices.first.listPrice and product.calculatedPrices.first.listPrice.price > product.calculatedPrices.first.unitPrice %}
        {# Discounted price #}
        <g:price>{{ product.calculatedPrices.first.listPrice.price|number_format(context.currency.decimalPrecision, '.', '') }} {{ context.currency.isoCode }}</g:price>
        <g:sale_price>{{ product.calculatedPrices.first.unitPrice|number_format(context.currency.decimalPrecision, '.', '') }} {{ context.currency.isoCode }}</g:sale_price>
    {% elseif product.calculatedPrices.first is defined and product.calculatedPrices.first.listPrice is defined and product.calculatedPrices.first.listPrice != null %}
        {# Rule based pricing - list price #}
        <g:price>{{ product.calculatedPrices.first.listPrice.price|number_format(context.currency.decimalPrecision, '.', '') }} {{ context.currency.isoCode }}</g:price>
    {% elseif product.calculatedPrices.first is defined and product.calculatedPrices.first.unitPrice is defined %}
        {# Rule based pricing - unit price #}
        <g:price>{{ product.calculatedPrices.first.unitPrice|number_format(context.currency.decimalPrecision, '.', '') }} {{ context.currency.isoCode }}</g:price>
    {% else %}
        {# Default price #}
        <g:price>{{ product.calculatedPrice.unitPrice|number_format(context.currency.decimalPrecision, '.', '') }} {{ context.currency.isoCode }}</g:price>
    {% endif %}
	<g:availability> {% if product.availableStock > 2 %} in_stock {% elseif product.availableStock <=2 and product.availableStock > 0 %} limited_availability {% else %} out_of_stock {% endif %} </g:availability>
	{% if product.customFields.lenz_google_shopping_availability_date is defined and product.customFields.lenz_google_shopping_availability_date != '' %}<g:availability_date>{{ product.customFields.lenz_google_shopping_availability_date|escape }}</g:availability_date>{% endif %}
	<g:pickup_method> buy </g:pickup_method>
	<g:pickup_sla></g:pickup_sla>
</item>
Das Template benötigt für einige Variablen eine individuelle Anpassung!

store_code
Der Geschäftscode ist eine Pflichteingabe. Der Geschäftscode ist eine eindeutige alphanumerische Kennzeichnung für das lokale Unternehmen. Bei diesem Attribut muss die Groß-/Kleinschreibung mit den Geschäftscodes übereinstimmen, die Du in Deinen Unternehmensprofilen hinterlegt hast.

g:pickup_method
Die Abholoption ist eine optionale Angabe. Folgende Abholoptionen können hier eingefügt werden:

  • buy [kaufen]: Die gesamte Transaktion findet online statt.
  • reserve [reservieren]: Der Artikel wird online reserviert und die Transaktion findet im Geschäft statt.
  • ship_to_store [Ladenversand]: Der Artikel wird online gekauft und an ein lokales Geschäft geliefert, wo der Kunde ihn abholen kann.
  • not_supported [nicht_unterstützt]: Die Abholung im Geschäft ist bei diesem Artikel nicht möglich.


pickup_sla
Die Abholzeit ist eine optionale Angabe. Hier gibst Du ein Zeitfenster für die Abholung des Artikels im Geschäft an.

  • same_day [am_selben_Tag]: gibt an, dass der Artikel am Tag der Bestellung im Geschäft zur Abholung bereitsteht (solange die Bestellung vor dem Annahmeschluss erfolgt).
  • next_day [am_nächsten_Tag]: gibt an, dass der Artikel am Tag nach der Bestellung im Geschäft zur Abholung bereitsteht.
  • 2-day [2_Tage]: gibt an, dass der Artikel innerhalb von 2 Tagen an ein Geschäft geliefert wird, in dem der Kunde ihn abholen kann.


Weiter Informationen zu den Variablen findest Du in der Google Merchant Center-Hilfe.