Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
Hello,
We are trying to communicate via Flow workflow order information to an ERP but cannot obtain correct pricing information via the API Fields/Flow Variables.
The API lists:
-LineItem.discountAllocations
"The discounts that have been allocated onto the line item by discount applications."
"The total line price after discounts are applied, in shop and presentment currencies."
-LineItem.discountedUnitPriceSet
-LineItem.totalDiscountSet
"The sum of all AppliedDiscounts on this line item, in shop and presentment currencies."
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
"discountApplication"=>{"allocationMethod"=>"ACROSS", "index"=>0, "targetSelection"=>"ALL", "targetType"=>"LINE_ITEM"}
The example order results in the following:
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"}}
discountedTotalSet = {"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"}}
totalDiscountSet = {"presentmentMoney"=>{"amount"=>0.0}}
originalTotalSet = {"presentmentMoney"=>{"amount"=>37.7, "currencyCode"=>"CAD"}, "shopMoney"=>{"amount"=>37.7, "currencyCode"=>"CAD"}}
originalUnitPriceSet = {"presentmentMoney"=>{"amount"=>37.7}}
As Flow workflows do not allow user declared "assign" variables, we cannot just loop and sum the discount allocations. How can we obtain the final sale price after all discounts are applied which in this scenario should be 32.05?
Thank you,
Hi,
Did you get an answer? This is a very interesting observation and deserves clarifications from Shopify.
Thank you
The year-end shopping spree is around the corner! Is your online store ready for the ...
By JasonH Nov 10, 2024We recently spoke with Zopi developers @Zopi about how dropshipping businesses can enha...
By JasonH Oct 23, 2024A big shout out to all of the merchants who participated in our AMA with 2H Media: Holi...
By Jacqui Oct 21, 2024