With the item exports not only existing exports can be used to price portals, also complete new connections to new marketplaces can be created. By using an export template, which works with Smarty variables, adaptations / extensions new exports can be created quickly.
So you can create either text-, XML- or CSV files, depending on the requirements of each portal.
In most portals, a link to the export file can be stored. Depending on the caching method of your export the portal always gets the newest feed, but the shop has to generate it each time - on the other hand the file is created periodically and the portal gets the file much quicker, but it may not be the newest (depending on the renewal interval).
Opening the module shows you an overview of previously created export feeds. The interface offers the following basic functionalities:
There are 2 ways to get the export feed URL:
Now we go over to the exports itself and show you, how easy you can create and edit export feeds.
Depending on your needs you need programming knowledge to individualize your export feeds, when you don't have these knowledge, you shouldn't edit your feeds, otherwise your export feeds can break.
Format
Header
Here you define the column names of the csv file, e.g. id, supplier, model, name, category etc. In a XML file the header must be placed here too, e.g. Start tag, title, description etc.
Body
Here you can define the template of the export items. The body will loop over every item. In CSV / TXT exports you get one row per item. In XML exports, e.g. Google, every item must be marked by a start tag and a end tag. In this way it's possible to arrange a individual settings.
List of available variables
Variable | Description |
---|---|
{$sConfig.sBASEPATH} | URL to shop |
{$sConfig.sSHOPNAME} | name of shop |
Variable | Description |
---|---|
{$sSettings.feedID} | ID of export |
{$sSettings.name} | name of item export |
{$sSettings.last_export} | date last run |
{$sSettings.hash} | access hash |
{$sSettings.count_articles} | products in last run |
{$sSettings.formatID} | file format ID |
{$sSettings.filename} | filename |
{$sSettings.encodingID} | Coding ID |
{$sSettings.categoryID} | main category |
{$sSettings.currencyID} | currency ID |
{$sSettings.customergroupID} | customergroup ID |
{$sSettings.partnerID} | partner ID |
{$sSettings.languageID} | language ID |
{$sSettings.multishopID} | shop ID |
{$sSettings.variant_export} | export variants? |
{$sSettings.encoding} | coding |
filter definitions | description |
---|---|
{$sSettings.active_filter} | only active items |
{$sSettings.image_filter} | only items with pictures |
{$sSettings.stockmin_filter} | instock lower stockmin |
{$sSettings.instock_filter} | instock lower |
{$sSettings.price_filter} | price less ... |
{$sSettings.own_filter} | own filters |
{$sSettings.count_filter} | max. items in export |
{$sSettings.header} | header own filter |
{$sSettings.footer} | footer |
{#F#} | field separation |
{#EF#} | Escaped-field separation |
{#S#} | delimiter |
{#ES#} | Escaped-delimiter |
{#L#} | row delimiter |
{#EL#} | Escaped-row delimiter |
The following variables can only be used in body:
item variables:
Variable | Description |
---|---|
{$sArticle.articleID} | item ID |
{$sArticle.name} | item name |
link:$sArticle.name|escape} | article URL |
{$sArticle.description} | short description |
{$sArticle.description_long} | description |
{$sArticle.shippingtime} | shipping/delivery time (in days) |
{$sArticle.added} | item added |
{$sArticle.shippingfree} | shipping free |
{$sArticle.releasedate} | release date |
{$sArticle.topseller} | highlited item |
{$sArticle.keywords} | keywords |
{$sArticle.minpurchase} | min purchase |
{$sArticle.purchasesteps} | purchase steps |
{$sArticle.maxpurchase} | max purchase |
{$sArticle.purchaseunit} | price related to (unit) |
{$sArticle.referenceunit} | reference unit |
{$sArticle.taxID} | tax ID |
{$sArticle.supplierID} | supplier ID |
{$sArticle.unitID} | unit ID |
{$sArticle.unit_description} | unit |
{$sArticle.changed} | date last changes |
{$sArticle.active} | item active |
{$sArticle.variantActive} | active state of the variant |
{$sArticle.articledetailsID} | item detail ID |
{$sArticle.ordernumber} | ordernumber |
{$sArticle.suppliernumber} | suppliernumber |
{$sArticle.standard} | default variant |
{$sArticle.additionaltext} | variant descriprion |
{$sArticle.impressions} | impressions |
{$sArticle.sales} | sales |
{$sArticle.instock} | instock |
{$sArticle.stockmin} | min instock |
{$sArticle.laststock} | clearance sale |
{$sArticle.esd} | download item (esd) |
{$sArticle.weight} | weight |
{$sArticle.ean} | EAN |
{$sArticle.position} | position |
{$sArticle.attr1} bis {$sArticle.attr20} | item attributes |
{$sArticle.supplier} | supplier |
{$sArticle.unit} | unit |
{$sArticle.tax} | tax |
{$sArticle.image} | item picture |
{$sArticle.netprice} | net price |
{$sArticle.price} | gros price |
{$sArticle.netprice_numeric} | net price rounded like in the frontend |
{$sArticle.price_numeric} | gross price rounded like in the frontend |
{$sArticle.purchaseprice} | purchase price |
{$sArticle.netpseudoprice} | net pseudo price |
{$sArticle.pseudoprice} | gross pseudo price |
{$sArticle.baseprice} | base price |
{$sArticle.discount} | price group discount |
{$sArticle.sVoteCount} | count ratings |
{$sArticle.sVoteAverage} | average ratings |
{$sArticle.metaTitle} | Meta Title |
{$sArticle.pseudosales} | pseudo sales |
{$sArticle.notification} | email notification active? |
{$sArticle.available_from} | price group active? |
{$sArticle.available_to} | ID of the selected price group |
{$sArticle.pricegroupActive} | available from |
{$sArticle.pricegroupID} | available until |
| display categories / breadcrumb |
* with {$sArticle.image|image:1} or {$sArticle.image|image:2} etc. you can use different thumbnail sizes.
Additional variables:
command | Description |
---|---|
strip_tags | filter html source code |
strip | delete duplicate spaces and replaced line breaks by spaces |
trim | deletes unnecessary spaces |
truncate:500 | truncate description to 500 chars |
html_entity_decode | convert umlauts |
escape | convert special character in html, z.B. & = & |
escape:xml | Encoding only for xml |
@shippingcost | calculate shipping costs for item |
format:"number" | formats numbers for each localization |
Footer
The footer is used exclusively for the XML exports. The start tags, which you configured in the header, must be closed here. Example Google:
</channel>
</rss>
Blocked categories
Here the complete category tree is rendered. If you check some categories, they are generally excluded from the export.
Even if items are associated with multiple categories: When an item is associated with a category which is blocked, the item won't be exported.
Supplier filter
On the left panel there is a list of all suppliers of your shop, here you can search by manufacturers or choose them directly from the list. To exclude items from a specific manufacturer on exports, just add the supplier by double-clicking to the list of blocking manufacturer (right list). Alternatively you can mark the entry and click the arrow in the specific direction.
Item filter
The item filter works the same ways as the supplier filter, on the left you get the list of all items in your shop, to exclude an item just add it by double-clicking to the list of blocked items. Alternatively you can also here mark the items and click the arrow in the specific direction.
Additional filters
Free text fields
Here you can define free text fields for your export feed. To use this, please take a look in the documentation of Free text field management
By adding the following example you can export the base price and the content of your items:
Header
Base price{#S#}
Content{#S#}
Template
{if $sArticle.referenceunit && $sArticle.purchaseunit}
{assign var="sArticleReferenceprice" value=$sArticle.price/$sArticle.purchaseunit*$sArticle.referenceunit}
{$sArticle.referenceunit} {$sArticle.unit} = {$sArticleReferenceprice|escape:"number"}{#S#}
{$sArticle.purchaseunit} {$sArticle.unit}{#S#}
{else}
{#S#}{#S#}
{/if}
In the above template, the price unit is displayed in short form. If you prefer to use the full unit, for example ‘gram’ instead of ‘g’, then use the variable {$sArticle.unit_description}
instead of {$sArticle.unit}
.
At first, this can only work, if Export variants is active. To export your configurator items, use it how we do it in our example:
Configurator variables | outcome |
---|---|
{$sArticle.additionaltext} | blue / XL |
If you export configurator items and them variants, it makes sense to extend the header. To avoid duplicate item names we recommend that you add the additional text to the body with {$sArticle.additionaltext}
So you can use this body:
{$sArticle.name|strip_tags|strip|truncate:80:"...":true|escape|htmlentities} {$sArticle.additionaltext|escape}{#S#}
for getting this feed content:
Nova Jacket blue / XL
If you want to, you can export item properties with the following syntax in your body:
{assign var="properties" value=$sArticle.articleID|property:$sArticle.filtergroupID}
{foreach from=$properties item=property}
{if $property}
{$property.groupName|escape}: {$property.name|escape}: {$property.value|escape}
{/if}
{/foreach}
This will give you all properties of your item.
The following syntax exports the image which is attached to a specific variant of the item and all unassigned images: {$sArticle.articleID|articleImages:$sArticle.ordernumber:2:">"|escape}
The 'articleImages' call accepts a second argument ('>' above) which is used as the separator in case multiple images exist.
If you want to export just the first variant image, you can use the following method: The template must be prepended (before the strip tag) by the following code:
{assign var="string" value=$sArticle.articleID|articleImages:$sArticle.ordernumber:2:"##"|escape}
{assign var="productVariantImage" value="##"|explode:$string}
This code is getting the images and put these in a string, which you can edit later.
In the image section of your template you can use the following code:
{$productVariantImage[0]}
0 hereby is the image number whereby 0 is always the first image.
The variant can also be called directly. To use this function you have to append the article url with the parameter ?number="ordernumber from the variant".
{$sArticle.articleID|link:$sArticle.name}{if $sArticle.additionaltext}?number={$sArticle.ordernumber}{/if}
{$sArticle.articleID|link:$sArticle.name}{if $sArticle.additionaltext}?number={$sArticle.ordernumber}&PARTNER-TAG{/if}?PARTNER-TAG
Because the template is based on smarty, you also can calculate here.
Some price search engines will compare your feed price with the detail page price and will give you an error, if the prices don't match.
Percental surcharge
The following example will surcharge the item by 5%:
// Before:
{$sArticle.price|escape:"number"}{#S#}
// After:
{$sArticle.price*1.05|escape:"number"}{#S#}
General surcharge
In this example, a general surcharge of 0.50 of the desired currency will be added:
// Before:
{$sArticle.price|escape:"number"}{#S#}
// After:
{$sArticle.price+0.50|escape:"number"}{#S#}
When items won't be exported, this can have multiple reasons, you should check the following settings:
If you exclude categories from export, you also exclude all items in this category.
Example: When your item is assigned to category A and B and you exclude B, the item is nevertheless excluded from the export, even if it's assigned to A.
With Shopware 5.2.9 you can output configurator options in own columns instead of output the additionaltext only, so that the item is more clear for the price search engine.
XML dynamic
Dynamic works only, if you have configurator groups & options, which are NOT written with whitespaces!
The following code must be pasted in the template:
{foreach $sArticle.configurator_options as $option}
<{$option@key}>{$option}</{$option@key}>
{/foreach}
XML static
The following code must be pasted in the template:
<color>{$sArticle.configurator_options['Color']}</color>
<size>{$sArticle.configurator_options['Size']}</size>
"Color" and "Size" are examples and must be changed to your own configurator group name.
CSV static
First, paste the name of your desired configurator group in the header at the desired position:
color{#S#}
size{#S#}
The following code must be pasted in the template at the respective position:
{$sArticle.configurator_options['Color']}
{$sArticle.configurator_options['Size']}
"Color" and "Size" are examples and must be changed to your own configurator group name.
You can export the active state of each variant, if your desired price search engine supports that feature. To use it, you have to export variants, add a new column in the header and in the template. The header is done by using active{#S#}.
In the template, just add the variable at the same column: {$sArticles.variantActive}{#S#}
The feed will then export each variants active state.