Skip to content

Usage Guide

This guide covers all features and functionality of Shopping Feed with Unique Discounts.


Table of Contents


Configure Export Discount

What It Does

The export discount allows you to define a global discount for all products in a specific product export. This discount is displayed both in the export feed and in the store when a visitor clicks on your product through the feed link.

How to Use

  1. Navigate to Sales Channels → [Your Export Channel]
  2. Click on Product Comparison in the left navigation
  3. Scroll to the Dynamic Product Stream section
  4. Below the product stream, you'll find the Discount Type and Discount Value fields
  5. Select the desired discount type:
  6. No discount: Disables the discount
  7. Absolute: Fixed amount in the shop currency
  8. Percentage: Percentage discount from the original price
  9. Enter the discount value
  10. Save your changes

Location: Sales Channels → [Export Channel] → Product Comparison

Tips & Best Practices

  • Start with a moderate discount (5-10%) and adjust as needed
  • Always test the discount in a test environment before going live
  • The discount is applied to the gross price

Customize Export Template

What It Does

To display the discounted prices in the export feed, you need to customize your export template. The plugin provides the discounted prices through an extension on the product.

How to Use

  1. Navigate to Sales Channels → [Your Export Channel] → Product Comparison
  2. Scroll to the Template section
  3. Customize your template as follows:

For the product URL with tracking parameter:

The URL must contain the source parameter. This is integrated directly into the seoUrl function:

{{ seoUrl('frontend.detail.page', {'productId': product.id, 'source': export.id}) }}

The source parameter is crucial - it contains the export ID and allows the plugin to identify which feed the visitor came from.

For the discounted price (Sale Price):

{% if 'discount' in product.extensions|keys %}
    {% set newPrice = product.extensions.discount['discount'].last %}
    {{ newPrice.unitPrice|number_format(context.currency.itemRounding.decimals, '.', '') }} {{ context.currency.isoCode }}
{% endif %}

Example: Google Shopping Feed

Add the following code to the Product Row section of your template:

<item>
    <g:id>{{ product.productNumber }}</g:id>
    <g:title><![CDATA[{{ product.translated.name }}]]></g:title>
    <g:link>{{ seoUrl('frontend.detail.page', {'productId': product.id, 'source': export.id}) }}</g:link>
    <g:price>{{ product.calculatedPrice.unitPrice|number_format(context.currency.itemRounding.decimals, '.', '') }} {{ context.currency.isoCode }}</g:price>
    {% if 'discount' in product.extensions|keys %}
    {% set newPrice = product.extensions.discount['discount'].last %}
    <g:sale_price>{{ newPrice.unitPrice|number_format(context.currency.itemRounding.decimals, '.', '') }} {{ context.currency.isoCode }}</g:sale_price>
    {% endif %}
</item>

Tips & Best Practices

  • The source parameter must be passed as part of the seoUrl parameters, not as a query string
  • Test your feed after changes with the Shopware feed preview
  • For Google Shopping, g:price shows the original price and g:sale_price shows the discounted price
  • Use context.currency.itemRounding.decimals for correct decimal places

Item-Specific Prices

What It Does

With item-specific prices, you can set an individual export price for specific products. This completely overrides the global export discount and is ideal for repricing scenarios.

How to Use

Manually in Admin:

  1. Navigate to Catalogues → Products
  2. Open the desired product
  3. Switch to the Specifications tab
  4. Scroll to Custom Fields
  5. Find the field group Shopping feed with unique discounts
  6. Enter the desired price in the New price in export (gross) field
  7. Save the product

Via CSV Import:

The field has the technical name webla_exportdiscount_product_discount. You can use it in your CSV import profiles:

Product Number New price in export (gross)
SW10001 24.99
SW10002 39.90

Via API:

PATCH /api/product/{id}
{
    "customFields": {
        "webla_exportdiscount_product_discount": 24.99
    }
}

Tips & Best Practices

  • The price is a gross price (including VAT)
  • An empty field means the global export discount is used
  • A value of 0 or negative is ignored
  • Ideal for integration with repricing tools

Session Management

What It Does

The plugin stores sessions to track which visitors came from which export. These sessions are automatically cleaned up after the configured validity period (default: 24 hours).

Automatic Cleanup

  • Sessions are checked for expiration every 5 minutes
  • Sessions older than the configured validity period are automatically deleted
  • Cleanup runs through the Shopware scheduled task queue

Manual Cleanup

Location: Extensions → My Extensions → Shopping feed with unique discounts → Configure

  1. Navigate to the plugin settings
  2. Click on Delete API sessions
  3. All active sessions are immediately removed

Tips & Best Practices

  • Use manual cleanup after extensive testing
  • Make sure the Shopware message queue is running for automatic cleanup
  • In production, manual intervention is normally not necessary

Storefront Features

Price Display on Product Page

Where It Appears: Product detail page, when the visitor came through a feed link

What Customers See: - The discounted price as the current price - The original price as a crossed-out price (strike price) - The percentage savings (if supported by the theme)

Price Display in Cart

Where It Appears: Cart and checkout

What Customers See: - The discounted price is displayed throughout - With "Single units only" option enabled: quantities > 1 show the original price

30-Day Price Display

The plugin automatically writes the lowest price to Shopware's standard field for the lowest price in the last 30 days. This is important for EU price indication regulations (Omnibus Directive).

Customization Options

The price display uses standard Shopware price rendering. Customizations are done through: - Your theme and its configuration - Twig template overrides - CSS styling


Troubleshooting

Discount Not Displayed in Store

Symptom: The visitor sees the normal price instead of the discount price.

Possible Causes and Solutions:

  1. Missing source parameter in URL
  2. Check if the URL contains the source parameter
  3. The parameter is set via the seoUrl function: {'productId': product.id, 'source': export.id}
  4. Check your export template for correct URL generation

  5. Session doesn't exist

  6. The visitor must come directly through the feed link
  7. Links without source parameter don't create a session

  8. Cache issue

  9. Clear the Shopware cache under Settings → System → Caches & Indexes
  10. The plugin invalidates caches automatically, but manual clearing helps with issues

  11. Product not in export stream

  12. Check if the product is part of the dynamic product stream

Discount Not Displayed in Feed

Symptom: The feed contains the normal prices.

Possible Causes and Solutions:

  1. Template not customized
  2. Check if you're using 'discount' in product.extensions|keys in the template
  3. Access the price with product.extensions.discount['discount'].last.unitPrice

  4. No discount configured

  5. Check the discount settings on the product export
  6. Discount type must not be "No discount"

  7. Feed cache

  8. Regenerate the feed under Sales Channels → [Export] → Product Comparison

Session Not Created

Symptom: Despite correct URL, no session is created.

Possible Causes and Solutions:

  1. Invalid export ID
  2. Check if the export ID in the URL is valid
  3. The ID must be an existing product export ID

  4. Product ID missing

  5. The session is only created on product detail pages
  6. Category or search result pages don't create sessions

  7. Existing session

  8. With "Multiple products" option disabled, only the first session is kept