2

Is it possible to allow certain payments per user in Craft Commerce and if so how and if not how would it be possible?

Just breaking my head around it.

2

There are a variety of ways you can solve this depending on your needs.

One possible way would be to assign users to groups and then use simple twig code to limit the shown payment options at the template level depending on which user (i.e which user of which group) is viewing the page.

In addition, some validation logic in a custom plugin should probably be used to prevent accidents in case a user does somehow submit a payment of a type you don't want them to be using. However I don't necessarily see an ideal event to listen to for that - I'd check with Luke Holder but perhaps onBeforeSaveOrder would work - see https://craftcommerce.com/docs/events-reference#commerce_orders.onbeforesaveorder

Basically it comes down to how you'll be differentiating these users - without more info it's hard to provide a more substantial answer.

1
  • Im creating a custom plugin as a solution. Would be more secure i guess
    – Bram B
    Oct 20 '16 at 11:34

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.