Hello @Shopify_Community ,
We want to report LineItem level order price info through a Flow workflow. Price can be obtained from LineItem.variant.price. Compare at Price can be obtained from LineItem.variant.compareAtPrice.
GraphQL lists: LineItem.totalDiscountSet MoneyBag! non-null
“The sum of all AppliedDiscounts on this line item, in shop and presentment currencies.”
- The problem is that this does not report all discounts applied.
This example order based on a current workflow has a 15% off discount code applied with the following details:
quantity = 1
variant.compareAtPrice = 58.0
variant.price = 37.7
discount code = somediscountcode
The example order results in the following:
discountedTotal****Set = {“presentmentMoney”=>{“amount”=>37.7, “currencyCode”=>“CAD”}, “shopMoney”=>{“amount”=>37.7, “currencyCode”=>“CAD”}}
discountedUnitPriceSet = {“presentmentMoney”=>{“amount”=>37.7, “currencyCode”=>“CAD”}, “shopMoney”=>{“amount”=>37.7, “currencyCode”=>“CAD”}}
originalTotalSet = {“presentmentMoney”=>{“amount”=>37.7, “currencyCode”=>“CAD”}, “shopMoney”=>{“amount”=>37.7, “currencyCode”=>“CAD”}}
originalUnitPriceSet = {“presentmentMoney”=>{“amount”=>37.7}}
discountAllocations: {“allocatedAmount”=>{“amount”=>5.65, “currencyCode”=>“CAD”}, “allocatedAmountSet”=>{“presentmentMoney”=>{“amount”=>5.65, “currencyCode”=>“CAD”}, “shopMoney”=>{“amount”=>5.65, “currencyCode”=>“CAD”}}, “discountApplication”=>{“allocationMethod”=>“ACROSS”, “index”=>0, “targetSelection”=>“ALL”, “targetType”=>“LINE_ITEM”}}
totalDiscountSet = {“presentmentMoney”=>{“amount”=>0.0}} <— ??
The expected result of totalDiscountSet is the sum of all **LineItem.**discountAllocations however in this case it returns 0.
If this is by design and since we cannot use assign to create custom variables to loop/sum discountAllocations, how can we reliably obtain the total sum of all discountAllocations for each LineItem to correctly report the pre-tax price of an item post application of all discount reductions?
Thanks,