Points deduct when user purchases a product

Hello!

I want to make a workflow where when a User purchases a product, the Points get deducted from their Account depending on the Product/Order Price. More like a bank, when you purchase something, your balance gets deducted.

I hope the following images below could help find a solution to this problem. If not, i can provide more information.




Regards,
Mo.

Whats your Placed Orders Points, and Point Transactions data types? Are those doing anything right now? How about your points field (that one should probably be a number so we can add and subtract)

How detailed do you want to track the points? Could you just store the number of the points, and when an order is placed it subtracts the ordered product’s points from the user’s points?

So Placed Points Order is when a order is placed, it’ll be the order information (ex : the total points of the current order and ordered product which is another data type).

Point transaction is just order notifications and all. not really in need to fix that since it works how i want it to work.

The points field is the User's Points. So how many points the user has.

So when an order is placed with points, i want to subtract the Order's Total Points from the User's Points

Yes, the User Points and the order points are stored in their individual data types.

Overall, i want when an Order is created with points from the points page, it’ll subtract/deduct the Order’s Total Points from the User’s Points.

so lets say the Product is 8,000 Points and the user has 10,000 Points. when the porduct is bought, the User’s Points gets deducted to 2,000. and when the user has insufficient points, they cannot purchase an product.

Lets say i have 5,000 Points and i want to purchase a product that is 7,000 Points, so gradually the system doesnt allow me to purchase that particular product due to my low amount of points.

Hope you understand what i want and where im going with this!

Regards,
Mo.

Okay sounds like all you need to do is change the field to a number for the user’s points (instead of text). Then when they press the “add to cart” button have it do Make changes to Current user and change the Points to Current user's points - products required points. But have a conditional on the button so its Only when current user's points - [your products points] ≥ 0.

Then copy the workflow on the same button, but change the to <, and make it show some warning text or something that it can’t add to cart. And remove the other steps.

i will take a look at it tomorrow, as its getting super late for me.

i’ll reply tomorrow or whenever i got the chance to get on my app!

1 Like

Hello again!

i’ve done the data types and changes but the first time i click it, it works. but second time i click it, it adds it to my cart.
I’ve attached the screenshots below, if you can tell me what i did wrong here.


Disregard the last reply, i figured it out.

Thank you!

1 Like