how to optionally sum multiple has many
I added a totalAmount computed field on a "groupOrder" which has many shopifyDraftOrder.
Is not working if either value is null/0. Suggestions?
3 Replies
If either the shipping or taxes is null*
got it!
nope that didn't help
Could you please elaborate more on the requirement of this computed field?
I was trying to generate a total based on the following
We have a “global order” that has many draft orders.
1. The sum of all draft orders subtotal
2. Minus a custom field on the customer (decimal percent)
3. Plus the sum of drafts tax
4. Plus the sum of drafts shipping
Instead of the total total always returning the proper amount, if all drafts had null or 0 for shipping, it returned 0
I don’t know why the above didn’t work, but I found a workaround