How can I export the line item price after discounts?

You can use the formula below in the Calculated Fields to calculate the line item total price after discounts:

({{ line_items.total_price }} - {{ line_items.discount_allocations.total_amount }}) if {{ line_items.discount_allocations.total_amount }} else {{ line_items.total_price }}
  • The line_items.total_price field is the line item's unit price multiplied by the ordered quantity.
  • The  line_items.discount_allocations.total_amount field gives the discount amount at the line item level. 
  • The conditional logic just handles the case where the discount allocations data is null since null values can't be subtracted from a number value so it looks a little complex.

App: EZ Exporter

Tags: advanced features, discounts, calculated fields