I've a site where transactions are based purely on credits. No actual money is exchanged. In such a case, I want to restrict users from adding products to cart if they do not have credits to do so.
In steps of how this should be accomplished, here is the sequence of events which I think should work :
Whenever somebody tries to add a product :
- Use Rule "Before adding product to cart"
- I need to get the valueof the following :
- Get user credits
- Get sum of current product + cart value
- Check for condition if credits is greater than product + cart.
- If true, add product to cart else Display "Not enough credits".
The alternative approach to this could be disable add to cart button if there aren't enough credits.
Any help in setting up the rules for this scenario will be appreciated.