Custom attributes - Shopware

General procedure to add a custom attribute

Adding a new attribute to the feed must be done within SHOPWARE.

Step 1 - Find the attribute

Go to Einstellungen > Freitextfeld-Verwaltung and, in the drop-down menu located at the top-right side of the listing, choose Atrikel (_articles_attributes)' to see all available attributes. Pay special attention to NAME and LABEL.

find the attribute

Step 2 - Design the line that needs to be added

You will have to add a new entry to the feed as an XML fragment where the tag is the label of the attribute and the content is extracted with some template code.

For instance, for the attr5 attribute, with a label of Farbe the line to add to the feed would look like this:

<Farbe>{$sArticle.attr5|escape}</Farbe>

Step 3 - Add the line to the Doofinder Feed

Go to Marketing > Produktexport > Doofinder Feed and click on the 'pencil' icon and then on the 'Body' tab. (see image).

adding a new attribute

Directly underneath the MPN line, add the new attribute line. E.g.

<Farbe>{$sArticle.attr5|escape}</Farbe>

If you have to add more than one attribute, it's recommended that you add one per line.

Once finished it should look like this:

adding more than one attribute

Time to SAVE!

Step 4 - Indexing the new attribute

You may need to change the caching interval for immediate update. Go to Marketing > Produktexport > Doofinder Feed and click on the 'pencil', and set the caching interval to LIVE.

With this you can go to Doofinder admin > Search Engines > Settings > Indices and click on 'Process Now'.

indexing new attribute

📌 Note: Once the feed is processed, it's recommended to revert the caching interval to its previous value.

How to add the price per unit to the feed

Above the brand line, create a new empty line and add the following:

<referenz-preis>
{if $sArticle.purchaseunit}{round($sArticle.price/$sArticle.purchaseunit *$sArticle.referenceunit,2)|escape} EUR / {$sArticle.referenceunit} {$sArticle.unit}{/if}
</referenz-preis>

Save.

Shopware 6

  • To find the custom attribute go to Settings > System > Custom Fields Einstellungen > System > Zusatzfelder.
  • To add the attribute to the feed go to Verkaufskanale > DF feed > Template tab > Produktzeile
adding to the feed

📌 Note:Remember to change the caching interval to LIVE and revert it to its previous value once the feed is indexed.