Find out Discount per Line Item in Shopware 6

Viewed 33

Is there a way to find out a discount per line item in orders?

As I understand (after looking at the table order_line_item), the full discount is added as a own line item.

I believe we would have to hook into the discount calculation and log the discount per order item - and of course there might be discounts which cannot be easily accounted to one position.

1 Answers

The discount position in the table order_line_item should have the discount for each line item in the column payload. Something like this:

enter image description here

I would recommend not changing the logic in the shop and rather use the information from the payload for synchronisation with 3rd party systems like ERP.

Related