Google Shopping für Shopware 5 einrichten

Um Google Shopping mit den passenden Produktdaten aus Deinem Shopware 5 Shop zu befüllen, installierst Du bitte zunächst das Plugin „Google Shopping für Shopware 5“ aus dem Shopware Community Store. Alternativ kannst Du Google Shopping für Shopware 6 einrichten.

Anschließend muss ein neuer Produktexport (Im Backend unter „Marketing ->

Produktexporte“) eingerichtet werden. Nutze hierzu die folgenden Daten.

Formatierung
Zeichenkodierung: UTF-8
Dateiformat: XML

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="http://{$sConfig.sBASEPATH}/engine/connectors/export/{$sSettings.id}/{$sSettings.hash}/{$sSettings.filename}" rel="self" type="application/rss+xml" />
	<title>{$sConfig.sSHOPNAME|escape}</title>
	<description>Beschreibung im Header hinterlegen</description>
	<link>http://{$sConfig.sBASEPATH}</link>
	<language>DE</language>
	<image>
		<url>http://{$sConfig.sBASEPATH}/templates/_default/frontend/_resources/images/logo.jpg</url>
		<title>{$sConfig.sSHOPNAME|escape}</title>
		<link>http://{$sConfig.sBASEPATH}</link>
	</image><br><br>

Fusszeile

</channel>
</rss>

Template (DE)

{* if $sArticle.lenz_google_shopping_active == 1 *}
{assign var="string" value=$sArticle.articleID|articleImages:$sArticle.ordernumber:1:"##"|escape}
{assign var="productVariantImage" value="##"|explode:$string}
 
<item> 
    <g:id>{$sArticle.ordernumber|escape}</g:id>
    <title>{if $sArticle.lenz_google_shopping_title}{$sArticle.lenz_google_shopping_title|escape}{else}{$sArticle.name|strip_tags|strip|truncate:80:"...":true|escape}{if $sArticle.additionaltext} {$sArticle.additionaltext|strip_tags|strip|escape}{/if}{/if}</title>
    <g:description>{if $sArticle.lenz_google_shopping_description}{$sArticle.lenz_google_shopping_description|escape}{else}{$sArticle.description_long|strip_tags|strip|truncate:900:"..."|escape}{/if}</g:description>
    <link>{$sArticle.articleID|link:$sArticle.name|escape}{if $sSettings['partnerID']}[&]amp;{else}?{/if}number={$sArticle.ordernumber}</link>
    <g:image_link>{if $productVariantImage[0]}{$productVariantImage[0]}{else}{$sArticle.image|image:1|escape}{/if}</g:image_link>
    {foreach $productVariantImage as $key => $value}
        {if $key != 0 && $key < 11}
            <g:additional_image_link>{$value}</g:additional_image_link>
        {/if}
    {/foreach}
    <g:availability>{if $sArticle.esd}in stock{elseif $sArticle.instock>0}in stock{elseif $sArticle.releasedate && $sArticle.releasedate|strtotime > $smarty.now}preorder{elseif $sArticle.shippingtime}in stock{else}out of stock{/if}</g:availability>
    {if $sArticle.pseudoprice > $sArticle.price}
        <g:price>{$sArticle.pseudoprice|format:"number"} EUR</g:price>
        <g:sale_price>{$sArticle.price|format:"number"} EUR</g:sale_price>
    {else}
        <g:price>{$sArticle.price|format:"number"} EUR</g:price>
    {/if}
    {if $sArticle.purchaseunit && $sArticle.referenceunit}
        <g:unit_pricing_measure>{$sArticle.purchaseunit|escape} {$sArticle.unit|replace:"Stck.":"ct"|replace:"Stück":"ct"|replace:"m²":"sqm"|replace:"Milliliter":"ml"|replace:"Liter":"l"|replace:"Kilogramm":"kg"|replace:"Gramm":"g"|replace:"Zentimeter":"cm"|replace:"Meter":"m"|escape}</g:unit_pricing_measure>
	<g:unit_pricing_base_measure>{$sArticle.referenceunit|escape} {$sArticle.unit|replace:"Stck.":"ct"|replace:"Stück":"ct"|replace:"m²":"sqm"|replace:"Milliliter":"ml"|replace:"Liter":"l"|replace:"Kilogramm":"kg"|replace:"Gramm":"g"|replace:"Zentimeter":"cm"|replace:"Meter":"m"|escape}</g:unit_pricing_base_measure>
    {/if}
    <g:google_product_category>{$sArticle.lenz_google_shopping_category|escape}</g:google_product_category>
    <g:product_type>{$sArticle.articleID|category:" > "|escape}</g:product_type>
    <g:brand>{$sArticle.supplier|escape}</g:brand>
    <g:gtin>{$sArticle.ean|replace:"|":""}</g:gtin>
    <g:identifier_exists>{if $sArticle.ean || ($sArticle.supplier && $sArticle.suppliernumber)}yes{else}no{/if}</g:identifier_exists>
    <g:mpn>{$sArticle.suppliernumber|escape}</g:mpn>
    <g:condition>{if $sArticle.lenz_google_shopping_condition}{$sArticle.lenz_google_shopping_condition|escape}{else}new{/if}</g:condition>
    <g:adult>{if $sArticle.lenz_google_shopping_adult}yes{else}no{/if}</g:adult>
    {if $sArticle.lenz_google_shopping_multipack}<g:multipack>{$sArticle.lenz_google_shopping_multipack|escape}</g:multipack>{/if}
    {if $sArticle.lenz_google_shopping_is_bundle}<g:is_bundle>yes</g:is_bundle>{/if}
    {if $sArticle.lenz_google_shopping_energy_efficiency_class}<g:energy_efficiency_class>{$sArticle.lenz_google_shopping_energy_efficiency_class|escape}</g:energy_efficiency_class>{/if}
    {if $sArticle.lenz_google_shopping_age_group}<g:age_group>{$sArticle.lenz_google_shopping_age_group|escape}</g:age_group>{/if}
    {if $sArticle.lenz_google_shopping_color}<g:color>{$sArticle.lenz_google_shopping_color|escape}</g:color>{/if}
    {if $sArticle.lenz_google_shopping_gender}<g:gender>{$sArticle.lenz_google_shopping_gender|escape}</g:gender>{/if}
    {if $sArticle.lenz_google_shopping_material}<g:material>{$sArticle.lenz_google_shopping_material|escape}</g:material>{/if}
    {if $sArticle.lenz_google_shopping_pattern}<g:pattern>{$sArticle.lenz_google_shopping_pattern|escape}</g:pattern>{/if}
    {if $sArticle.lenz_google_shopping_size}<g:size>{$sArticle.lenz_google_shopping_size|escape}</g:size>{/if}
    {if $sArticle.lenz_google_shopping_size_type}<g:size_type>{$sArticle.lenz_google_shopping_size_type|escape}</g:size_type>{/if}
    {if $sArticle.lenz_google_shopping_size_system}<g:size_system>{$sArticle.lenz_google_shopping_size_system|escape}</g:size_system>{/if}
    {if $sArticle.lenz_google_shopping_item_group_id}{$sArticle.lenz_google_shopping_item_group_id}{/if}
    <g:custom_label_0>{$sArticle.lenz_google_shopping_custom_label0|escape}</g:custom_label_0>
    <g:custom_label_1>{$sArticle.lenz_google_shopping_custom_label1|escape}</g:custom_label_1>
    <g:custom_label_2>{$sArticle.lenz_google_shopping_custom_label2|escape}</g:custom_label_2>
    <g:custom_label_3>{$sArticle.lenz_google_shopping_custom_label3|escape}</g:custom_label_3>
    <g:custom_label_4>{$sArticle.lenz_google_shopping_custom_label4|escape}</g:custom_label_4>
    {if $sArticle.lenz_google_shopping_promotion_id}<g:promotion_id>{$sArticle.lenz_google_shopping_promotion_id|escape}</g:promotion_id>{/if}
    <g:shipping>
        <g:country>DE</g:country>
        <g:service>Standard</g:service>
        <g:price>{$sArticle|@shippingcost:"prepayment":"de"|escape:number} EUR</g:price>
    </g:shipping>	
    <g:shipping_weight>{$sArticle.weight|escape:number} kg</g:shipping_weight>
{if $sArticle.weight }{$sArticle.weight} kg{/if}
</item>
{* /if *}

Template (US)

{* if $sArticle.lenz_google_shopping_active == 1 *}
<item>
    <g:id>{$sArticle.ordernumber|escape}</g:id>
              <title>{if $sArticle.lenz_google_shopping_title}{$sArticle.lenz_google_shopping_title|escape}{else}{$sArticle.name|strip_tags|strip|truncate:80:"...":true|escape}{if $sArticle.additionaltext} {$sArticle.additionaltext|strip_tags|strip|escape}{/if}{/if}</title>
              <g:description>{if $sArticle.lenz_google_shopping_description}{$sArticle.lenz_google_shopping_description|escape}{else}{$sArticle.description_long|strip_tags|strip|truncate:900:"..."|escape}{/if}</g:description>
<link>{$sArticle.articleID|link:$sArticle.name|escape}&AMP;number={$sArticle.ordernumber}</link>
    <g:image_link>{$sArticle.image|image:1|escape}</g:image_link>
              <g:availability>{if $sArticle.esd}in stock{elseif $sArticle.instock>0}in stock{elseif $sArticle.releasedate && $sArticle.releasedate|strtotime > $smarty.now}preorder{elseif $sArticle.shippingtime}in stock{else}out of stock{/if}</g:availability>
              <g:price>{$sArticle.price|format:"number"}</g:price>
              <g:unit_pricing_measure>1 ct</g:unit_pricing_measure>
              <g:unit_pricing_base_measure>1 ct</g:unit_pricing_base_measure>
<g:google_product_category>{$sArticle.lenz_google_shopping_category|escape}</g:google_product_category>
              <g:product_type>{$sArticle.articleID|category:" > "|escape}</g:product_type>
              <g:brand>{$sArticle.supplier|escape}</g:brand>
              <g:gtin>{$sArticle.ean|replace:"|":""}</g:gtin>
              <g:identifier_exists>{if $sArticle.ean}yes{else}no{/if}</g:identifier_exists>
              <g:mpn>{$sArticle.ordernumber|escape}</g:mpn>
              <g:condition>{if $sArticle.lenz_google_shopping_condition}{$sArticle.lenz_google_shopping_condition|escape}{else}new{/if}</g:condition>
              <g:adult>{if $sArticle.lenz_google_shopping_adult}yes{else}no{/if}</g:adult>
              {if $sArticle.lenz_google_shopping_multipack}<g:multipack>{$sArticle.lenz_google_shopping_multipack|escape}</g:multipack>{/if}
              {if $sArticle.lenz_google_shopping_is_bundle}<g:is_bundle>yes</g:is_bundle>{/if}
              {if $sArticle.lenz_google_shopping_energy_efficiency_class}<g:energy_efficiency_class>{$sArticle.lenz_google_shopping_energy_efficiency_class|escape}</g:energy_efficiency_class>{/if}
              {if $sArticle.lenz_google_shopping_age_group}<g:age_group>{$sArticle.lenz_google_shopping_age_group|escape}</g:age_group>{/if}
              {if $sArticle.lenz_google_shopping_color}<g:color>{$sArticle.lenz_google_shopping_color|escape}</g:color>{/if}
              {if $sArticle.lenz_google_shopping_gender}<g:gender>{$sArticle.lenz_google_shopping_gender|escape}</g:gender>{/if}
              {if $sArticle.lenz_google_shopping_material}<g:material>{$sArticle.lenz_google_shopping_material|escape}</g:material>{/if}
              {if $sArticle.lenz_google_shopping_pattern}<g:pattern>{$sArticle.lenz_google_shopping_pattern|escape}</g:pattern>{/if}
              {if $sArticle.lenz_google_shopping_size}<g:size>{$sArticle.lenz_google_shopping_size|escape}</g:size>{/if}
              {if $sArticle.lenz_google_shopping_size_type}<g:size_type>{$sArticle.lenz_google_shopping_size_type|escape}</g:size_type>{/if}
              {if $sArticle.lenz_google_shopping_size_system}<g:size_system>{$sArticle.lenz_google_shopping_size_system|escape}</g:size_system>{/if}
              <g:custom_label_0>{$sArticle.lenz_google_shopping_custom_label0|escape}</g:custom_label_0>
              <g:custom_label_1>{$sArticle.lenz_google_shopping_custom_label1|escape}</g:custom_label_1>
              <g:custom_label_2>{$sArticle.lenz_google_shopping_custom_label2|escape}</g:custom_label_2>
              <g:custom_label_3>{$sArticle.lenz_google_shopping_custom_label3|escape}</g:custom_label_3>
              <g:custom_label_4>{$sArticle.lenz_google_shopping_custom_label4|escape}</g:custom_label_4>
              <g:shipping>
                     <g:country>US</g:country>
                     <g:service>Standard</g:service>
                     <g:price>{$sArticle|@shippingcost:"paypal":"us"|escape:number}</g:price>
              </g:shipping>
              <g:tax>
                  <g:country>US</g:country>
                  <g:rate>0.00</g:rate>
                  <g:tax_ship>no</g:tax_ship>
              </g:tax>
{if $sArticle.weight }{$sArticle.weight} kg{/if}
</item>
{* /if *}

Weitere Filter

Aktiviere nur aktive Artikel und Artikel mit Bildern für Google Shopping.

2 Kommentare zu „Google Shopping für Shopware 5 einrichten“

  1. Hi there,

    Is there a Shopware 6 version of this?

    I need :

    {if $sArticle.pseudoprice > $sArticle.price}
    {$sArticle.pseudoprice|format:“number“} EUR
    {$sArticle.price|format:“number“} EUR
    {else}
    {$sArticle.price|format:“number“} EUR
    {/if}

    Translated to shopware 6.

    Thank in advance.

    1. Hi, please try this in Shopware 6:

      {% if product.calculatedPrices.first and product.calculatedPrices.first.listPrice and product.calculatedPrices.first.listPrice.price > product.calculatedPrices.first.unitPrice %}
      {# Discounted price #}
      {{ product.calculatedPrices.first.listPrice.price|number_format(context.currency.decimalPrecision, '.', '') }} {{ context.currency.isoCode }}
      {{ product.calculatedPrices.first.unitPrice|number_format(context.currency.decimalPrecision, '.', '') }} {{ context.currency.isoCode }}
      {% elseif product.calculatedPrices.first is defined and product.calculatedPrices.first.listPrice is defined and product.calculatedPrices.first.listPrice != null %}
      {# Rule based pricing - list price #}
      {{ product.calculatedPrices.first.listPrice.price|number_format(context.currency.decimalPrecision, '.', '') }} {{ context.currency.isoCode }}
      {% elseif product.calculatedPrices.first is defined and product.calculatedPrices.first.unitPrice is defined %}
      {# Rule based pricing - unit price #}
      {{ product.calculatedPrices.first.unitPrice|number_format(context.currency.decimalPrecision, '.', '') }} {{ context.currency.isoCode }}
      {% else %}
      {# Default price #}
      {{ product.calculatedPrice.unitPrice|number_format(context.currency.decimalPrecision, '.', '') }} {{ context.currency.isoCode }}
      {% endif %}

      Please also have a look for our Shopware 6 Google Shopping Plugin.

Kommentar verfassen

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert

Scroll to Top