By default, the feed contains all the basic fields and all set properties of a product. It will not include set custom_fields. You need to add the necessary custom fields yourself. See the chapter about customizing the feed.
Categories
For categories, the feed contains all included sales channels and languages you have chosen in the feed configuration. Of each category the name and rank (sorting) will be included in the feed.
Products
The feed contains all products. For every sales channel/language combination there's a separate product added to the feed. If a product contains multiple variants, one variant will be chosen as the main variant to export.
Variant selection
For each product in the feed the following fields are in the feed by default. The marked fieldnames are the names used in Tweakwise:
Name in Shopware | Name in feed | Additional info |
---|---|---|
Name | name | |
Price | price | |
Available Stock | stock | |
Manufacturer | brand | |
Url | url | |
Cover image | image | |
Categories | categories (one or more) | |
Attributes | attributes | All attributes below are part of the attributes part of the feed |
Selected option | selected option | if you have a variant with chosen option size L and color Black, it will return Size: L | Color: black |
Shopware Id | sw-id | Unique shopware id, used for add-to-cart functionality |
All attributes of the product | name of the attribute | Every attribute of the main product is added with their own name |
All attributes of the variants | name of the variant attribute | Every attribute of the variant product is added with their own name. if there are more variants available but you only show 1 variant, the attributes of the other variants will be added as well |
New product | sw-new | (yes/no) based on the settings in Shopware |
Has Discount | sw-has-discount | (yes/no) based on difference between listprice and unitprice |
Popular product | sw-is-wtopseller | (yes/no) |
Search keywords | sw-keywords | |
Tags | sw-tags | |
Product number | sw-product-number | |
Label | sw-label | sold out, topseller, discount or new in that order |
GTIN/EAN | sw-ean | |
Manufacturer product number | sw-manufacturer-productnumber | |
Release date | sw-relase-date | |
List price | sw-price-from | |
Net price | sw-price-net | |
Average rating | sw-avg-rating | |
Weight | sw-weight | |
Height | sw-height | |
Length | sw-length | |
Selling unit | sw-purchase-unit | |
Basic unit | sw-reference-unit | |
Clearance sale | sw-is-closeout | |
Delivery time | sw-delivery-time | |
Description | sw-description | |
Lowest price net | sw-price-lowest-net | |
Lowest price gross | sw-price-lowest-gross | |
Lowest price start quantity | sw-price-lowest-quantity-start | |
Lowest price end quantity | sw-price-lowest-quantity-send | |
Media | sw-media-n * | link to the largest thumbnail of all media starting with number 1. So if you have 2 images for your product, you will have sw-media-1 and sw-media-2. Be aware that the cover image is also one of those images |
Customize your feed
The feed will be created based on Twig templates. You can override these templates the same way as you override templates of other plugins. The only thing that is different is the path. So you can just add your templates in your own theme extension.
Add product attributes
For example if you want to add an extra attribute to a product within the feed:
Path: /src/Resources/views/tweakwise/product.xml.twig
{% sw_extends '@Storefront/tweakwise/product.xml.twig' %}
{% block feed_item_attributes_inner %}
{{ parent() }}
<attribute>
<name>MyCustomAttribute</name>
<value>{{ product.productNumber }} - {{ product.ean }}</value>
</attribute>
{% endblock %}
Add data of variants
You can also add some additional information of other variants that are not included in the feed. By default the fields stock, options and properties are added to the feed, but if you, for example, want to add the product numbers of the other variants, you do something like:
Path: src/Resources/views/tweakwise/otherVariants.xml.twig
sw-product-number {{ variant.productNumber }} You are also able to add logic to the attributes if you want to add the data to the feed or not.If you want to remove the data of variants that are added by default, you can just create an empty file in the path src/Resources/views/tweakwise/variantAttributes.xml.twig.