Specific Product Feed settings for Shopware
Please Click Here for instructions on setting up a Shopware integration
- Create a new sales channel with the type “Product comparison”.
General settings
- Do not use a Template
- Set name to "ProfitMetrics Feed XX" where 'XX' is the country code for the region this Feed will serve (DK - Denmark, CA - Canada, NL - Netherlands, etc.)
- In Payment and shipping, select "Line by line"
- Enter the correct storefront sales channel and domain
- Product Export:
- Filename: profitMetrics.xml
- Encoding: UTF-8
- File Format: XML
- enable 'Export variants as discrete products'
- Interval: Live
- The access key is generated automatically. Below is an example (do not copy it)
- Set Status to 'Active'
Template (Feed) tab
- Please use the values below for each section (Header, Product, Footer)
Header row:
<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0" pm-type='gs-1.0'>
<channel>
Product row:
<item>
{# @var product \Shopware\Core\Content\Product\SalesChannel\SalesChannelProductEntity #} <g:id xmlns:g="g">{{ product.productNumber }}</g:id>
<title>{{ product.translated.name|escape }}</title>
<g:image_link xmlns:g="g">{% if product.cover and product.cover.media %}{{ product.cover.media.url }}{% endif %}</g:image_link>
<link>{{ seoUrl('frontend.detail.page', {'productId': product.id}) }}</link>
{% set price = product.price.getCurrencyPrice(context.currencyId) %}
{% if product.price.getCurrencyPrice(context.currencyId).listPrice != null %}
{% set price = price.gross %}
<g:price xmlns:g="g">{{ price|number_format(context.currency.totalRounding.decimals, '.', '') }}</g:price>
<pm:price_currency xmlns:pm="pm">{{ context.currency.isoCode }}</pm:price_currency>
{# @var purchasePrice \Shopware\Core\Framework\DataAbstractionLayer\Pricing\Price #} {% set purchasePrice = null %}
{% if product.purchasePrices %}
{% set purchasePrice = product.purchasePrices.currencyPrice(context.currencyId) %} {% endif %}
<pm:price_buy xmlns:pm="pm">{%- if purchasePrice -%}{{ purchasePrice.net }}{%- endif - %}</pm:price_buy>
<pm:price_buy_currency xmlns:pm="pm">{{ context.currency.isoCode }}</pm:price_buy_currency>
<pm:num_stock xmlns:pm="pm">{{ product.availableStock }}</pm:num_stock> <tax_state>{{ context.taxState }}</tax_state>
</item>
Footer row
</channel> </rss>