We're using Scripts to discount line items based on certain criteria using the `change_line_price` method in the script. Is there some way in Flow to see if line item prices have been adjusted and tag the order as having discounts?
I tried a few triggers in flow like
If order cartDiscountAmountSet shopMoney amount is greater than 0
but it isn't tagging the order. The notes on the order show that the Flow was run against the order. Should I be using a different value to check? Is this cartDiscountAmountSet value only set for discount codes?
Great question, and I'd like to be able to do this too.
My first thought was to see if order.totalDiscountsSet.shopMoney.amount > order.cartDiscountAmountSet.shopMoney.amount, since only order.totalDiscountsSet.shopMoney.amount contains line item script discounts. However, it seems we can't compare multiple variables in Flows at this time, we can only compare a variable with a static number.
So I'll go back to the drawing board and maybe have to do this with a private app/webhook or possibly an Arigato Automation.
It would be really nice if Shopify provided a data source for which Script Editor scripts made edits to an order so those could be more easily tracked for reporting and finances.
Have you tried "order - total discount set - shop money" amount is greater than 0?
I haven't tried it with discounts applied through scripts, but I would've thought that should include all discounts, regardless of source.
Have you created a collection on your online store and experienced an issue with adding yo...By Ollie Aug 24, 2022
Connect your PayPal account to allow your customers to checkout using the PayPal gateway a...By Ollie Jul 28, 2022