Need help to figure out a snippet of code.

Stephan_Mantha
Excursionist
14 1 0

I've been trying to figure this one out for sometime now with no luck. 

 

Here's my dilemma: 

 

When a customer places an order, (regardless if the order is partially fulfilled, refunded or cancelled), Shopify still shows the "Total spent to date" as actual sales / money received which can be called upon with liquid code {{ customer.total_spent | money}}.  However that amount might be incorrect especially if some orders get refunded, etc.

 

What I need is a way to show the customer on their Account Profile page, the actual Lifetime spent.  I need (which I have tried with no luck) something like: 

 

customer.total_spent  minus  actual money captured/received  equals the true Lifetime Spent

 

Any and all help would be greatly appreciate.

Thanks,

Stephan

 

PS.... below is a screen capture of one of my test accounts (site is live).  The Lifetime Spent should in theory be $0.00 as all orders have been cancelled.

 

 

Screen Shot 2019-06-14 at 6.25.49 PM.png

 

0 Likes
Stephan_Mantha
Excursionist
14 1 0

Oooooops....  just realized I made a typo:

 

I need: 

 

customer.total_spent  minus  refunds/cancelled  equals the true Lifetime Spent

 

0 Likes
Stephan_Mantha
Excursionist
14 1 0

Anyone?  Is this even doable? 

0 Likes
Stephan_Mantha
Excursionist
14 1 0

Bump

0 Likes
Stephan_Mantha
Excursionist
14 1 0

SOLVED 

0 Likes
PaulNewton
Shopify Partner
2580 134 442

solved how?

Problem Solved? ✔️Accept and ? Like the solution so you can help others.
Buy me a coffee ☕ paypal.me/paulnewton or donate to eff.org
Confused? Busy? Buy a custom solution paull.newton+shopifyforum@gmail.com
0 Likes
Stephan_Mantha
Excursionist
14 1 0

Paid Storetasker to code it.  

0 Likes
Emilstyle
Excursionist
25 0 6

Sorry, who did you pay ? Can you just post the code they used so I can use it as well? 
I'm using flits as well like you and would really like to do the same for my customers

0 Likes