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.

  • 1
    How did you implement those credits? Using module userpoints or something else? – Pierre.Vriens Apr 6 '16 at 7:17
  • Using userpoints – vanipriya Apr 8 '16 at 7:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.